How to find the disparity in image processing.

In summary, the conversation discusses finding the distance Z of an object from a camera using two images taken from two cameras in a canonical position and a baseline of b. The formula for finding Z is Z=bf/D where D is disparity. The individual is seeking suggestions for mathematics and algorithms to find disparity using C# and is unsure of how to relate the corresponding point to disparity and which unit of measurement is used for disparity. They also mention essential and fundamental matrices and question whether they are necessary for finding disparity. Their supervisor has requested them to write the algorithm themselves without using libraries. A link and further details regarding disparity and essential/fundamental matrices are provided for reference.
  • #1
ngkamsengpeter
195
0
Given 2 image taken from 2 camera in canonical position, and the baseline is b, we can find the distance Z of an object from the camera. We know that

Z=bf/D where D is disparity.

I read some books but still have no idea of how to find the disparity using c#. Can someone suggest some mathematics and algorithm for me?
I also read about finding the correspondence point of the image but i have no idea of how the corresponding point related to disparity. And what is the unit of disparity we found using algorithm.Is it in unit of pixel and can we plug directly into above equation to find Z in unit of mm or cm? Or how can we convert focal length into pixel?

I also read about the essential matrix and fundamental matrix, do i really need to find them? because if i can find disparity without using these matrix, then i already can find the distance using formula above. This matrices is very difficult to solve.

My supervisor require me to write the entire algorithm by myself without using any library such as opencv. So someone please give me the mathematics behind the algorithm.
 
Technology news on Phys.org
  • #3


I can understand your confusion and frustration in trying to find the disparity in image processing. Finding the disparity is an important step in depth estimation and is crucial in many applications such as 3D reconstruction and object detection. I will try to provide some guidance and clarification on the concepts you have mentioned.

Firstly, let's understand what disparity means in image processing. Disparity refers to the difference in the location of an object between two images taken from different viewpoints. This difference can be used to estimate the depth of the object from the camera.

To find the disparity, we need to first find the corresponding points in the two images. These points are the same feature or object in both images but appear at different locations due to the difference in viewpoints. This is where the essential matrix and fundamental matrix come into play. These matrices provide a way to find the corresponding points between two images. So, yes, you do need to find these matrices in order to find the disparity.

Now, coming to the mathematics and algorithms, I cannot provide a specific algorithm as it would depend on the specific scenario and the images being used. However, I can provide some general steps that can help you in finding the disparity.

1. Pre-processing: The first step is to pre-process the images to improve their quality and remove any noise. This can include operations like image resizing, noise removal, and image enhancement.

2. Feature detection and matching: The next step is to detect and match features in the two images. This can be done using techniques like SIFT (Scale-Invariant Feature Transform) or SURF (Speeded-Up Robust Features). These algorithms will provide you with the corresponding points between the two images.

3. Calculating the essential matrix: Once you have the corresponding points, you can use them to calculate the essential matrix. This matrix represents the relationship between the two camera viewpoints and is crucial in finding the disparity.

4. Calculating the fundamental matrix: The fundamental matrix is derived from the essential matrix and provides a way to find the disparity between the corresponding points in the two images.

5. Estimating the disparity: Finally, you can use the fundamental matrix to estimate the disparity between the corresponding points. This disparity can then be used in the formula Z = bf/D to find the depth of the object from the camera.

Regarding your question about the unit of disparity, it is usually measured in pixels as it represents the difference in the location of the object in the two images
 

Question 1: What is disparity in image processing?

Disparity in image processing refers to the difference in position or depth between corresponding points in two images of the same scene captured from different viewpoints.

Question 2: Why is it important to find disparity in image processing?

Finding disparity allows for the creation of 3D images and reconstruction of depth information, which can be useful in various applications such as augmented reality, object detection, and robotics.

Question 3: How is disparity calculated in image processing?

Disparity is typically calculated using stereo vision, where two images of the same scene are captured from different viewpoints and then compared to find the differences in position or depth of corresponding points. This can be done through various algorithms such as block matching, semi-global matching, or deep learning techniques.

Question 4: What factors can affect the accuracy of disparity calculation?

Several factors can affect the accuracy of disparity calculation, including the quality of the images, camera calibration, lighting conditions, and occlusions in the scene.

Question 5: What are some common applications of disparity in image processing?

Disparity in image processing has various applications, including 3D reconstruction, depth estimation, object detection and tracking, autonomous driving, and medical imaging.

Similar threads

  • Programming and Computer Science
Replies
8
Views
1K
  • Programming and Computer Science
Replies
13
Views
4K
  • Programming and Computer Science
Replies
10
Views
1K
  • Programming and Computer Science
Replies
19
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
830
  • Engineering and Comp Sci Homework Help
Replies
2
Views
4K
  • Programming and Computer Science
Replies
2
Views
720
  • Programming and Computer Science
Replies
18
Views
2K
Replies
8
Views
1K
  • Programming and Computer Science
Replies
8
Views
2K
Back
Top