The base class defining stereo camera. More...
#include <stereoCamera.h>
Public Member Functions | |
StereoCamera (bool rectify=true) | |
Default Constructor. More... | |
StereoCamera (yarp::os::ResourceFinder &rf, bool rectify=true) | |
Costructor for initialization from file. More... | |
StereoCamera (Camera First, Camera Second, bool rectify=true) | |
Constructor for initialization using two calibrated cameras. More... | |
void | initELAS (yarp::os::ResourceFinder &rf) |
Initialization of ELAS parameters. More... | |
void | stereoCalibration (vector< string > imageList, int boardWidth, int boardHeight, float sqsize=1.0) |
It performs the stereo camera calibration. More... | |
void | saveCalibration (string extrinsicFilePath, string intrinsicFilePath) |
It saves the calibration. More... | |
void | setImages (const Mat &firstImg, const Mat &secondImg) |
It stores in memory a couple of images. More... | |
cv::Mat | findMatch (bool visualize=false, double displacement=20.0, double radius=200.0) |
It finds matches between two images. More... | |
void | computeDisparity (bool best=true, int uniquenessRatio=15, int speckleWindowSize=50, int speckleRange=16, int numberOfDisparities=64, int SADWindowSize=7, int minDisparity=0, int preFilterCap=63, int disp12MaxDiff=0) |
It computes the Disparity Map (see stereoDisparity). More... | |
void | undistortImages () |
It undistorts the images. More... | |
void | horn (Mat &K1, Mat &K2, vector< Point2f > &Points1, vector< Point2f > &Points2, Mat &Rot, Mat &Tras) |
It performs the horn relative orientations algorithm i.e. More... | |
void | hornRelativeOrientations () |
It performs the horn relative orientations, all the parameters are assumed initialized in the StereoCamera object. More... | |
Point3f | triangulation (Point2f &point1, Point2f &point2) |
It performs the triangulation using the stored in the internal P1 and P2 3x4 Camera Matrices. More... | |
Point3f | triangulation (Point2f &point1, Point2f &point2, Mat Camera1, Mat Camera2) |
It performs the triangulation (HZ Chap 12.2 homogenous solution). More... | |
Point3f | triangulationLS (Point2f &point1, Point2f &point2, Mat Camera1, Mat Camera2) |
It performs the least square triangulation (HZ Chap 12.2 Inhomogenous solution). More... | |
Point3f | metricTriangulation (Point2f &point1, double thMeters=10) |
It performs the metric triangulation given the pixel coordinates on the first image. More... | |
Point3f | metricTriangulation (Point2f &point1, Mat &H, double thMeters=10) |
It performs the metric triangulation given the pixel coordinates on the first image. More... | |
Point3f | triangulateKnownDisparity (float u, float v, float d, Mat &H) |
It performs the metric triangulation given the pixel coordinates on the first image and the disparity between the two RECTIFIED images. More... | |
void | estimateEssential () |
It estimates the essential matrix (3x3) E between two views. More... | |
bool | essentialDecomposition () |
It decomposes the essential matrix in Rotation and Translation between the two views. More... | |
void | chierality (Mat &R1, Mat &R2, Mat &t1, Mat &t2, Mat &R, Mat &t, vector< Point2f > points1, vector< Point2f > points2) |
It performs the chierality test: given a couple of rotation matrices, translation vectors and matches it finds the correct rotation and translation s.t. More... | |
const Mat & | getImLeft () const |
It returns the left (first) image. More... | |
const Mat & | getImRight () const |
It returns the right (second) image. More... | |
const Mat & | getImLeftUnd () const |
It returns the left undistorted image. More... | |
const Mat & | getImRightUnd () const |
It returns the right undistorted image. More... | |
const Mat & | getDisparity () const |
It returns the disparity image. More... | |
const Mat & | getDisparity16 () const |
It returns the disparity image. More... | |
const Mat & | getQ () const |
It returns the 4x4 disparity-to-depth mapping matrix. More... | |
const Mat & | getKleft () const |
It returns the 3x3 left camera matrix. More... | |
const Mat & | getKright () const |
It returns the 3x3 right camera matrix. More... | |
const Mat & | getFundamental () const |
It returns the 3x3 fundamental matrix. More... | |
const vector< Point2f > & | getMatchLeft () const |
It returns the pixel coordinates of the matches in the left image. More... | |
const vector< Point2f > & | getMatchRight () const |
It returns the pixel coordinates of the matches in the right image. More... | |
const Mat & | getTranslation () const |
It returns the translation vector between the two cameras. More... | |
const Mat & | getRotation () const |
It returns the rotation matrix between the two cameras. More... | |
const Mat & | getMapperL () const |
It returns the mapping between the original left camera and the rectified left camera. More... | |
const Mat & | getMapperR () const |
It returns the mapping between the original right camera and the rectified right camera. More... | |
const Mat & | getRLrect () const |
It returns the rotation matrix between the original left camera and the rectified left camera. More... | |
const Mat & | getRRrect () const |
It returns the rotation matrix between the original right camera and the rectified right camera. More... | |
void | setRotation (Mat &Rot, int mode=0) |
It sets the rotation matrix (if known) between the first and the second camera. More... | |
void | setTranslation (Mat &Tras, int mul=0) |
It sets the translation vector (if known) between the first and the second camera. More... | |
void | setIntrinsics (Mat &K1, Mat &K2, Mat &Dist1, Mat &Dist2) |
It sets the intrinsic parameters. More... | |
void | rectifyImages () |
The method rectifies the two images: it transform each image plane such that pairs conjugate epipolar lines become collinear and parallel to one of the image axes (i.e. More... | |
const Mat & | getLRectified () const |
The method returns the first rectified image. More... | |
const Mat & | getRRectified () const |
The method returns the second rectified image. More... | |
vector< Point2f > | projectPoints3D (string camera, vector< Point3f > &points3D, Mat &H) |
The method returns the 2D projection of a set of 3D points in the cartesian space to the specified camera. More... | |
Mat | computeWorldImage (Mat &H) |
The method returns a 3-Channels float image with the world coordinates w.r.t H reference system. More... | |
const Mat & | getDistCoeffRight () const |
It returns the 5x1 right distortion coefficients. More... | |
const Mat & | getDistCoeffLeft () const |
It returns the 5x1 left distortion coefficients. More... | |
Point2f | getDistortedPixel (int u, int v, int cam=1) |
Given the u,v pixel coordinates in the undistorted image the method returns the original position of the pixel in the distorted frame. More... | |
Mat | drawMatches () |
The method returns a 3-Channels 8bit image with the image matches. More... | |
void | setMatches (std::vector< cv::Point2f > &pointsL, std::vector< cv::Point2f > &pointsR) |
The function initialize the matches of the current image pair. More... | |
void | setExpectedPosition (Mat &Rot, Mat &Tran) |
The function set the expected Rotation and Translation parameters for the current image pair. More... | |
Mat | FfromP (Mat &P1, Mat &P2) |
The function computes the fundamental matrix starting from known camera matrices. More... | |
Point2f | fromRectifiedToOriginal (int u, int v, int camera) |
Given the u,v pixel coordinates in the rectified image the method returns the position of the pixel in the non-rectified frame. More... | |
cv::Mat | remapDisparity (cv::Mat disp) |
Remaps the disparity map on the basis of the mapping previously computed. More... | |
void | updateMappings () |
XXXXXXXXXXXXXXXXXXXX. More... | |
Data Fields | |
Mat | filtered_disp |
The base class defining stereo camera.
It allows to calibrate the cameras, to undistort a pair of images, to find matches between two images, to triangulate points and to estimate motion between two images. The basic assumption is that the two images come from a stereo camera, however this class works also with two arbitrary images.
Definition at line 91 of file stereoCamera.h.
StereoCamera::StereoCamera | ( | bool | rectify = true | ) |
Default Constructor.
You should initialize all the intrinsic and extrinsic parameters using the provided methods.
Definition at line 116 of file stereoCamera.cpp.
StereoCamera::StereoCamera | ( | yarp::os::ResourceFinder & | rf, |
bool | rectify = true |
||
) |
Costructor for initialization from file.
rf | is the config file generated by the stereoCalib module. |
Definition at line 128 of file stereoCamera.cpp.
References setIntrinsics(), setRotation(), and setTranslation().
Constructor for initialization using two calibrated cameras.
First | the first camera (Left eye is assumed but you can use any arbitrary camera). The 3D point coordinates have this reference system. |
Second | the second camera (Right eye is assumed). |
Definition at line 147 of file stereoCamera.cpp.
References Camera::getCameraMatrix(), and Camera::getDistVector().
void StereoCamera::chierality | ( | Mat & | R1, |
Mat & | R2, | ||
Mat & | t1, | ||
Mat & | t2, | ||
Mat & | R, | ||
Mat & | t, | ||
vector< Point2f > | points1, | ||
vector< Point2f > | points2 | ||
) |
It performs the chierality test: given a couple of rotation matrices, translation vectors and matches it finds the correct rotation and translation s.t.
the triangulated points have their depth coordinates greater than 0. The method is used by essentialDecomposition, indeed an essential matrix generates 2 rotations and 2 translation. The chierality test is needed in order to discard wrong rototranslations.
R1 | first rotation 3x3 matrix |
R2 | second rotation 3x3 matrix |
t1 | first translation 3x1 matrix |
t2 | second translation 3x1 matrix |
R | output rotation matrix |
t | output translation matrix |
points1 | corrispondences in the first image |
points2 | corrispondences in the second image |
Definition at line 1171 of file stereoCamera.cpp.
References triangulation().
Referenced by essentialDecomposition().
void StereoCamera::computeDisparity | ( | bool | best = true , |
int | uniquenessRatio = 15 , |
||
int | speckleWindowSize = 50 , |
||
int | speckleRange = 16 , |
||
int | numberOfDisparities = 64 , |
||
int | SADWindowSize = 7 , |
||
int | minDisparity = 0 , |
||
int | preFilterCap = 63 , |
||
int | disp12MaxDiff = 0 |
||
) |
It computes the Disparity Map (see stereoDisparity).
best | set equal true for better accuracy, equal false for save computation. |
uniquenessRatio | The margin in percents by which the best (minimum) computed cost function value should win the second best value to consider the found match correct. Normally, some value within 5-15 range is good enough. |
speckleWindowSize | Maximum size of smooth disparity regions to consider them noise speckles and invdalidate. Set it to 0 to disable speckle filtering. Otherwise, set it somewhere in 50-200 range. |
speckleRange | Maximum disparity variation within each connected component. If you do speckle filtering, set it to some positive value, multiple of 16. Normally, 16 or 32 is good enough. |
Definition at line 581 of file stereoCamera.cpp.
Mat StereoCamera::computeWorldImage | ( | Mat & | H | ) |
The method returns a 3-Channels float image with the world coordinates w.r.t H reference system.
H | the transformation from the camera reference system to the H reference system |
Definition at line 2231 of file stereoCamera.cpp.
References getRLrect().
Mat StereoCamera::drawMatches | ( | ) |
The method returns a 3-Channels 8bit image with the image matches.
Definition at line 1668 of file stereoCamera.cpp.
bool StereoCamera::essentialDecomposition | ( | ) |
It decomposes the essential matrix in Rotation and Translation between the two views.
The output is stored in the private members R and T.
Definition at line 1071 of file stereoCamera.cpp.
References chierality().
void StereoCamera::estimateEssential | ( | ) |
It estimates the essential matrix (3x3) E between two views.
The output is stored in the private member E.
Definition at line 965 of file stereoCamera.cpp.
References FfromP().
Mat StereoCamera::FfromP | ( | Mat & | P1, |
Mat & | P2 | ||
) |
The function computes the fundamental matrix starting from known camera matrices.
P1 | a 3x4 matrix representing the camera matrix of the left view. |
P2 | a 3x4 matrix representing the camera matrix of the right view. |
Definition at line 890 of file stereoCamera.cpp.
Referenced by estimateEssential().
Mat StereoCamera::findMatch | ( | bool | visualize = false , |
double | displacement = 20.0 , |
||
double | radius = 200.0 |
||
) |
It finds matches between two images.
SIFT detector and descriptor is used.
visualize | true if you want to visualize matches between images |
displacement | maximum pixel displacement between first and second camera |
radius | maximum radius between the first candidate match and the second one |
Definition at line 750 of file stereoCamera.cpp.
Point2f StereoCamera::fromRectifiedToOriginal | ( | int | u, |
int | v, | ||
int | camera | ||
) |
Given the u,v pixel coordinates in the rectified image the method returns the position of the pixel in the non-rectified frame.
u | the x pixel coordinate in the rectified image. |
v | the y pixel coordinate in the rectified image. |
cam | cam=1 for left image, cam=2 for right image. |
Definition at line 722 of file stereoCamera.cpp.
const Mat & StereoCamera::getDisparity | ( | ) | const |
It returns the disparity image.
Definition at line 533 of file stereoCamera.cpp.
const Mat & StereoCamera::getDisparity16 | ( | ) | const |
It returns the disparity image.
Definition at line 538 of file stereoCamera.cpp.
Referenced by metricTriangulation().
const Mat & StereoCamera::getDistCoeffLeft | ( | ) | const |
It returns the 5x1 left distortion coefficients.
Definition at line 2283 of file stereoCamera.cpp.
const Mat & StereoCamera::getDistCoeffRight | ( | ) | const |
It returns the 5x1 right distortion coefficients.
Definition at line 2289 of file stereoCamera.cpp.
Point2f StereoCamera::getDistortedPixel | ( | int | u, |
int | v, | ||
int | cam = 1 |
||
) |
Given the u,v pixel coordinates in the undistorted image the method returns the original position of the pixel in the distorted frame.
u | the x pixel coordinate in the undistorted image. |
v | the y pixel coordinate in the undistorted image. |
cam | cam=1 for left image, cam=2 for right image. |
Definition at line 2305 of file stereoCamera.cpp.
const Mat & StereoCamera::getFundamental | ( | ) | const |
It returns the 3x3 fundamental matrix.
Definition at line 1495 of file stereoCamera.cpp.
const Mat & StereoCamera::getImLeft | ( | ) | const |
It returns the left (first) image.
Definition at line 523 of file stereoCamera.cpp.
Referenced by updateMappings().
const Mat & StereoCamera::getImLeftUnd | ( | ) | const |
It returns the left undistorted image.
Definition at line 1490 of file stereoCamera.cpp.
const Mat & StereoCamera::getImRight | ( | ) | const |
It returns the right (second) image.
Definition at line 528 of file stereoCamera.cpp.
const Mat & StereoCamera::getImRightUnd | ( | ) | const |
It returns the right undistorted image.
Definition at line 1500 of file stereoCamera.cpp.
const Mat & StereoCamera::getKleft | ( | ) | const |
It returns the 3x3 left camera matrix.
Definition at line 96 of file stereoCamera.cpp.
const Mat & StereoCamera::getKright | ( | ) | const |
It returns the 3x3 right camera matrix.
Definition at line 101 of file stereoCamera.cpp.
const Mat & StereoCamera::getLRectified | ( | ) | const |
The method returns the first rectified image.
Definition at line 2161 of file stereoCamera.cpp.
const Mat & StereoCamera::getMapperL | ( | ) | const |
It returns the mapping between the original left camera and the rectified left camera.
Definition at line 1915 of file stereoCamera.cpp.
Referenced by metricTriangulation().
const Mat & StereoCamera::getMapperR | ( | ) | const |
It returns the mapping between the original right camera and the rectified right camera.
Definition at line 1920 of file stereoCamera.cpp.
const vector< Point2f > & StereoCamera::getMatchLeft | ( | ) | const |
It returns the pixel coordinates of the matches in the left image.
Definition at line 106 of file stereoCamera.cpp.
const vector< Point2f > & StereoCamera::getMatchRight | ( | ) | const |
It returns the pixel coordinates of the matches in the right image.
Definition at line 111 of file stereoCamera.cpp.
const Mat & StereoCamera::getQ | ( | ) | const |
It returns the 4x4 disparity-to-depth mapping matrix.
Definition at line 543 of file stereoCamera.cpp.
const Mat & StereoCamera::getRLrect | ( | ) | const |
It returns the rotation matrix between the original left camera and the rectified left camera.
Definition at line 1905 of file stereoCamera.cpp.
Referenced by computeWorldImage(), metricTriangulation(), and triangulateKnownDisparity().
const Mat & StereoCamera::getRotation | ( | ) | const |
It returns the rotation matrix between the two cameras.
Definition at line 1596 of file stereoCamera.cpp.
Referenced by horn().
const Mat & StereoCamera::getRRectified | ( | ) | const |
The method returns the second rectified image.
Definition at line 2167 of file stereoCamera.cpp.
const Mat & StereoCamera::getRRrect | ( | ) | const |
It returns the rotation matrix between the original right camera and the rectified right camera.
Definition at line 1910 of file stereoCamera.cpp.
const Mat & StereoCamera::getTranslation | ( | ) | const |
It returns the translation vector between the two cameras.
Definition at line 1591 of file stereoCamera.cpp.
void StereoCamera::horn | ( | Mat & | K1, |
Mat & | K2, | ||
vector< Point2f > & | Points1, | ||
vector< Point2f > & | Points2, | ||
Mat & | Rot, | ||
Mat & | Tras | ||
) |
It performs the horn relative orientations algorithm i.e.
it estimates the motion from one camera to another one using a initial guess. A good initial guess can be obtained using the essentialDecomposition method.
K1 | 3x3 matrix with intrinsic parameters of the first camera |
K2 | 3x3 matrix with intrinsic parameters of the second camera |
Points1 | matches in the first image |
Points2 | matches in the second image |
Rot | initial rotation (3x3 matrix) guess. The new output rotation is stored here |
Tras | initial translation (3x1 matrix) guess. The new output translation is stored here |
Definition at line 1697 of file stereoCamera.cpp.
References getRotation().
Referenced by hornRelativeOrientations().
void StereoCamera::hornRelativeOrientations | ( | ) |
It performs the horn relative orientations, all the parameters are assumed initialized in the StereoCamera object.
The new output Rotation and Translation matrices are stored in the R and T members.
Definition at line 1635 of file stereoCamera.cpp.
References horn().
void StereoCamera::initELAS | ( | yarp::os::ResourceFinder & | rf | ) |
Initialization of ELAS parameters.
rf | The ResourceFinder mechanism is used to set the parameters either to the default value or to the value passed by the user via command line. See the documentation of the SFM module to get the list of parameters that are processed by this initialization function. |
Definition at line 164 of file stereoCamera.cpp.
Point3f StereoCamera::metricTriangulation | ( | Point2f & | point1, |
double | thMeters = 10 |
||
) |
It performs the metric triangulation given the pixel coordinates on the first image.
Run compute disparity before using this method.
point1 | the pixel coordinates in the first image. |
Definition at line 1954 of file stereoCamera.cpp.
References getDisparity16(), and getMapperL().
Point3f StereoCamera::metricTriangulation | ( | Point2f & | point1, |
Mat & | H, | ||
double | thMeters = 10 |
||
) |
It performs the metric triangulation given the pixel coordinates on the first image.
The 3D Point is w.r.t the system defined by the parameter H. Run compute disparity before using this method.
point1 | the pixel coordinates in the first image. |
H | the 4x4 rototranslation matrix of the system. |
Definition at line 2030 of file stereoCamera.cpp.
References getDisparity16(), getMapperL(), and getRLrect().
vector< Point2f > StereoCamera::projectPoints3D | ( | string | camera, |
vector< Point3f > & | points3D, | ||
Mat & | H | ||
) |
The method returns the 2D projection of a set of 3D points in the cartesian space to the specified camera.
camera | "left" or "right" camera |
point3D | the list of the 3D position in the reference frame H |
H | the transformation from the camera reference system to the H reference system |
Definition at line 2173 of file stereoCamera.cpp.
void StereoCamera::rectifyImages | ( | ) |
The method rectifies the two images: it transform each image plane such that pairs conjugate epipolar lines become collinear and parallel to one of the image axes (i.e.
there is 0 disparity on the Y axis).
Definition at line 548 of file stereoCamera.cpp.
cv::Mat StereoCamera::remapDisparity | ( | cv::Mat | disp | ) |
Remaps the disparity map on the basis of the mapping previously computed.
disp | the disparity map to be remapped |
Definition at line 2423 of file stereoCamera.cpp.
void StereoCamera::saveCalibration | ( | string | extrinsicFilePath, |
string | intrinsicFilePath | ||
) |
It saves the calibration.
extrinsicFilePath | the path of the extrinsic parameters file |
intrinsicFilePath | the path of the intrinsic parameters file |
Definition at line 470 of file stereoCamera.cpp.
void StereoCamera::setExpectedPosition | ( | Mat & | Rot, |
Mat & | Tran | ||
) |
The function set the expected Rotation and Translation parameters for the current image pair.
They can be computed using the Kinematics.
Rot | 3x3 matrix representing the rotation between the left and the right camera. |
Tran | 3x1 vector representing the translation between the left and the right camera. |
Definition at line 2416 of file stereoCamera.cpp.
void StereoCamera::setImages | ( | const Mat & | firstImg, |
const Mat & | secondImg | ||
) |
It stores in memory a couple of images.
firstImg | the images acquired from the first (main) camera |
secondImg | the images acquired from the second (secondary) camera |
Definition at line 231 of file stereoCamera.cpp.
void StereoCamera::setIntrinsics | ( | Mat & | K1, |
Mat & | K2, | ||
Mat & | Dist1, | ||
Mat & | Dist2 | ||
) |
It sets the intrinsic parameters.
K1 | 3x3 camera matrix of the first camera. |
K2 | 3x3 camera matrix of the second camera. |
Dist1 | 4x1 distortion coefficients vector of the first camera. |
Dist2 | 4x1 distortion coefficients vector of the second camera. |
Definition at line 1940 of file stereoCamera.cpp.
Referenced by StereoCamera().
void StereoCamera::setMatches | ( | std::vector< cv::Point2f > & | pointsL, |
std::vector< cv::Point2f > & | pointsR | ||
) |
The function initialize the matches of the current image pair.
For example matches can be computed in GPU with higher framerate.
pointsL | vector of Point2f representing the keypoints on the left image. |
pointsR | vector of Point2f representing the keypoints on the right image. |
Definition at line 2408 of file stereoCamera.cpp.
void StereoCamera::setRotation | ( | Mat & | Rot, |
int | mode = 0 |
||
) |
It sets the rotation matrix (if known) between the first and the second camera.
Rot | the 3x3 rotation matrix. |
mode | the following values are allowed: mode=0 the rotation matrix R is set equal to Rot. mode=1 the rotation matrix R is set equal to Rot*R. mode=2 the rotation matrix R is set equal to Rot*Rinit. |
Definition at line 1505 of file stereoCamera.cpp.
Referenced by StereoCamera().
void StereoCamera::setTranslation | ( | Mat & | Tras, |
int | mul = 0 |
||
) |
It sets the translation vector (if known) between the first and the second camera.
Tras | the 3x1 translation matrix. |
mode | the following values are allowed: mode=0 the translation vector T is set equal to Tras. mode=1 the translation vector T is set equal to Tras+T. mode=2 the translation vector T is set equal to Tras+Tinit. |
Definition at line 1521 of file stereoCamera.cpp.
Referenced by StereoCamera().
void StereoCamera::stereoCalibration | ( | vector< string > | imageList, |
int | boardWidth, | ||
int | boardHeight, | ||
float | sqsize = 1.0 |
||
) |
It performs the stereo camera calibration.
(see stereoCalibration module)
imageList | is the list containing the paths of the images with the chessboard patterns. even indices refer to Left camera images (i.e. main camera images), while odd indices refer to Right camera images. |
boardWidth | the number of inner corners in the width direction of the chess board pattern (see stereoCalibration module) |
boardHeight | the number of inner corners in the height direction of the chess board pattern (see stereoCalibration module) |
sqsize | the size of the square of the chess board pattern. It is needed for a metric reconstruction. |
Definition at line 250 of file stereoCamera.cpp.
Point3f StereoCamera::triangulateKnownDisparity | ( | float | u, |
float | v, | ||
float | d, | ||
Mat & | H | ||
) |
It performs the metric triangulation given the pixel coordinates on the first image and the disparity between the two RECTIFIED images.
The 3D Point is w.r.t the system defined by the parameter H.
u | the pixel x coordinate in the first image. |
v | the pixel y coordinate in the first image. |
d | the disparity on the x coordinate between the two rectified images. |
H | the 4x4 rototranslation matrix of the system can be an empty matrix. |
Definition at line 2113 of file stereoCamera.cpp.
References getRLrect().
Point3f StereoCamera::triangulation | ( | Point2f & | point1, |
Point2f & | point2 | ||
) |
It performs the triangulation using the stored in the internal P1 and P2 3x4 Camera Matrices.
The triangulation obtained is not metric! Use the method metricTriangulation if you want a metric triangulation.
point1 | the 2D point coordinates in the first image. |
point2 | the 2D point coordinates in the second image. |
Definition at line 861 of file stereoCamera.cpp.
Referenced by chierality().
Point3f StereoCamera::triangulation | ( | Point2f & | point1, |
Point2f & | point2, | ||
Mat | Camera1, | ||
Mat | Camera2 | ||
) |
It performs the triangulation (HZ Chap 12.2 homogenous solution).
The triangulation obtained is not metric! Use the method metricTriangulation if you want a metric triangulation.
point1 | the 2D point coordinates in the first image. |
point2 | the 2D point coordinates in the second image. |
Camera1 | the 3x4 camera matrix of the first image. |
Camera2 | the 3x4 camera matrix of the second image. |
Definition at line 1370 of file stereoCamera.cpp.
Point3f StereoCamera::triangulationLS | ( | Point2f & | point1, |
Point2f & | point2, | ||
Mat | Camera1, | ||
Mat | Camera2 | ||
) |
It performs the least square triangulation (HZ Chap 12.2 Inhomogenous solution).
The triangulation obtained is not metric! Use the method metricTriangulation if you want a metric triangulation.
point1 | the 2D point coordinates in the first image. |
point2 | the 2D point coordinates in the second image. |
Camera1 | the 3x4 camera matrix of the first image. |
Camera2 | the 3x4 camera matrix of the second image. |
void StereoCamera::undistortImages | ( | ) |
It undistorts the images.
Definition at line 1475 of file stereoCamera.cpp.
void StereoCamera::updateMappings | ( | ) |
XXXXXXXXXXXXXXXXXXXX.
Definition at line 2437 of file stereoCamera.cpp.
References getImLeft().