Calculation of the distance to flat and square angles from the image

I take photos of a camera with white paper with a black square with the specified size (for example, 10 cm). The image is taken with different distances to the paper plane and with different camera angles.

Now I need to derive from these images the rotation of the camera, the translation of the camera and the distance to the paper plane, as well as the distance to the corners of the squares.

I am new to image processing, so maybe someone can direct me to some keywords, algorithms, or basic math to search, or even OpenCV functions for research. There will always be some primitive objects on paper, such as squares, so I donโ€™t need any algorithms that will work with any arbitrary image, but I definitely need a fast algorithm.

+4
source share
1 answer

To calculate the rotation and translation of the camera, you need to follow the sevral steps, which are always the same in such problems:

  • Launch the detector on the sample image ( FAST )
  • Launch the detector on all the images that you want to process, there may be a frame taken from the video.
  • Generate Detected Point Descriptors ( SIFTs ).
  • Match descriptors to match ( flannMatcher )
  • Find matching pairs in a homography form ( findHomography () )
  • Find a camera from homography .

You have links to the methods in this tutorial .

+4
source

Source: https://habr.com/ru/post/1434154/


All Articles