Documentation of 'boofcv.examples.stereo.ExampleStereoTwoViewsOneCamera' Java class
ExampleStereoTwoViewsOneCamera
boofcv.examples.stereo

Class ExampleStereoTwoViewsOneCamera



  • public class ExampleStereoTwoViewsOneCamera
    extends java.lang.Object
    Example demonstrating how to use to images taken from a single calibrated camera to create a stereo disparity image, from which a dense 3D point cloud of the scene can be computed. For this technique to work the camera's motion needs to be approximately tangential to the direction the camera is pointing. The code below assumes that the first image is to the left of the second image.
    • Constructor Detail

      • ExampleStereoTwoViewsOneCamera

        public ExampleStereoTwoViewsOneCamera()
    • Method Detail

      • main

        public static void main(java.lang.String[] args)
      • estimateCameraMotion

        public static Se3_F64 estimateCameraMotion(IntrinsicParameters intrinsic,
                                                   java.util.List<AssociatedPair> matchedNorm,
                                                   java.util.List<AssociatedPair> inliers)
        Estimates the camera motion robustly using RANSAC and a set of associated points.
        Parameters:
        intrinsic - Intrinsic camera parameters
        matchedNorm - set of matched point features in normalized image coordinates
        inliers - OUTPUT: Set of inlier features from RANSAC
        Returns:
        Found camera motion. Note translation has an arbitrary scale
      • convertToNormalizedCoordinates

        public static java.util.List<AssociatedPair> convertToNormalizedCoordinates(java.util.List<AssociatedPair> matchedFeatures,
                                                                                    IntrinsicParameters intrinsic)
        Convert a set of associated point features from pixel coordinates into normalized image coordinates.
      • rectifyImages

        public static void rectifyImages(GrayU8 distortedLeft,
                                         GrayU8 distortedRight,
                                         Se3_F64 leftToRight,
                                         IntrinsicParameters intrinsic,
                                         GrayU8 rectifiedLeft,
                                         GrayU8 rectifiedRight,
                                         org.ejml.data.DenseMatrix64F rectifiedK)
        Remove lens distortion and rectify stereo images
        Parameters:
        distortedLeft - Input distorted image from left camera.
        distortedRight - Input distorted image from right camera.
        leftToRight - Camera motion from left to right
        intrinsic - Intrinsic camera parameters
        rectifiedLeft - Output rectified image for left camera.
        rectifiedRight - Output rectified image for right camera.
        rectifiedK - Output camera calibration matrix for rectified camera
      • drawInliers

        public static void drawInliers(java.awt.image.BufferedImage left,
                                       java.awt.image.BufferedImage right,
                                       IntrinsicParameters intrinsic,
                                       java.util.List<AssociatedPair> normalized)
        Draw inliers for debugging purposes. Need to convert from normalized to pixel coordinates.
      • showPointCloud

        public static void showPointCloud(ImageGray disparity,
                                          java.awt.image.BufferedImage left,
                                          Se3_F64 motion,
                                          org.ejml.data.DenseMatrix64F rectifiedK,
                                          int minDisparity,
                                          int maxDisparity)
        Show results as a point cloud

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.