简体   繁体   中英

How to get the top view of this image with reference to coin?

I am working on object detection project and to measure it dimension correctly, for that I am using coin for reference, to measure accurately, I need a bird eye view of this image. [Image Here]

1

Disclaimer: This approach is not mathematically complete nor exact, I know. Although I hope someone will find it useful for real life applications or has some positive ideas how to improve it.

As you can see from the discussion you can't get an accurate estimation of the vanishing point / the horizon by just one coin because a circle can be projected to the same ellipse for different vananishing points. However if there are two coins of same size at bottom center and top center of the image it should be manageble to get an acceptable accuracy:

在此处输入图像描述

If your business allows it you can do assumptions that will lower the accuracy but make it easier to implement:

  • Assume that the plane's normal vector is parallel to the yz-plane of your image, ie the camera is held in a "normal" way and - in relation to the plane - not tilted to the left or right.
  • Assume that the two coins are placed in the middle of the picture.

With this you can:

  1. Extract the two ellipses.
  2. Get the two tangents of both ellipses left and right.
  3. Get the two horizontal tangents of the bigger ellipse.
  4. Finnally get the four points where the tangents intersect.
  5. Use the four points as input to warpPerspective as descibed here .

Of course, if we are talking about a mobile app, then sensor and camera data from the phone could help without bothering the user too much.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM