5
5
----
6
6
7
7
In this session,
8
- - We will learn to create depth map from stereo images.
8
+ - We will learn to create a depth map from stereo images.
9
9
10
10
Basics
11
11
------
12
12
13
- In last session, we saw basic concepts like epipolar constraints and other related terms. We also
13
+ In the last session, we saw basic concepts like epipolar constraints and other related terms. We also
14
14
saw that if we have two images of same scene, we can get depth information from that in an intuitive
15
- way. Below is an image and some simple mathematical formulas which proves that intuition. (Image
15
+ way. Below is an image and some simple mathematical formulas which prove that intuition. (Image
16
16
Courtesy :
17
17
18
18
![ image] ( images/stereo_depth.jpg )
@@ -24,7 +24,7 @@ following result:
24
24
25
25
\f$x\f$ and \f$x'\f$ are the distance between points in image plane corresponding to the scene point 3D and
26
26
their camera center. \f$B\f$ is the distance between two cameras (which we know) and \f$f\f$ is the focal
27
- length of camera (already known). So in short, above equation says that the depth of a point in a
27
+ length of camera (already known). So in short, the above equation says that the depth of a point in a
28
28
scene is inversely proportional to the difference in distance of corresponding image points and
29
29
their camera centers. So with this information, we can derive the depth of all pixels in an image.
30
30
@@ -35,7 +35,7 @@ how we can do it with OpenCV.
35
35
Code
36
36
----
37
37
38
- Below code snippet shows a simple procedure to create disparity map.
38
+ Below code snippet shows a simple procedure to create a disparity map.
39
39
@code {.py}
40
40
import numpy as np
41
41
import cv2
@@ -49,7 +49,7 @@ disparity = stereo.compute(imgL,imgR)
49
49
plt.imshow(disparity,'gray')
50
50
plt.show()
51
51
@endcode
52
- Below image contains the original image (left) and its disparity map (right). As you can see, result
52
+ Below image contains the original image (left) and its disparity map (right). As you can see, the result
53
53
is contaminated with high degree of noise. By adjusting the values of numDisparities and blockSize,
54
54
you can get a better result.
55
55
0 commit comments