How can I measure distances in stereo images?

前端 未结 1 1307
深忆病人
深忆病人 2021-02-10 20:43

I Have two images( left and right ) I want to measure the real distance on image? When I click on the image, ı ll get real distance to clicked point to camera.

Left Imag

1条回答
  •  逝去的感伤
    2021-02-10 21:31

    While I do not know the specifics of EmguCV, I can tell you the concept behind how stereo depth perception works, and hopefully you can then implement some sort of fix.

    Essentially, the first step is to segment and match parts of the image. What you are trying to accomplish here is to identify the parts of the image that are the "same" in each. For instance, you want to be able to identify the center of the lamp in each image. The feature set you use to do this is up to you, but one basic one that may help is by using an edge detector (like the canny method) and trying to match contours with similar shapes. Additionally, another technique that is common is breaking up the image into smaller blocks and matching features in those blocks. The method you use is up to you.

    Next, you are able to calculate the distance of the matched objects from the center of your camera in both images. You will need to do this both for the x and y directions. We will call this your x and y disparity.

    Now, you need to know the distance between the centers of the cameras that took the picture. Once you have this, there is some simple trig that you can do to solve for distance. There is a rather simple explanation of this here

    Again, this is all conceptual, but it is important to know how the algorithms you are applying work. The first step to understanding the solution to a problem is to understand the problem itself. Once you have a full understanding of the problem, and the procedure for solving it, implementing that procedure with any library should become much easier. Good luck!

    0 讨论(0)
提交回复
热议问题