lines = epipolarLine(F,points)
returns an M-by-3 matrix, lines. The matrix
represents the computed epipolar lines in image I2 corresponding to the
points in image I1. The input
F represents the fundamental matrix that maps points in
I1 to epipolar lines in image I2.
I1 = imread('viprectification_deskLeft.png');
figure;
subplot(121);
imshow(I1);
title('Inliers and Epipolar Lines in First Image'); hold on;
plot(matchedPoints1(inliers,1),matchedPoints1(inliers,2),'go')
Compute the intersection points of the lines and the image border.
points = lineToBorderPoints(epiLines,size(I1));
Show the epipolar lines in the first image
line(points(:,[1,3])',points(:,[2,4])');
Show the inliers in the second image.
I2 = imread('viprectification_deskRight.png');
subplot(122);
imshow(I2);
title('Inliers and Epipolar Lines in Second Image'); hold on;
plot(matchedPoints2(inliers,1),matchedPoints2(inliers,2),'go')
Compute and show the epipolar lines in the second image.
Fundamental matrix, specified as a 3-by-3 matrix. F must be
double or single. If P1 represents a point in the first image
I1 that corresponds to P2, a point in the second
image I2, then:
[P2,1] * F *
[P1,1]' = 0
In computer vision, the fundamental matrix is a 3-by-3 matrix which relates
corresponding points in stereo images. When two cameras view a 3-D scene from two
distinct positions, there are a number of geometric relations between the 3-D points and
their projections onto the 2-D images that lead to constraints between the image points.
Two images of the same scene are related by epipolar geometry.
Data Types: single | double
F' — Fundamental matrix 3-by-3 matrix (default)
Fundamental matrix, specified as a 3-by-3 matrix. The F'
fundamental matrix maps points in image I2 to epipolar lines in image
I1.
Data Types: single | double
points — Coordinates of points M-by-2 | point feature object
Coordinates of points, specified as an M-by-2 matrix, where
M is the number of points, or a point feature object. The matrix
contains the (x,y) coordinates for each point. For
details on supported point feature objects, see Point Feature Types.
An M-by-3 matrix, where M represents the
number of lines. Each row of the matrix must be of the form,
[A,B,C]. These values
corresponds to the definition of the line:
A * x + B *
y + C = 0.
Extended Capabilities
C/C++ Code Generation Generate C and C++ code using MATLAB® Coder™.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.