/// <summary> /// Compute and return the disparity map based on the correspondences found in the "process" method. /// </summary> /// <returns>Mat containing a the disparity image in grayscale.</returns> public Mat GetDisparity() { Mat disparity = new Mat(); StereoInvoke.cveQuasiDenseStereoGetDisparity(_ptr, disparity); return(disparity); }
/// <summary> /// Compute and return the disparity map based on the correspondences found in the "process" method. /// </summary> /// <param name="disparityLvls">The level of detail in output disparity image.</param> /// <returns>Mat containing a the disparity image in grayscale.</returns> public Mat GetDisparity(byte disparityLvls = (byte)50) { Mat disparity = new Mat(); StereoInvoke.cveQuasiDenseStereoGetDisparity(_ptr, disparityLvls, disparity); return(disparity); }
/// <summary> /// Release the unmanaged memory associated with this object /// </summary> protected override void DisposeObject() { if (_sharedPtr != IntPtr.Zero) { StereoInvoke.cveQuasiDenseStereoRelease(ref _sharedPtr); _ptr = IntPtr.Zero; } }
/// <summary> /// Create a new instance containing the methods needed for Quasi Dense Stereo computation. /// </summary> /// <param name="monoImgSize">Image size</param> /// <param name="paramFilepath">The path for the parameters</param> public QuasiDenseStereo(Size monoImgSize, String paramFilepath = "") { using (CvString csParamFilePath = new CvString(paramFilepath)) _ptr = StereoInvoke.cveQuasiDenseStereoCreate( ref monoImgSize, csParamFilePath, ref _sharedPtr); }
/// <summary> /// Main process of the algorithm. This method computes the sparse seeds and then densifies them. /// Initially input images are converted to gray-scale and then the sparseMatching method is called to obtain the sparse stereo. Finally quasiDenseMatching is called to densify the corresponding points. /// </summary> /// <param name="imgLeft">The left Channel of a stereo image pair.</param> /// <param name="imgRight">The right Channel of a stereo image pair.</param> /// <remarks>If input images are in color, the method assumes that are BGR and converts them to grayscale.</remarks> public void Process(Mat imgLeft, Mat imgRight) { StereoInvoke.cveQuasiDenseStereoProcess(_ptr, imgLeft, imgRight); }