From 40a4eb4909b3628205deb1d99707e6e1d66bb1d0 Mon Sep 17 00:00:00 2001 From: decadenza Date: Sat, 4 Nov 2023 15:48:15 +0000 Subject: [PATCH] Release 1.0.7 --- docs/_modules/index.html | 19 +- docs/_modules/simplestereo/_rigs.html | 127 ++++++--- docs/_modules/simplestereo/active.html | 136 +++++++--- docs/_modules/simplestereo/calibration.html | 132 ++++++++-- docs/_modules/simplestereo/passive.html | 43 +-- docs/_modules/simplestereo/points.html | 39 ++- docs/_modules/simplestereo/rectification.html | 44 ++-- docs/_modules/simplestereo/utils.html | 71 +++-- docs/_static/basic.css | 22 ++ docs/_static/documentation_options.js | 3 +- docs/_static/nature.css | 4 + docs/_static/pygments.css | 1 + docs/_static/searchtools.js | 26 +- docs/_static/sphinx_highlight.js | 154 +++++++++++ docs/genindex.html | 19 +- docs/index.html | 25 +- docs/modules.html | 23 +- docs/py-modindex.html | 19 +- docs/search.html | 19 +- docs/searchindex.js | 2 +- docs/simplestereo.html | 245 +++++++++--------- pyproject.toml | 2 +- simplestereo/calibration.py | 4 +- 23 files changed, 816 insertions(+), 363 deletions(-) create mode 100644 docs/_static/sphinx_highlight.js diff --git a/docs/_modules/index.html b/docs/_modules/index.html index 114810d..5aace5a 100644 --- a/docs/_modules/index.html +++ b/docs/_modules/index.html @@ -1,17 +1,16 @@ - - + Overview: module code — SimpleStereo 1 documentation - - - - - - + + + + + + @@ -79,8 +78,8 @@

Navigation

\ No newline at end of file diff --git a/docs/_modules/simplestereo/_rigs.html b/docs/_modules/simplestereo/_rigs.html index 07f55e9..4a72fd8 100644 --- a/docs/_modules/simplestereo/_rigs.html +++ b/docs/_modules/simplestereo/_rigs.html @@ -1,17 +1,16 @@ - - + simplestereo._rigs — SimpleStereo 1 documentation - - - - - - + + + + + + @@ -58,7 +57,9 @@

Source code for simplestereo._rigs

 from . import utils
 
 
-
[docs]class StereoRig: +
+[docs] +class StereoRig: """ Keep together and manage all parameters of a calibrated stereo rig. @@ -116,7 +117,7 @@

Source code for simplestereo._rigs

     def intrinsic2(self):
         return self._intrinsic2
     
-    @intrinsic1.setter
+    @intrinsic2.setter
     def intrinsic2(self, v):
         self._intrinsic2 = np.asarray(v) # Ensure numpy.ndarray.
 
@@ -168,7 +169,9 @@ 

Source code for simplestereo._rigs

     def E(self, v):
         self._E = np.asarray(v).reshape((3,3)) if v is not None else None
 
-
[docs] @classmethod +
+[docs] + @classmethod def fromFile(cls, filepath): """ Alternative initialization of StereoRig object from JSON file. @@ -199,8 +202,11 @@

Source code for simplestereo._rigs

         reprojectionError = data.get('reprojectionError')
         
         return cls(res1, res2, intrinsic1, intrinsic2, distCoeffs1, distCoeffs2, R, T, F, E, reprojectionError)
+ -
[docs] def save(self, filepath): +
+[docs] + def save(self, filepath): """ Save configuration to JSON file. @@ -228,8 +234,11 @@

Source code for simplestereo._rigs

             if self.reprojectionError:
                 out['reprojectionError'] = self.reprojectionError
             json.dump(out, f, indent=4)
+ -
[docs] def getCenters(self): +
+[docs] + def getCenters(self): """ Calculate camera centers in world coordinates. @@ -246,8 +255,11 @@

Source code for simplestereo._rigs

         C1 = np.zeros(3)    # World origin is set in camera 1.
         C2 = -np.linalg.inv(Po2[:,:3]).dot(Po2[:,3])
         return C1, C2
+ -
[docs] def getBaseline(self): +
+[docs] + def getBaseline(self): """ Calculate the norm of the vector from camera 1 to camera 2. @@ -258,8 +270,11 @@

Source code for simplestereo._rigs

         """
         C1, C2 = self.getCenters()
         return np.linalg.norm(C2) # No need to do C2 - C1 as C1 is always zero (origin of world system)
+ -
[docs] def getProjectionMatrices(self): +
+[docs] + def getProjectionMatrices(self): """ Calculate the projection matrices of camera 1 and camera 2. @@ -273,8 +288,11 @@

Source code for simplestereo._rigs

         Po1 = np.hstack( (self.intrinsic1, np.zeros((3,1))) )
         Po2 = self.intrinsic2.dot( np.hstack( (self.R, self.T) ) )
         return Po1, Po2
+ -
[docs] def getFundamentalMatrix(self): +
+[docs] + def getFundamentalMatrix(self): """ Returns the fundamental matrix F. @@ -299,8 +317,11 @@

Source code for simplestereo._rigs

             self.F = (np.linalg.inv(self.intrinsic2).T).dot(self.R).dot(self.intrinsic1.T).dot(vv)
                 
         return self.F
+ -
[docs] def getEssentialMatrix(self): +
+[docs] + def getEssentialMatrix(self): """ Returns the essential matrix E. @@ -320,8 +341,11 @@

Source code for simplestereo._rigs

             self.E = self.intrinsic2.T.dot(F).dot(self.intrinsic1)
             
         return self.E
+ -
[docs] def undistortImages(self, img1, img2, changeCameras=False, alpha=1, destDims=None, centerPrincipalPoint=False): +
+[docs] + def undistortImages(self, img1, img2, changeCameras=False, alpha=1, destDims=None, centerPrincipalPoint=False): """ Undistort two given images of the stereo rig. @@ -374,10 +398,14 @@

Source code for simplestereo._rigs

             img1_undist = cv2.undistort(img1, self.intrinsic1, self.distCoeffs1, None, None)
             img2_undist = cv2.undistort(img2, self.intrinsic2, self.distCoeffs2, None, None)
             
-            return img1_undist, img2_undist
+ return img1_undist, img2_undist
+
+ -
[docs]class RectifiedStereoRig(StereoRig): +
+[docs] +class RectifiedStereoRig(StereoRig): """ Keep together and manage all parameters of a calibrated and rectified stereo rig. @@ -440,7 +468,9 @@

Source code for simplestereo._rigs

     def rectHomography2(self, v):
         self._rectHomography2 = np.asarray(v).reshape((3,3))
 
-
[docs] @classmethod +
+[docs] + @classmethod def fromFile(cls, filepath): """ Alternative initialization of StereoRigRectified object from JSON file. @@ -474,8 +504,11 @@

Source code for simplestereo._rigs

         reprojectionError = data.get('reprojectionError')
         
         return cls(Rcommon, rectHomography1, rectHomography2, res1, res2, intrinsic1, intrinsic2, distCoeffs1, distCoeffs2, R, T, F, E, reprojectionError)
+ -
[docs] def save(self, filepath): +
+[docs] + def save(self, filepath): """ Save configuration to JSON file. @@ -506,8 +539,11 @@

Source code for simplestereo._rigs

             if self.reprojectionError:
                 out['reprojectionError'] = self.reprojectionError
             json.dump(out, f, indent=4)
+ -
[docs] def getRectifiedProjectionMatrices(self): +
+[docs] + def getRectifiedProjectionMatrices(self): """ Calculate the projection matrices of camera 1 and camera 2 after rectification. @@ -526,8 +562,11 @@

Source code for simplestereo._rigs

         P1 = self.K1.dot(self.Rcommon).dot( np.hstack( (np.eye(3), -C1[:,None]) ) )
         P2 = self.K2.dot(self.Rcommon).dot( np.hstack( (np.eye(3), -C2[:,None]) ) )
         return P1, P2  
+ -
[docs] def computeRectificationMaps(self, destDims=None, alpha=1): +
+[docs] + def computeRectificationMaps(self, destDims=None, alpha=1): """ Compute the two maps to undistort and rectify the stereo pair. @@ -578,8 +617,11 @@

Source code for simplestereo._rigs

         # Recompute final maps considering fitting transformations too
         self.mapx1, self.mapy1 = cv2.initUndistortRectifyMap(self.intrinsic1, self.distCoeffs1, R1, self.K1, destDims, cv2.CV_32FC1)
         self.mapx2, self.mapy2 = cv2.initUndistortRectifyMap(self.intrinsic2, self.distCoeffs2, R2, self.K2, destDims, cv2.CV_32FC1)
+ -
[docs] def rectifyImages(self, img1, img2, interpolation=cv2.INTER_LINEAR): +
+[docs] + def rectifyImages(self, img1, img2, interpolation=cv2.INTER_LINEAR): """ Undistort, rectify and apply affine transformation to a couple of images coming from the stereo rig. @@ -604,8 +646,11 @@

Source code for simplestereo._rigs

         img2_rect = cv2.remap(img2, self.mapx2, self.mapy2, interpolation);
         
         return img1_rect, img2_rect
+ -
[docs] def get3DPoints(self, disparityMap): +
+[docs] + def get3DPoints(self, disparityMap): """ Get the 3D points in the space from the disparity map. @@ -664,10 +709,14 @@

Source code for simplestereo._rigs

         Q[3,3] = ((a1-a2)*cy+(cx2-cx1)*fy)/(fy*b)    
         
         
-        return cv2.reprojectImageTo3D(disparityMap, Q)
+ return cv2.reprojectImageTo3D(disparityMap, Q)
+
-
[docs]class StructuredLightRig(StereoRig): + +
+[docs] +class StructuredLightRig(StereoRig): """ StereoRig child class with structured light methods. """ @@ -687,10 +736,15 @@

Source code for simplestereo._rigs

         R_inv[3,3] = 1
         self.R_inv = R_inv
     
-
[docs] def fromFile(self): +
+[docs] + def fromFile(self): return StructuredLightRig(StereoRig.fromFile(self))
+ -
[docs] def triangulate(self, camPoints, projPoints): +
+[docs] + def triangulate(self, camPoints, projPoints): """ Given camera-projector correspondences, proceed with triangulation. @@ -737,8 +791,11 @@

Source code for simplestereo._rigs

         finalPoints = cv2.perspectiveTransform(finalPoints.reshape(-1,1,3), self.R_inv)
         
         return finalPoints
+ -
[docs] def undistortCameraImage(self, imgObj): +
+[docs] + def undistortCameraImage(self, imgObj): """ Undistort camera image. @@ -751,7 +808,9 @@

Source code for simplestereo._rigs

         -------
         Undistorted image.
         """
-        return cv2.undistort(imgObj, self.intrinsic1, self.distCoeffs1)
+ return cv2.undistort(imgObj, self.intrinsic1, self.distCoeffs1)
+
+
@@ -790,8 +849,8 @@

Navigation

\ No newline at end of file diff --git a/docs/_modules/simplestereo/active.html b/docs/_modules/simplestereo/active.html index d799cf4..282558e 100644 --- a/docs/_modules/simplestereo/active.html +++ b/docs/_modules/simplestereo/active.html @@ -1,17 +1,16 @@ - - + simplestereo.active — SimpleStereo 1 documentation - - - - - - + + + + + + @@ -59,7 +58,9 @@

Source code for simplestereo.active

 import simplestereo as ss
 
 
-
[docs]def generateGrayCodeImgs(targetDir, resolution): +
+[docs] +def generateGrayCodeImgs(targetDir, resolution): """ Generate Gray Codes and save it to PNG images. @@ -103,6 +104,7 @@

Source code for simplestereo.active

     return num_patterns
+ def _getCentralPeak(length, period, shift=0): """ Get maximum intensity pixel position in a fringe with central stripe @@ -123,7 +125,9 @@

Source code for simplestereo.active

     return period*(k - shift/(2*np.pi))
     
 
-
[docs]def buildFringe(period, shift=0, dims=(1280,720), vertical=False, stripeColor=None, dtype=np.uint8): +
+[docs] +def buildFringe(period, shift=0, dims=(1280,720), vertical=False, stripeColor=None, dtype=np.uint8): """ Build sinusoidal fringe image. @@ -187,7 +191,10 @@

Source code for simplestereo.active

     return fullFringe
-
[docs]def buildBinaryFringe(period=10, shift=0, dims=(1280,720), vertical=False, stripeColor=None, dtype=np.uint8): + +
+[docs] +def buildBinaryFringe(period=10, shift=0, dims=(1280,720), vertical=False, stripeColor=None, dtype=np.uint8): """ Build binary fringe image. @@ -250,9 +257,12 @@

Source code for simplestereo.active

         fullFringe = np.rot90(fullFringe, k=3, axes=(0,1))
         
     return fullFringe
+ -
[docs]def buildAnaglyphFringe(period=10, shift=0, dims=(1280,720), vertical=False, dtype=np.uint8): +
+[docs] +def buildAnaglyphFringe(period=10, shift=0, dims=(1280,720), vertical=False, dtype=np.uint8): """ Build sinusoidal anaglyph fringe image. @@ -306,9 +316,12 @@

Source code for simplestereo.active

         fullFringe = np.rot90(fullFringe, k=3, axes=(0,1))
         
     return fullFringe
+ -
[docs]def findCentralStripe(image, color='r', sensitivity=0.5, interpolation='linear'): +
+[docs] +def findCentralStripe(image, color='r', sensitivity=0.5, interpolation='linear'): """ Find coordinates of a colored stripe in the image. @@ -384,10 +397,13 @@

Source code for simplestereo.active

     return np.vstack((x, y)).T
+ ######################################## ###### (c) Pasquale Lafiosca 2020 ###### ######################################## -
[docs]class StereoFTP: +
+[docs] +class StereoFTP: """ Manager of the Stereo Fourier Transform Profilometry. @@ -440,7 +456,9 @@

Source code for simplestereo.active

         self.R_inv = R_inv
         
     
-
[docs] @staticmethod +
+[docs] + @staticmethod def convertGrayscale(img): """ Convert to grayscale using max. @@ -466,6 +484,7 @@

Source code for simplestereo.active

            works best at converting the stripe to white.
         """
         return np.max(img,axis=2)
+ def _getProjectorMapping(self, z, interpolation = cv2.INTER_CUBIC): @@ -644,7 +663,9 @@

Source code for simplestereo.active

         return pw.reshape(-1,3)
         
         
-
[docs] def getCloud(self, imgObj, radius_factor=0.5, roi=None, unwrappingMethod=None, plot=False): +
+[docs] + def getCloud(self, imgObj, radius_factor=0.5, roi=None, unwrappingMethod=None, plot=False): """ Process an image and get the point cloud. @@ -877,10 +898,14 @@

Source code for simplestereo.active

         finalPoints = cv2.perspectiveTransform(finalPoints.reshape(-1,1,3), self.R_inv)
         
         # Reshape as original image    
-        return finalPoints.reshape(roi_h,roi_w,3)
+ return finalPoints.reshape(roi_h,roi_w,3)
+
+ -
[docs]class StereoFTPAnaglyph(StereoFTP): +
+[docs] +class StereoFTPAnaglyph(StereoFTP): """ Manager of the Stereo Fourier Transform Profilometry using an anaglyph pattern build with :func:`buildAnaglyphFringe`. @@ -905,7 +930,9 @@

Source code for simplestereo.active

     .. note:: This is a work in progress.
     """
     
-
[docs] @staticmethod +
+[docs] + @staticmethod def convertGrayscale(img): """ Convert to grayscale using Guo et al., "Improved fourier @@ -929,9 +956,12 @@

Source code for simplestereo.active

         img = img[:,:,0].astype(float) - img[:,:,2].astype(float)
         img = (img - np.min(img))/np.ptp(img)
         return img
+ -
[docs] def getCloud(self, imgObj, radius_factor=0.5, roi=None, unwrappingMethod=None, plot=False): +
+[docs] + def getCloud(self, imgObj, radius_factor=0.5, roi=None, unwrappingMethod=None, plot=False): """ Process an anaglyph image and get the point cloud. @@ -1164,9 +1194,13 @@

Source code for simplestereo.active

         finalPoints = cv2.perspectiveTransform(finalPoints.reshape(-1,1,3), self.R_inv)
         
         # Reshape as original image    
-        return finalPoints.reshape(roi_h,roi_w,3)
+ return finalPoints.reshape(roi_h,roi_w,3)
+
-
[docs]class GrayCode: + +
+[docs] +class GrayCode: """ Wrapper for the Gray code method from OpenCV. @@ -1210,7 +1244,9 @@

Source code for simplestereo.active

         self.R_inv[3,3] = 1
     
         
-
[docs] def getCloud(self, images, roi=None): +
+[docs] + def getCloud(self, images, roi=None): """ Perform the 3D point calculation from a list of images. @@ -1299,10 +1335,14 @@

Source code for simplestereo.active

         # to bring points into camera coordinate system
         finalPoints = cv2.perspectiveTransform(pw.reshape(-1,1,3), self.R_inv)
         
-        return finalPoints
+ return finalPoints
+
+ -
[docs]class StereoFTP_Mapping(StereoFTP): +
+[docs] +class StereoFTP_Mapping(StereoFTP): """ Manager of the classic Stereo Fourier Transform Profilometry. @@ -1327,7 +1367,9 @@

Source code for simplestereo.active

     """
     
     
-
[docs] def getCloud(self, imgObj, radius_factor=0.5, roi=None, unwrappingMethod=None, plot=False): +
+[docs] + def getCloud(self, imgObj, radius_factor=0.5, roi=None, unwrappingMethod=None, plot=False): """ Process an image and get the point cloud. @@ -1486,7 +1528,9 @@

Source code for simplestereo.active

         finalPoints = self._triangulate(camPoints, p_x, roi)
         
         # Reshape as original image    
-        return finalPoints.reshape(roi_h,roi_w,3)
+ return finalPoints.reshape(roi_h,roi_w,3)
+
+ @@ -1499,7 +1543,9 @@

Source code for simplestereo.active

 # Alias for single camera version
 GrayCodeSingle = GrayCode
 
-
[docs]class GrayCodeDouble: +
+[docs] +class GrayCodeDouble: """ Wrapper for the Gray code method from OpenCV. @@ -1544,7 +1590,9 @@

Source code for simplestereo.active

         #self.R_inv = np.hstack( ( np.vstack( (self.R_inv,np.zeros((1,3))) ), np.zeros((4,1)) ) )
         #self.R_inv[3,3] = 1
         
-
[docs] def getCloud(self, images, roi1=None, roi2=None): +
+[docs] + def getCloud(self, images, roi1=None, roi2=None): """ Perform the 3D point calculation from a list of images. @@ -1644,10 +1692,14 @@

Source code for simplestereo.active

         # to bring points into camera coordinate system
         finalPoints = cv2.perspectiveTransform(pw.reshape(-1,1,3), self.R_inv)
         
-        return finalPoints
+ return finalPoints
+
-
[docs]def computeROI(img, blackThreshold=10, extraMargin=0): + +
+[docs] +def computeROI(img, blackThreshold=10, extraMargin=0): """ Exclude black regions along borders. @@ -1736,10 +1788,13 @@

Source code for simplestereo.active

 
 
 
+
 ########################################################################
 ### TEMP FOR EXPERIMENTS
 ### Return phase shift and phase of object only (NO 3D)
-
[docs]class StereoFTP_PhaseOnly: +
+[docs] +class StereoFTP_PhaseOnly: """ Manager of the Stereo Fourier Transform Profilometry. @@ -1785,7 +1840,9 @@

Source code for simplestereo.active

         self.R_inv = R_inv
         
     
-
[docs] @staticmethod +
+[docs] + @staticmethod def convertGrayscale(img): """ Convert to grayscale using max. @@ -1807,6 +1864,7 @@

Source code for simplestereo.active

         .. todo:: Gamma correction may be implemented as a parameter.
         """
         return np.max(img,axis=2)
+ def _getProjectorMapping(self, z, interpolation = cv2.INTER_CUBIC): @@ -1986,7 +2044,9 @@

Source code for simplestereo.active

         
         
     
-
[docs] def getPhase(self, imgObj, radius_factor=0.5, roi=None, plot=False): +
+[docs] + def getPhase(self, imgObj, radius_factor=0.5, roi=None, plot=False): """ Process an image and get the point cloud. @@ -2110,7 +2170,9 @@

Source code for simplestereo.active

         newSignal = ghat * np.conjugate(g0hat)
         phase = np.angle(newSignal)
         
-        return phase.reshape(roi_h,roi_w), np.angle(ghat), np.angle(g0hat)
+ return phase.reshape(roi_h,roi_w), np.angle(ghat), np.angle(g0hat)
+
+
@@ -2148,8 +2210,8 @@

Navigation

\ No newline at end of file diff --git a/docs/_modules/simplestereo/calibration.html b/docs/_modules/simplestereo/calibration.html index 2ee50a5..59ad82b 100644 --- a/docs/_modules/simplestereo/calibration.html +++ b/docs/_modules/simplestereo/calibration.html @@ -1,17 +1,16 @@ - - + simplestereo.calibration — SimpleStereo 1 documentation - - - - - - + + + + + + @@ -61,7 +60,9 @@

Source code for simplestereo.calibration

 DEFAULT_TERMINATION_CRITERIA = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 100, 1e-6)
 
 
-
[docs]def chessboardSingle(images, chessboardSize = DEFAULT_CHESSBOARD_SIZE, squareSize=1, showImages=False): +
+[docs] +def chessboardSingle(images, chessboardSize = DEFAULT_CHESSBOARD_SIZE, squareSize=1, showImages=False, distortionCoeffsNumber=5): """ Calibrate a single camera with a chessboard pattern. @@ -78,6 +79,12 @@

Source code for simplestereo.calibration

     showImages : bool
         If True, each processed image is showed to check for correct chessboard detection.
         Default to False.
+    distortionCoeffsNumber: int, optional
+        Number of distortion coefficients to be used for calibration, either 0, 4, 5, 8, 12 or 14.
+        Coefficients are the same order as specified in :ref:`OpenCV documentation<https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html>`.
+        Please note that this library uses only a small subset of the advanced calibration options found in OpenCV.
+        If set to 0 distortion correction is disabled (coefficients will be 0).
+        Default to 5 (basic radial and tangential distortion correction).
     
     Returns
     -------
@@ -115,11 +122,15 @@ 

Source code for simplestereo.calibration

                 cv2.imshow('Chessboard',img)
                 cv2.waitKey(0)
         
-    return cv2.calibrateCamera(objpoints, imgpoints, gray.shape[::-1], None, None)
- + flags = _getCalibrationFlags(distortionCoeffsNumber) + + return cv2.calibrateCamera(objpoints, imgpoints, gray.shape[::-1], None, None, flags=flags, criteria=DEFAULT_TERMINATION_CRITERIA)
+ - -
[docs]def chessboardStereo(images, chessboardSize = DEFAULT_CHESSBOARD_SIZE, squareSize=1): + +
+[docs] +def chessboardStereo(images, chessboardSize=DEFAULT_CHESSBOARD_SIZE, squareSize=1, distortionCoeffsNumber=5): """ Performs stereo calibration between two cameras and returns a StereoRig object. @@ -134,9 +145,15 @@

Source code for simplestereo.calibration

     chessboardSize: tuple
         Chessboard *internal* dimensions as (width, height). Dimensions should be different to avoid ambiguity.
         Default to (7,6).
-    squareSize : float
+    squareSize : float, optional
         Length of the square side in the chosen world units. For example, if the square size is set in mm, 
         measures in the 3D reconstruction will be in mm. Default to 1.
+    distortionCoeffsNumber: int, optional
+        Number of distortion coefficients to be used for calibration, either 0, 4, 5, 8, 12 or 14.
+        Coefficients are the same order as specified in :ref:`OpenCV documentation<https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html>`.
+        Please note that this library uses only a small subset of the advanced calibration options found in OpenCV.
+        If set to 0 distortion correction is disabled (coefficients will be 0).
+        Default to 5 (basic radial and tangential distortion correction).
         
     Returns
     ----------
@@ -186,11 +203,8 @@ 

Source code for simplestereo.calibration

     cameraMatrix2 = np.eye(3, dtype=np.float64)
     distCoeffs1 = np.empty(5)
     distCoeffs2 = np.empty(5)
-    
-    # Flags for calibration
-    # TO DO flags management to provide different configurations to user
-    flags = 0
-    
+    flags = _getCalibrationFlags(distortionCoeffsNumber)
+
     # Do stereo calibration
     retval, intrinsic1, distCoeffs1, intrinsic2, distCoeffs2, R, T, E, F = cv2.stereoCalibrate( np.array([[objp]] * counter), imagePoints1, imagePoints2, cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, imageSize = img1.shape[::-1], flags=flags, criteria = DEFAULT_TERMINATION_CRITERIA)
     
@@ -200,7 +214,10 @@ 

Source code for simplestereo.calibration

     return stereoRigObj
-
[docs]def chessboardProCam(images, projectorResolution, chessboardSize = DEFAULT_CHESSBOARD_SIZE, squareSize=1, + +
+[docs] +def chessboardProCam(images, projectorResolution, chessboardSize = DEFAULT_CHESSBOARD_SIZE, squareSize=1, black_thr=40, white_thr=5, camIntrinsic=None, camDistCoeffs=None): """ Performs stereo calibration between a camera (reference) and a projector. @@ -233,7 +250,7 @@

Source code for simplestereo.calibration

         required for valid pixels, between the graycode pattern and its inverse images. Default to 5.
     camIntrinsic : numpy.ndarray, optional
         A 3x3 matrix representing camera intrinsic parameters. If not given it will be calculated.
-    camIntrinsic : list, optional
+    camDistCoeffs : list, optional
         Camera distortion coefficients of 4, 5, 8, 12 or 14 elements (refer to OpenCV documentation).
         If not given they will be calculated.
     normalize : bool
@@ -374,6 +391,7 @@ 

Source code for simplestereo.calibration

     return stereoRigObj
+ def _getWhiteCenters(cam_corners_list, cam_int, cam_dist, chessboardSize, squareSize): """ From ordered camera chessboard corners and camera intrinsics, get @@ -434,7 +452,9 @@

Source code for simplestereo.calibration

     return cam_whiteCorners_list, whiteObjps
     
     
-
[docs]def chessboardProCamWhite(images, projectorResolution, chessboardSize = DEFAULT_CHESSBOARD_SIZE, squareSize=1, +
+[docs] +def chessboardProCamWhite(images, projectorResolution, chessboardSize = DEFAULT_CHESSBOARD_SIZE, squareSize=1, black_thr=40, white_thr=5, camIntrinsic=None, camDistCoeffs=None, extended=False): """ Performs stereo calibration between a camera (reference) and a projector. @@ -643,7 +663,10 @@

Source code for simplestereo.calibration

         return stereoRigObj
-
[docs]def phaseShift(periods, projectorResolution, cameraImages, chessboardSize=DEFAULT_CHESSBOARD_SIZE, squareSize=1, + +
+[docs] +def phaseShift(periods, projectorResolution, cameraImages, chessboardSize=DEFAULT_CHESSBOARD_SIZE, squareSize=1, camIntrinsic=None, camDistCoeffs=None): """ Calibrate camera and projector using phase shifting and the @@ -809,9 +832,12 @@

Source code for simplestereo.calibration

     stereoRigObj = ss.StereoRig(cam_shape[::-1], projectorResolution, intrinsic1, intrinsic2, distCoeffs1, distCoeffs2, R, T, F = F, E = E, reprojectionError = retval)
     
     return stereoRigObj
+ -
[docs]def phaseShiftWhite(periods, projectorResolution, cameraImages, chessboardSize=DEFAULT_CHESSBOARD_SIZE, +
+[docs] +def phaseShiftWhite(periods, projectorResolution, cameraImages, chessboardSize=DEFAULT_CHESSBOARD_SIZE, squareSize=1, camIntrinsic=None, camDistCoeffs=None, extended=False): """ Calibrate camera and projector using phase shifting and heterodyne @@ -1006,7 +1032,10 @@

Source code for simplestereo.calibration

         return stereoRigObj
-
[docs]def generateChessboardSVG(chessboardSize, filepath, squareSize=20, border=10): + +
+[docs] +def generateChessboardSVG(chessboardSize, filepath, squareSize=20, border=10): """ Write the desired chessboard to a SVG file. @@ -1036,9 +1065,12 @@

Source code for simplestereo.calibration

         f.write('<path fill="#000" d="{}"/></svg>'.format(d))
     
     return
+ -
[docs]def getFundamentalMatrixFromProjections(P1,P2): +
+[docs] +def getFundamentalMatrixFromProjections(P1,P2): """ Compute the fundamental matrix from two projection matrices. @@ -1072,6 +1104,50 @@

Source code for simplestereo.calibration

             F[i, j] = np.linalg.det(np.vstack((X[j], Y[i])))
     
     return F
+ + + +def _getCalibrationFlags(n): + """ + Get flags for calibration from the selected number of parameters. + + Selecting distortion coefficients in OpenCV: + The distortion parameters are the radial coefficients k1, k2, k3, k4, k5, and k6 , + p1 and p2 are the tangential distortion coefficients, and s1, s2, s3, and s4, are + the thin prism distortion coefficients. τx,τy are two rotations to correct for sensor orientation. + Higher-order coefficients are not considered in OpenCV. + The coefficients are passed or returned as + (k1,k2,p1,p2[,k3[,k4,k5,k6[,s1,s2,s3,s4,[τx,τy]]]]) + See https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html + if distortionCoeffsNumber == 0: + Fix standard 5 coefficients to 0 so that optimisation is not affected. + """ + if n == 0: + return ( + cv2.CALIB_ZERO_TANGENT_DIST + + cv2.CALIB_FIX_K1 + + cv2.CALIB_FIX_K2 + + cv2.CALIB_FIX_K3 + ) + elif n == 8: + return cv2.CALIB_RATIONAL_MODEL + else: + # For n== 5 or any other case. + return 0 + """ + # TODO + elif distortionCoeffsNumber == 12: + flags = ( + cv2.CALIB_RATIONAL_MODEL + + cv2.CALIB_THIN_PRISM_MODEL + ) + elif distortionCoeffsNumber == 14: + flags = ( + cv2.CALIB_RATIONAL_MODEL + + cv2.CALIB_THIN_PRISM_MODEL + + cv2.CALIB_TILTED_MODEL + ) + """
@@ -1109,8 +1185,8 @@

Navigation

\ No newline at end of file diff --git a/docs/_modules/simplestereo/passive.html b/docs/_modules/simplestereo/passive.html index 2c64595..42f01c7 100644 --- a/docs/_modules/simplestereo/passive.html +++ b/docs/_modules/simplestereo/passive.html @@ -1,17 +1,16 @@ - - + simplestereo.passive — SimpleStereo 1 documentation - - - - - - + + + + + + @@ -52,7 +51,9 @@

Source code for simplestereo.passive

 from simplestereo import _passive
 
 
-
[docs]class StereoASW(): +
+[docs] +class StereoASW(): """ Custom implementation of "Adaptive Support-Weight Approach for Correspondence Search", K. Yoon, I. Kweon, 2006. @@ -108,7 +109,9 @@

Source code for simplestereo.passive

         self.consistent = consistent
         
     
-
[docs] def compute(self, img1, img2): +
+[docs] + def compute(self, img1, img2): """ Compute disparity map for BGR images. @@ -128,14 +131,18 @@

Source code for simplestereo.passive

                                              self.maxDisparity, self.minDisparity,
                                              self.gammaC, self.gammaP, self.consistent)
                                              
-        return disparityMap
+ return disparityMap
+
+ -
[docs]class StereoGSW(): +
+[docs] +class StereoGSW(): """ *Incomplete* implementation of "Local stereo matching using geodesic support weights", Asmaa Hosni, Michael Bleyer, Margrit Gelautz and Christoph Rhemann (2009). @@ -183,7 +190,9 @@

Source code for simplestereo.passive

         self.iterations = iterations
         self.bins = bins
         
-
[docs] def compute(self, img1, img2): +
+[docs] + def compute(self, img1, img2): """ Compute disparity map for 3-color channel images. """ @@ -194,7 +203,9 @@

Source code for simplestereo.passive

                                              self.gamma,self.fMax, self.iterations,
                                              self.bins)
         
-        return disparityMap
+ return disparityMap
+
+
@@ -233,8 +244,8 @@

Navigation

\ No newline at end of file diff --git a/docs/_modules/simplestereo/points.html b/docs/_modules/simplestereo/points.html index 6e4e0d9..efdc505 100644 --- a/docs/_modules/simplestereo/points.html +++ b/docs/_modules/simplestereo/points.html @@ -1,17 +1,16 @@ - - + simplestereo.points — SimpleStereo 1 documentation - - - - - - + + + + + + @@ -46,7 +45,9 @@

Source code for simplestereo.points

 import cv2
 
 
-
[docs]def exportPLY(points3D, filepath, referenceImage=None, precision=6): +
+[docs] +def exportPLY(points3D, filepath, referenceImage=None, precision=6): """ Export raw point cloud to PLY file (ASCII). @@ -118,7 +119,10 @@

Source code for simplestereo.points

                             points3D[i,0], points3D[i,1], points3D[i,2], 
                             referenceImage[i], p=precision)) # Grayscale
-
[docs]def importPLY(filename, *properties): + +
+[docs] +def importPLY(filename, *properties): """ Import 3D coordinates from PLY file. @@ -160,7 +164,10 @@

Source code for simplestereo.points

 
 
 
-
[docs]def getAdimensional3DPoints(disparityMap): + +
+[docs] +def getAdimensional3DPoints(disparityMap): """ Get adimensional 3D points from the disparity map. @@ -215,7 +222,10 @@

Source code for simplestereo.points

     return cv2.reprojectImageTo3D(disparityMap, Q)
-
[docs]def distortPoints(points, distCoeff): + +
+[docs] +def distortPoints(points, distCoeff): ''' Undistort relative coordinate points. @@ -257,6 +267,7 @@

Source code for simplestereo.points

         distPoints.append([(xd,yd)])
     
     return np.array(distPoints)
+
@@ -294,8 +305,8 @@

Navigation

\ No newline at end of file diff --git a/docs/_modules/simplestereo/rectification.html b/docs/_modules/simplestereo/rectification.html index e037e97..57a7dc4 100644 --- a/docs/_modules/simplestereo/rectification.html +++ b/docs/_modules/simplestereo/rectification.html @@ -1,17 +1,16 @@ - - + simplestereo.rectification — SimpleStereo 1 documentation - - - - - - + + + + + + @@ -53,7 +52,9 @@

Source code for simplestereo.rectification

 import simplestereo as ss
 
 
-
[docs]def getFittingMatrix(intrinsicMatrix1, intrinsicMatrix2, H1, H2, dims1, dims2, +
+[docs] +def getFittingMatrix(intrinsicMatrix1, intrinsicMatrix2, H1, H2, dims1, dims2, distCoeffs1=None, distCoeffs2=None, destDims=None, alpha=1): """ Compute affine tranformation to fit the rectified images into desidered dimensions. @@ -159,6 +160,7 @@

Source code for simplestereo.rectification

     K[1,2] = -s * top
     
     return K.dot(Fit)
+ def _getCorners(H, intrinsicMatrix, dims, distCoeffs=None): @@ -224,7 +226,9 @@

Source code for simplestereo.rectification

         
 
 
-
[docs]def stereoRectify(rig): +
+[docs] +def stereoRectify(rig): """ Rectify the StereoRig object using the standard OpenCV algorithm. @@ -260,7 +264,10 @@

Source code for simplestereo.rectification

 
 
 
-
[docs]def fusielloRectify(rig): + +
+[docs] +def fusielloRectify(rig): """ Computes the two rectifying homographies and returns a RectifiedStereoRig. @@ -307,6 +314,7 @@

Source code for simplestereo.rectification

 
 
 
+
 def _lowLevelRectify(rig):
     """
     Get basic rectification using Fusiello et al.
@@ -341,7 +349,9 @@ 

Source code for simplestereo.rectification

     return R1, R2, R
 
 
-
[docs]def loopRectify(rig): +
+[docs] +def loopRectify(rig): """ Computes the two rectifying homographies and returns a RectifiedStereoRig. @@ -526,7 +536,10 @@

Source code for simplestereo.rectification

 
 
 
-
[docs]def getBestXShearingTransformation(rectHomography, dims): + +
+[docs] +def getBestXShearingTransformation(rectHomography, dims): """ Get best shear transformation (affine) over x axis that minimizes distortion. @@ -575,6 +588,7 @@

Source code for simplestereo.rectification

 
 
 
+
 def directRectify(rig):
     """
     Compute the analytical rectification homographies.
@@ -805,8 +819,8 @@ 

Navigation

\ No newline at end of file diff --git a/docs/_modules/simplestereo/utils.html b/docs/_modules/simplestereo/utils.html index 8859f99..2d120bf 100644 --- a/docs/_modules/simplestereo/utils.html +++ b/docs/_modules/simplestereo/utils.html @@ -1,17 +1,16 @@ - - + simplestereo.utils — SimpleStereo 1 documentation - - - - - - + + + + + + @@ -49,7 +48,9 @@

Source code for simplestereo.utils

 import cv2
 
 
-
[docs]class Capture: +
+[docs] +class Capture: """Capture a video stream continuously. Allows to capture a video stream in a separate thread and grab the current frame when needed, @@ -111,7 +112,9 @@

Source code for simplestereo.utils

         # To allow use in with statement
         self.__del__()
     
-
[docs] def start(self): +
+[docs] + def start(self): """ Start the capture in a separate thread. @@ -123,8 +126,11 @@

Source code for simplestereo.utils

             return
         self.running = True
         self.t.start()
+ -
[docs] def stop(self): +
+[docs] + def stop(self): """ Stop the capture. @@ -138,12 +144,15 @@

Source code for simplestereo.utils

             self.running = False
             self.t.join()
         return
+ def __loop(self): while(self.running): self.grab() -
[docs] def get(self): +
+[docs] + def get(self): """ Retrieve the current frame. @@ -153,8 +162,11 @@

Source code for simplestereo.utils

         if not ret:
             return None
         return self.flip(self.frame, 1)
+ -
[docs] def setResolution(self, width, height): +
+[docs] + def setResolution(self, width, height): """ Set resolution of the camera. @@ -192,11 +204,17 @@

Source code for simplestereo.utils

 
         return retval
-
[docs] def getResolution(self): + +
+[docs] + def getResolution(self): """ Return current resolution as (width, height) tuple. """ return self.video_capture.get(cv2.CAP_PROP_FRAME_WIDTH), self.video_capture.get(cv2.CAP_PROP_FRAME_HEIGHT)
-
[docs] def setFrameRate(self, fps): + +
+[docs] + def setFrameRate(self, fps): """ Set framerate of the camera. @@ -217,10 +235,14 @@

Source code for simplestereo.utils

         if self.running or self.isFile:
             return False
         
-        return self.video_capture.set(cv2.CAP_PROP_FPS, fps)
+ return self.video_capture.set(cv2.CAP_PROP_FPS, fps)
+
+ -
[docs]def moveExtrinsicOriginToFirstCamera(R1,R2,t1,t2): +
+[docs] +def moveExtrinsicOriginToFirstCamera(R1,R2,t1,t2): """ Center extrinsic parameters world coordinate system into camera 1. @@ -247,9 +269,12 @@

Source code for simplestereo.utils

     R = R2.dot(R1.T)
     t = t2 - R2.dot(R1.T).dot(t1)
     return R, t
+ -
[docs]def getCrossProductMatrix(v): +
+[docs] +def getCrossProductMatrix(v): """ Build the 3x3 antisymmetric matrix representing the cross product with v. @@ -271,7 +296,10 @@

Source code for simplestereo.utils

                        [-v[1], v[0], 0] ] , dtype=np.float)
-
[docs]def drawCorrespondingEpipolarLines(img1, img2, F, x1=[], x2=[], color=(0,0,255), thickness=1): + +
+[docs] +def drawCorrespondingEpipolarLines(img1, img2, F, x1=[], x2=[], color=(0,0,255), thickness=1): """ Draw epipolar lines passing by given coordinates in img1 or img1. @@ -339,6 +367,7 @@

Source code for simplestereo.utils

         k = drawLineOnImg1(line)
         line = F.dot(np.array([ [k[0]], [k[1]], [1]])) # Find epipolar line on img2 (homogeneous coordinates)
         p = drawLineOnImg2(line)
+ @@ -380,8 +409,8 @@

Navigation

\ No newline at end of file diff --git a/docs/_static/basic.css b/docs/_static/basic.css index 7577acb..30fee9d 100644 --- a/docs/_static/basic.css +++ b/docs/_static/basic.css @@ -237,6 +237,10 @@ a.headerlink { visibility: hidden; } +a:visited { + color: #551A8B; +} + h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, @@ -670,6 +674,16 @@ dd { margin-left: 30px; } +.sig dd { + margin-top: 0px; + margin-bottom: 0px; +} + +.sig dl { + margin-top: 0px; + margin-bottom: 0px; +} + dl > dd:last-child, dl > dd:last-child > :last-child { margin-bottom: 0; @@ -738,6 +752,14 @@ abbr, acronym { cursor: help; } +.translated { + background-color: rgba(207, 255, 207, 0.2) +} + +.untranslated { + background-color: rgba(255, 207, 207, 0.2) +} + /* -- code displays --------------------------------------------------------- */ pre { diff --git a/docs/_static/documentation_options.js b/docs/_static/documentation_options.js index 2db8a09..36bccb3 100644 --- a/docs/_static/documentation_options.js +++ b/docs/_static/documentation_options.js @@ -1,5 +1,4 @@ -var DOCUMENTATION_OPTIONS = { - URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), +const DOCUMENTATION_OPTIONS = { VERSION: '1', LANGUAGE: 'en', COLLAPSE_INDEX: false, diff --git a/docs/_static/nature.css b/docs/_static/nature.css index 0307a02..84c584a 100644 --- a/docs/_static/nature.css +++ b/docs/_static/nature.css @@ -142,6 +142,10 @@ a:hover { text-decoration: underline; } +a:visited { + color: #551A8B; +} + div.body h1, div.body h2, div.body h3, diff --git a/docs/_static/pygments.css b/docs/_static/pygments.css index f227e5c..6110e9f 100644 --- a/docs/_static/pygments.css +++ b/docs/_static/pygments.css @@ -22,6 +22,7 @@ span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: .highlight .cs { color: #8f5902; font-style: italic } /* Comment.Special */ .highlight .gd { color: #a40000 } /* Generic.Deleted */ .highlight .ge { color: #000000; font-style: italic } /* Generic.Emph */ +.highlight .ges { color: #000000; font-weight: bold; font-style: italic } /* Generic.EmphStrong */ .highlight .gr { color: #ef2929 } /* Generic.Error */ .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ .highlight .gi { color: #00A000 } /* Generic.Inserted */ diff --git a/docs/_static/searchtools.js b/docs/_static/searchtools.js index 97d56a7..7918c3f 100644 --- a/docs/_static/searchtools.js +++ b/docs/_static/searchtools.js @@ -57,12 +57,12 @@ const _removeChildren = (element) => { const _escapeRegExp = (string) => string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string -const _displayItem = (item, searchTerms) => { +const _displayItem = (item, searchTerms, highlightTerms) => { const docBuilder = DOCUMENTATION_OPTIONS.BUILDER; - const docUrlRoot = DOCUMENTATION_OPTIONS.URL_ROOT; const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX; const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX; const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY; + const contentRoot = document.documentElement.dataset.content_root; const [docName, title, anchor, descr, score, _filename] = item; @@ -75,20 +75,24 @@ const _displayItem = (item, searchTerms) => { if (dirname.match(/\/index\/$/)) dirname = dirname.substring(0, dirname.length - 6); else if (dirname === "index/") dirname = ""; - requestUrl = docUrlRoot + dirname; + requestUrl = contentRoot + dirname; linkUrl = requestUrl; } else { // normal html builders - requestUrl = docUrlRoot + docName + docFileSuffix; + requestUrl = contentRoot + docName + docFileSuffix; linkUrl = docName + docLinkSuffix; } let linkEl = listItem.appendChild(document.createElement("a")); linkEl.href = linkUrl + anchor; linkEl.dataset.score = score; linkEl.innerHTML = title; - if (descr) + if (descr) { listItem.appendChild(document.createElement("span")).innerHTML = " (" + descr + ")"; + // highlight search terms in the description + if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js + highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted")); + } else if (showSearchSummary) fetch(requestUrl) .then((responseData) => responseData.text()) @@ -97,6 +101,9 @@ const _displayItem = (item, searchTerms) => { listItem.appendChild( Search.makeSearchSummary(data, searchTerms) ); + // highlight search terms in the summary + if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js + highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted")); }); Search.output.appendChild(listItem); }; @@ -115,14 +122,15 @@ const _finishSearch = (resultCount) => { const _displayNextItem = ( results, resultCount, - searchTerms + searchTerms, + highlightTerms, ) => { // results left, load the summary and display it // this is intended to be dynamic (don't sub resultsCount) if (results.length) { - _displayItem(results.pop(), searchTerms); + _displayItem(results.pop(), searchTerms, highlightTerms); setTimeout( - () => _displayNextItem(results, resultCount, searchTerms), + () => _displayNextItem(results, resultCount, searchTerms, highlightTerms), 5 ); } @@ -360,7 +368,7 @@ const Search = { // console.info("search results:", Search.lastresults); // print the results - _displayNextItem(results, results.length, searchTerms); + _displayNextItem(results, results.length, searchTerms, highlightTerms); }, /** diff --git a/docs/_static/sphinx_highlight.js b/docs/_static/sphinx_highlight.js new file mode 100644 index 0000000..8a96c69 --- /dev/null +++ b/docs/_static/sphinx_highlight.js @@ -0,0 +1,154 @@ +/* Highlighting utilities for Sphinx HTML documentation. */ +"use strict"; + +const SPHINX_HIGHLIGHT_ENABLED = true + +/** + * highlight a given string on a node by wrapping it in + * span elements with the given class name. + */ +const _highlight = (node, addItems, text, className) => { + if (node.nodeType === Node.TEXT_NODE) { + const val = node.nodeValue; + const parent = node.parentNode; + const pos = val.toLowerCase().indexOf(text); + if ( + pos >= 0 && + !parent.classList.contains(className) && + !parent.classList.contains("nohighlight") + ) { + let span; + + const closestNode = parent.closest("body, svg, foreignObject"); + const isInSVG = closestNode && closestNode.matches("svg"); + if (isInSVG) { + span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); + } else { + span = document.createElement("span"); + span.classList.add(className); + } + + span.appendChild(document.createTextNode(val.substr(pos, text.length))); + const rest = document.createTextNode(val.substr(pos + text.length)); + parent.insertBefore( + span, + parent.insertBefore( + rest, + node.nextSibling + ) + ); + node.nodeValue = val.substr(0, pos); + /* There may be more occurrences of search term in this node. So call this + * function recursively on the remaining fragment. + */ + _highlight(rest, addItems, text, className); + + if (isInSVG) { + const rect = document.createElementNS( + "http://www.w3.org/2000/svg", + "rect" + ); + const bbox = parent.getBBox(); + rect.x.baseVal.value = bbox.x; + rect.y.baseVal.value = bbox.y; + rect.width.baseVal.value = bbox.width; + rect.height.baseVal.value = bbox.height; + rect.setAttribute("class", className); + addItems.push({ parent: parent, target: rect }); + } + } + } else if (node.matches && !node.matches("button, select, textarea")) { + node.childNodes.forEach((el) => _highlight(el, addItems, text, className)); + } +}; +const _highlightText = (thisNode, text, className) => { + let addItems = []; + _highlight(thisNode, addItems, text, className); + addItems.forEach((obj) => + obj.parent.insertAdjacentElement("beforebegin", obj.target) + ); +}; + +/** + * Small JavaScript module for the documentation. + */ +const SphinxHighlight = { + + /** + * highlight the search words provided in localstorage in the text + */ + highlightSearchWords: () => { + if (!SPHINX_HIGHLIGHT_ENABLED) return; // bail if no highlight + + // get and clear terms from localstorage + const url = new URL(window.location); + const highlight = + localStorage.getItem("sphinx_highlight_terms") + || url.searchParams.get("highlight") + || ""; + localStorage.removeItem("sphinx_highlight_terms") + url.searchParams.delete("highlight"); + window.history.replaceState({}, "", url); + + // get individual terms from highlight string + const terms = highlight.toLowerCase().split(/\s+/).filter(x => x); + if (terms.length === 0) return; // nothing to do + + // There should never be more than one element matching "div.body" + const divBody = document.querySelectorAll("div.body"); + const body = divBody.length ? divBody[0] : document.querySelector("body"); + window.setTimeout(() => { + terms.forEach((term) => _highlightText(body, term, "highlighted")); + }, 10); + + const searchBox = document.getElementById("searchbox"); + if (searchBox === null) return; + searchBox.appendChild( + document + .createRange() + .createContextualFragment( + '" + ) + ); + }, + + /** + * helper function to hide the search marks again + */ + hideSearchWords: () => { + document + .querySelectorAll("#searchbox .highlight-link") + .forEach((el) => el.remove()); + document + .querySelectorAll("span.highlighted") + .forEach((el) => el.classList.remove("highlighted")); + localStorage.removeItem("sphinx_highlight_terms") + }, + + initEscapeListener: () => { + // only install a listener if it is really needed + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + // bail with special keys + if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return; + if (DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS && (event.key === "Escape")) { + SphinxHighlight.hideSearchWords(); + event.preventDefault(); + } + }); + }, +}; + +_ready(() => { + /* Do not call highlightSearchWords() when we are on the search page. + * It will highlight words from the *previous* search query. + */ + if (typeof Search === "undefined") SphinxHighlight.highlightSearchWords(); + SphinxHighlight.initEscapeListener(); +}); diff --git a/docs/genindex.html b/docs/genindex.html index e5737b7..d538789 100644 --- a/docs/genindex.html +++ b/docs/genindex.html @@ -1,17 +1,16 @@ - - + Index — SimpleStereo 1 documentation - - - - - - + + + + + + @@ -465,8 +464,8 @@

Navigation

\ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 9713d2d..9cbb1de 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,18 +1,17 @@ - - + - + Welcome to SimpleStereo’s documentation! — SimpleStereo 1 documentation - - - - - - + + + + + + @@ -41,7 +40,7 @@

Navigation

-

Welcome to SimpleStereo’s documentation!

+

Welcome to SimpleStereo’s documentation!

Contents:

\ No newline at end of file diff --git a/docs/modules.html b/docs/modules.html index 3ad3157..9b80640 100644 --- a/docs/modules.html +++ b/docs/modules.html @@ -1,18 +1,17 @@ - - + - + package — SimpleStereo 1 documentation - - - - - - + + + + + + @@ -37,7 +36,7 @@

Navigation

-

package

+

package

\ No newline at end of file diff --git a/docs/py-modindex.html b/docs/py-modindex.html index 37e8d2b..6497c59 100644 --- a/docs/py-modindex.html +++ b/docs/py-modindex.html @@ -1,17 +1,16 @@ - - + Python Module Index — SimpleStereo 1 documentation - - - - - - + + + + + + @@ -132,8 +131,8 @@

Navigation

\ No newline at end of file diff --git a/docs/search.html b/docs/search.html index 307d6ba..1145786 100644 --- a/docs/search.html +++ b/docs/search.html @@ -1,18 +1,17 @@ - - + Search — SimpleStereo 1 documentation - - - + + + - - - + + + @@ -96,8 +95,8 @@

Navigation

\ No newline at end of file diff --git a/docs/searchindex.js b/docs/searchindex.js index 482cbb7..344df91 100644 --- a/docs/searchindex.js +++ b/docs/searchindex.js @@ -1 +1 @@ -Search.setIndex({"docnames": ["index", "modules", "simplestereo"], "filenames": ["index.rst", "modules.rst", "simplestereo.rst"], "titles": ["Welcome to SimpleStereo\u2019s documentation!", "package", "simplestereo package"], "terms": {"packag": 0, "modul": [0, 1], "submodul": [0, 1], "_rig": [0, 1], "activ": [0, 1], "calibr": [0, 1], "passiv": [0, 1], "point": [0, 1], "rectif": [0, 1], "unwrap": [0, 1], "util": [0, 1], "index": [0, 2], "search": [0, 2], "page": 0, "simplestereo": 1, "content": 1, "rectifiedstereorig": [1, 2], "rcommon": [1, 2], "computerectificationmap": [1, 2], "fromfil": [1, 2], "get3dpoint": [1, 2], "getrectifiedprojectionmatric": [1, 2], "recthomography1": [1, 2], "recthomography2": [1, 2], "rectifyimag": [1, 2], "save": [1, 2], "stereorig": [1, 2], "e": [1, 2], "f": [1, 2], "r": [1, 2], "t": [1, 2], "distcoeffs1": [1, 2], "distcoeffs2": [1, 2], "getbaselin": [1, 2], "getcent": [1, 2], "getessentialmatrix": [1, 2], "getfundamentalmatrix": [1, 2], "getprojectionmatric": [1, 2], "intrinsic1": [1, 2], "intrinsic2": [1, 2], "undistortimag": [1, 2], "structuredlightrig": [1, 2], "triangul": [1, 2], "undistortcameraimag": [1, 2], "graycod": [1, 2], "getcloud": [1, 2], "graycodedoubl": [1, 2], "graycodesingl": [1, 2], "stereoftp": [1, 2], "convertgrayscal": [1, 2], "stereoftpanaglyph": [1, 2], "stereoftp_map": [1, 2], "stereoftp_phaseonli": [1, 2], "getphas": [1, 2], "buildanaglyphfring": [1, 2], "buildbinaryfring": [1, 2], "buildfring": [1, 2], "computeroi": [1, 2], "findcentralstrip": [1, 2], "generategraycodeimg": [1, 2], "chessboardprocam": [1, 2], "chessboardprocamwhit": [1, 2], "chessboardsingl": [1, 2], "chessboardstereo": [1, 2], "generatechessboardsvg": [1, 2], "getfundamentalmatrixfromproject": [1, 2], "phaseshift": [1, 2], "phaseshiftwhit": [1, 2], "stereoasw": [1, 2], "comput": [1, 2], "stereogsw": [1, 2], "distortpoint": [1, 2], "exportpli": [1, 2], "getadimensional3dpoint": [1, 2], "importpli": [1, 2], "fusiellorectifi": [1, 2], "getbestxshearingtransform": [1, 2], "getfittingmatrix": [1, 2], "looprectifi": [1, 2], "stereorectifi": [1, 2], "phaseunwrap": 1, "captur": [1, 2], "get": [1, 2], "getresolut": [1, 2], "setframer": [1, 2], "setresolut": [1, 2], "start": [1, 2], "stop": [1, 2], "drawcorrespondingepipolarlin": [1, 2], "getcrossproductmatrix": [1, 2], "moveextrinsicorigintofirstcamera": [1, 2], "initi": 2, "document": 2, "docstr": 2, "follow": 2, "numpi": 2, "style": 2, "wherev": 2, "possibl": 2, "see": 2, "http": 2, "numpydoc": 2, "readthedoc": 2, "io": 2, "en": 2, "latest": 2, "format": 2, "html": 2, "main": 2, "class": 2, "load": 2, "level": 2, "py": 2, "__init__": 2, "add": 2, "new": 2, "rig": 2, "uncalibr": 2, "stereo": 2, "arg": 2, "sourc": 2, "base": 2, "keep": 2, "togeth": 2, "manag": 2, "all": 2, "paramet": 2, "rectifi": 2, "It": 2, "includ": 2, "plu": 2, "two": 2, "homographi": 2, "differ": 2, "from": 2, "opencv": 2, "here": 2, "pixel": 2, "domain": 2, "ar": 2, "taken": 2, "input": 2, "ones": 2, "commonli": 2, "refer": 2, "literatur": 2, "transform": 2, "object": 2, "space": 2, "ndarrai": 2, "3x3": 2, "matric": 2, "repres": 2, "common": 2, "camera": 2, "orient": 2, "after": 2, "sequenc": 2, "A": 2, "altern": 2, "same": 2, "order": 2, "attribut": 2, "method": 2, "properti": 2, "destdim": 2, "none": 2, "alpha": 2, "1": 2, "map": 2, "undistort": 2, "pair": 2, "thi": 2, "wrap": 2, "cv2": 2, "initundistortrectifymap": 2, "custom": 2, "fit": 2, "algorithm": 2, "imag": 2, "within": 2, "dimens": 2, "modifi": 2, "origin": 2, "matrix": 2, "appli": 2, "affin": 2, "x": 2, "y": 2, "scale": 2, "translat": 2, "shear": 2, "axi": 2, "onli": 2, "without": 2, "lose": 2, "The": 2, "store": 2, "intern": 2, "i": 2, "call": 2, "constructor": 2, "default": 2, "can": 2, "later": 2, "chang": 2, "its": 2, "set": 2, "tupl": 2, "option": 2, "resolut": 2, "destin": 2, "width": 2, "height": 2, "first": 2, "float": 2, "between": 2, "0": 2, "both": 2, "If": 2, "corner": 2, "preserv": 2, "valid": 2, "rectangl": 2, "made": 2, "visibl": 2, "intermedi": 2, "valu": 2, "produc": 2, "result": 2, "middl": 2, "extrem": 2, "skew": 2, "posit": 2, "do": 2, "work": 2, "well": 2, "return": 2, "type": 2, "note": 2, "us": 2, "most": 2, "paper": 2, "provid": 2, "rotat": 2, "3d": 2, "librari": 2, "alwai": 2, "To": 2, "adapt": 2, "other": 2, "function": 2, "given": 2, "recthomographi": 2, "dot": 2, "cameramatrix": 2, "For": 2, "each": 2, "h": 2, "classmethod": 2, "filepath": 2, "stereorigrectifi": 2, "json": 2, "file": 2, "str": 2, "path": 2, "contain": 2, "an": 2, "disparitymap": 2, "dispar": 2, "wa": 2, "done": 2, "real": 2, "world": 2, "unit": 2, "g": 2, "millimet": 2, "output": 2, "would": 2, "left": 2, "dens": 2, "have": 2, "arrai": 2, "shape": 2, "3": 2, "where": 2, "coordin": 2, "z": 2, "associ": 2, "calcul": 2, "project": 2, "2": 2, "share": 2, "one": 2, "horizont": 2, "displac": 2, "baselin": 2, "intrins": 2, "depend": 2, "rigid": 2, "manipul": 2, "3x4": 2, "second": 2, "img1": 2, "img2": 2, "interpol": 2, "magicmock": 2, "id": 2, "140581085517952": 2, "coupl": 2, "come": 2, "must": 2, "right": 2, "remap": 2, "dure": 2, "befor": 2, "final": 2, "mat": 2, "int": 2, "interpolationflag": 2, "inter_nearest": 2, "inter_linear": 2, "inter_cub": 2, "img1_rect": 2, "img2_rect": 2, "configur": 2, "current": 2, "res1": 2, "res2": 2, "reprojectionerror": 2, "essenti": 2, "fundament": 2, "thei": 2, "avail": 2, "mai": 2, "need": 2, "list": 2, "form": 2, "fx": 2, "tx": 2, "fy": 2, "ty": 2, "distort": 2, "coeffici": 2, "4": 2, "5": 2, "8": 2, "12": 2, "14": 2, "element": 2, "1st": 2, "2nd": 2, "system": 2, "vector": 2, "total": 2, "reproject": 2, "error": 2, "convent": 2, "henc": 2, "extrins": 2, "ident": 2, "zero": 2, "your": 2, "place": 2, "you": 2, "convert": 2, "norm": 2, "length": 2, "center": 2, "anywai": 2, "ha": 2, "free": 2, "factor": 2, "changecamera": 2, "fals": 2, "centerprincipalpoint": 2, "getoptimalnewcameramatrix": 2, "otherwis": 2, "consid": 2, "when": 2, "bool": 2, "skip": 2, "true": 2, "minimum": 2, "unwant": 2, "so": 2, "even": 2, "remov": 2, "some": 2, "retain": 2, "extra": 2, "black": 2, "accept": 2, "too": 2, "princip": 2, "img1_undist": 2, "img2_undist": 2, "cameramatrixnew1": 2, "cameramatrixnew2": 2, "child": 2, "structur": 2, "light": 2, "campoint": 2, "projpoint": 2, "projector": 2, "correspond": 2, "proce": 2, "last": 2, "alreadi": 2, "imgobj": 2, "helper": 2, "black_thr": 2, "40": 2, "white_thr": 2, "wrapper": 2, "grai": 2, "code": 2, "implement": 2, "threshold": 2, "number": 2, "255": 2, "bright": 2, "requir": 2, "fulli": 2, "illumin": 2, "white": 2, "computeshadowmask": 2, "pattern": 2, "invers": 2, "getprojpixel": 2, "unaccur": 2, "especi": 2, "along": 2, "border": 2, "case": 2, "ignor": 2, "pass": 2, "narrow": 2, "roi": 2, "perform": 2, "acquir": 2, "like": 2, "structured_light_graycodepattern": 2, "ani": 2, "full": 2, "region": 2, "interest": 2, "upper": 2, "n": 2, "cloud": 2, "nan": 2, "invalid": 2, "locat": 2, "projr": 2, "roi1": 2, "roi2": 2, "dimension": 2, "onel": 2, "png": 2, "oner": 2, "twol": 2, "twor": 2, "As": 2, "alia": 2, "fring": 2, "period": 2, "shift": 2, "stripecolor": 2, "red": 2, "stripesensit": 2, "fourier": 2, "profilometri": 2, "fringedim": 2, "bgr": 2, "color": 2, "central": 2, "stripe": 2, "chosen": 2, "among": 2, "blue": 2, "green": 2, "also": 2, "b": 2, "sensit": 2, "find": 2, "detail": 2, "pasqual": 2, "lafiosca": 2, "et": 2, "al": 2, "autom": 2, "aircraft": 2, "dent": 2, "inspect": 2, "via": 2, "sensor": 2, "2022": 2, "doi": 2, "org": 2, "10": 2, "3390": 2, "s22020433": 2, "static": 2, "img": 2, "grayscal": 2, "max": 2, "highest": 2, "over": 2, "allow": 2, "fft": 2, "properli": 2, "gamma": 2, "correct": 2, "ve": 2, "tri": 2, "approach": 2, "simpl": 2, "best": 2, "radius_factor": 2, "unwrappingmethod": 2, "plot": 2, "process": 2, "radiu": 2, "band": 2, "filter": 2, "pointer": 2, "take": 2, "phase": 2, "argument": 2, "np": 2, "select": 2, "anaglyph": 2, "build": 2, "progress": 2, "guo": 2, "improv": 2, "automat": 2, "measur": 2, "1990": 2, "expect": 2, "func": 2, "classic": 2, "doe": 2, "virtual": 2, "plane": 2, "estim": 2, "dim": 2, "1280": 2, "720": 2, "vertic": 2, "dtype": 2, "140581084609120": 2, "sinusoid": 2, "assum": 2, "complementari": 2, "actual": 2, "extract": 2, "three": 2, "singl": 2, "scan": 2, "subtract": 2, "suppress": 2, "dc": 2, "compon": 2, "serv": 2, "purpos": 2, "obtain": 2, "ftp": 2, "rang": 2, "match": 2, "uint8": 2, "140581084546096": 2, "binari": 2, "integ": 2, "direct": 2, "drawn": 2, "140581084574480": 2, "blackthreshold": 2, "extramargin": 2, "exclud": 2, "usual": 2, "whole": 2, "area": 2, "attempt": 2, "insid": 2, "biggest": 2, "contour": 2, "safeti": 2, "margin": 2, "reduc": 2, "w": 2, "rewrit": 2, "complet": 2, "Not": 2, "suitabl": 2, "product": 2, "linear": 2, "subpixel": 2, "accuraci": 2, "scipi": 2, "interp1d": 2, "kind": 2, "miss": 2, "fill": 2, "nearest": 2, "targetdir": 2, "gener": 2, "Then": 2, "half": 2, "string": 2, "directori": 2, "creat": 2, "exist": 2, "count": 2, "circl": 2, "findcirclesgrid": 2, "refin": 2, "cornersubpix": 2, "chessboard": 2, "projectorresolut": 2, "chessboards": 2, "6": 2, "7": 2, "squares": 2, "camintrins": 2, "camdistcoeff": 2, "mit": 2, "licenc": 2, "github": 2, "com": 2, "kamino410": 2, "procam": 2, "daniel": 2, "moreno": 2, "gabriel": 2, "taubin": 2, "accur": 2, "robust": 2, "1109": 2, "3dimpvt": 2, "2012": 2, "77": 2, "put": 2, "per": 2, "normal": 2, "At": 2, "least": 2, "suggest": 2, "should": 2, "avoid": 2, "ambigu": 2, "squar": 2, "size": 2, "known": 2, "metric": 2, "min": 2, "iter": 2, "high": 2, "re": 2, "extend": 2, "top": 2, "condit": 2, "exact": 2, "col": 2, "row": 2, "perviewerror": 2, "view": 2, "rm": 2, "showimag": 2, "side": 2, "exampl": 2, "mm": 2, "reconstruct": 2, "show": 2, "check": 2, "detect": 2, "retval": 2, "calibratecamera": 2, "distcoeff": 2, "rvec": 2, "tvec": 2, "20": 2, "write": 2, "desir": 2, "svg": 2, "express": 2, "column": 2, "line": 2, "10x7": 2, "9": 2, "howev": 2, "exactli": 2, "softwar": 2, "p1": 2, "p2": 2, "lesson": 2, "cristina": 2, "turrini": 2, "unimi": 2, "trento": 2, "09": 2, "04": 2, "2017": 2, "cameraimag": 2, "heterodyn": 2, "principl": 2, "reich": 2, "1997": 2, "In": 2, "descend": 2, "1024": 2, "512": 2, "instead": 2, "target": 2, "defin": 2, "less": 2, "subject": 2, "nois": 2, "uncertanti": 2, "simpler": 2, "stereobm": 2, "stereosgbm": 2, "winsiz": 2, "35": 2, "maxdispar": 2, "16": 2, "mindispar": 2, "gammac": 2, "gammap": 2, "17": 2, "consist": 2, "support": 2, "weight": 2, "k": 2, "yoon": 2, "kweon": 2, "2006": 2, "window": 2, "odd": 2, "maximum": 2, "increas": 2, "influenc": 2, "proxim": 2, "non": 2, "occlud": 2, "assign": 2, "idea": 2, "occlus": 2, "local": 2, "geodes": 2, "asmaa": 2, "hosni": 2, "2009": 2, "enabl": 2, "run": 2, "time": 2, "roughli": 2, "doubl": 2, "version": 2, "written": 2, "everi": 2, "tradit": 2, "remain": 2, "boundari": 2, "prove": 2, "50": 2, "faster": 2, "signific": 2, "decreas": 2, "qualiti": 2, "veri": 2, "slow": 2, "384x288": 2, "than": 2, "sec": 2, "cpu": 2, "while": 2, "60": 2, "1007": 2, "s11554": 2, "012": 2, "0313": 2, "yk": 2, "smoother": 2, "could": 2, "respect": 2, "int16": 2, "11": 2, "fmax": 2, "120": 2, "bin": 2, "incomplet": 2, "michael": 2, "bleyer": 2, "margrit": 2, "gelautz": 2, "christoph": 2, "rhemann": 2, "cap": 2, "distanc": 2, "histogram": 2, "mutual": 2, "inform": 2, "warn": 2, "optim": 2, "clear": 2, "formula": 2, "sum": 2, "cost": 2, "subsequ": 2, "channel": 2, "rel": 2, "multipli": 2, "k1": 2, "k2": 2, "k3": 2, "k4": 2, "k5": 2, "k6": 2, "s1": 2, "s2": 2, "s3": 2, "s4": 2, "\u03c4x": 2, "\u03c4y": 2, "points3d": 2, "referenceimag": 2, "precis": 2, "export": 2, "raw": 2, "ply": 2, "ascii": 2, "absolut": 2, "either": 2, "decim": 2, "higher": 2, "caus": 2, "bigger": 2, "adimension": 2, "model": 2, "lead": 2, "incorrect": 2, "proport": 2, "filenam": 2, "import": 2, "data": 2, "read": 2, "dict": 2, "illustr": 2, "compact": 2, "fusiello": 2, "machin": 2, "vision": 2, "applic": 2, "2000": 2, "rectifiedstereorigobj": 2, "minim": 2, "affect": 2, "par": 2, "computi": 2, "cvpr": 2, "1999": 2, "loop": 2, "c": 2, "zhang": 2, "": 2, "tranform": 2, "account": 2, "intrinsicmatrix1": 2, "intrinsicmatrix2": 2, "h1": 2, "h2": 2, "dims1": 2, "dims2": 2, "desid": 2, "more": 2, "bound": 2, "One": 2, "flip": 2, "fail": 2, "epipol": 2, "close": 2, "recalcul": 2, "standard": 2, "averag": 2, "perspect": 2, "strategi": 2, "devic": 2, "flipi": 2, "video": 2, "stream": 2, "continu": 2, "separ": 2, "thread": 2, "grab": 2, "frame": 2, "lag": 2, "webcam": 2, "url": 2, "open": 2, "connect": 2, "protocol": 2, "usernam": 2, "password": 2, "script": 2, "param": 2, "rais": 2, "valueerror": 2, "cannot": 2, "insert": 2, "sleep": 2, "focal": 2, "retriev": 2, "end": 2, "fp": 2, "framer": 2, "successfulli": 2, "heigth": 2, "No": 2, "stai": 2, "updat": 2, "finish": 2, "rememb": 2, "x1": 2, "x2": 2, "thick": 2, "draw": 2, "epipolar": 2, "know": 2, "pleas": 2, "directli": 2, "v": 2, "antisymmetr": 2, "cross": 2, "often": 2, "indic": 2, "r1": 2, "r2": 2, "t1": 2, "t2": 2, "anywher": 2, "els": 2, "particularli": 2, "go": 2, "3x1": 2}, "objects": {"": [[2, 0, 0, "-", "simplestereo"]], "simplestereo": [[2, 0, 0, "-", "_rigs"], [2, 0, 0, "-", "active"], [2, 0, 0, "-", "calibration"], [2, 0, 0, "-", "passive"], [2, 0, 0, "-", "points"], [2, 0, 0, "-", "rectification"], [2, 0, 0, "-", "unwrapping"], [2, 0, 0, "-", "utils"]], "simplestereo._rigs": [[2, 1, 1, "", "RectifiedStereoRig"], [2, 1, 1, "", "StereoRig"], [2, 1, 1, "", "StructuredLightRig"]], "simplestereo._rigs.RectifiedStereoRig": [[2, 2, 1, "", "Rcommon"], [2, 3, 1, "", "computeRectificationMaps"], [2, 3, 1, "", "fromFile"], [2, 3, 1, "", "get3DPoints"], [2, 3, 1, "", "getRectifiedProjectionMatrices"], [2, 2, 1, "", "rectHomography1"], [2, 2, 1, "", "rectHomography2"], [2, 3, 1, "", "rectifyImages"], [2, 3, 1, "", "save"]], "simplestereo._rigs.StereoRig": [[2, 2, 1, "", "E"], [2, 2, 1, "", "F"], [2, 2, 1, "", "R"], [2, 2, 1, "", "T"], [2, 2, 1, "", "distCoeffs1"], [2, 2, 1, "", "distCoeffs2"], [2, 3, 1, "", "fromFile"], [2, 3, 1, "", "getBaseline"], [2, 3, 1, "", "getCenters"], [2, 3, 1, "", "getEssentialMatrix"], [2, 3, 1, "", "getFundamentalMatrix"], [2, 3, 1, "", "getProjectionMatrices"], [2, 2, 1, "", "intrinsic1"], [2, 2, 1, "", "intrinsic2"], [2, 3, 1, "", "save"], [2, 3, 1, "", "undistortImages"]], "simplestereo._rigs.StructuredLightRig": [[2, 3, 1, "", "fromFile"], [2, 3, 1, "", "triangulate"], [2, 3, 1, "", "undistortCameraImage"]], "simplestereo.active": [[2, 1, 1, "", "GrayCode"], [2, 1, 1, "", "GrayCodeDouble"], [2, 4, 1, "", "GrayCodeSingle"], [2, 1, 1, "", "StereoFTP"], [2, 1, 1, "", "StereoFTPAnaglyph"], [2, 1, 1, "", "StereoFTP_Mapping"], [2, 1, 1, "", "StereoFTP_PhaseOnly"], [2, 5, 1, "", "buildAnaglyphFringe"], [2, 5, 1, "", "buildBinaryFringe"], [2, 5, 1, "", "buildFringe"], [2, 5, 1, "", "computeROI"], [2, 5, 1, "", "findCentralStripe"], [2, 5, 1, "", "generateGrayCodeImgs"]], "simplestereo.active.GrayCode": [[2, 3, 1, "", "getCloud"]], "simplestereo.active.GrayCodeDouble": [[2, 3, 1, "", "getCloud"]], "simplestereo.active.StereoFTP": [[2, 3, 1, "", "convertGrayscale"], [2, 3, 1, "", "getCloud"]], "simplestereo.active.StereoFTPAnaglyph": [[2, 3, 1, "", "convertGrayscale"], [2, 3, 1, "", "getCloud"]], "simplestereo.active.StereoFTP_Mapping": [[2, 3, 1, "", "getCloud"]], "simplestereo.active.StereoFTP_PhaseOnly": [[2, 3, 1, "", "convertGrayscale"], [2, 3, 1, "", "getPhase"]], "simplestereo.calibration": [[2, 5, 1, "", "chessboardProCam"], [2, 5, 1, "", "chessboardProCamWhite"], [2, 5, 1, "", "chessboardSingle"], [2, 5, 1, "", "chessboardStereo"], [2, 5, 1, "", "generateChessboardSVG"], [2, 5, 1, "", "getFundamentalMatrixFromProjections"], [2, 5, 1, "", "phaseShift"], [2, 5, 1, "", "phaseShiftWhite"]], "simplestereo.passive": [[2, 1, 1, "", "StereoASW"], [2, 1, 1, "", "StereoGSW"]], "simplestereo.passive.StereoASW": [[2, 3, 1, "", "compute"]], "simplestereo.passive.StereoGSW": [[2, 3, 1, "", "compute"]], "simplestereo.points": [[2, 5, 1, "", "distortPoints"], [2, 5, 1, "", "exportPLY"], [2, 5, 1, "", "getAdimensional3DPoints"], [2, 5, 1, "", "importPLY"]], "simplestereo.rectification": [[2, 5, 1, "", "fusielloRectify"], [2, 5, 1, "", "getBestXShearingTransformation"], [2, 5, 1, "", "getFittingMatrix"], [2, 5, 1, "", "loopRectify"], [2, 5, 1, "", "stereoRectify"]], "simplestereo.utils": [[2, 1, 1, "", "Capture"], [2, 5, 1, "", "drawCorrespondingEpipolarLines"], [2, 5, 1, "", "getCrossProductMatrix"], [2, 5, 1, "", "moveExtrinsicOriginToFirstCamera"]], "simplestereo.utils.Capture": [[2, 3, 1, "", "get"], [2, 3, 1, "", "getResolution"], [2, 3, 1, "", "setFrameRate"], [2, 3, 1, "", "setResolution"], [2, 3, 1, "", "start"], [2, 3, 1, "", "stop"]]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:property", "3": "py:method", "4": "py:attribute", "5": "py:function"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "property", "Python property"], "3": ["py", "method", "Python method"], "4": ["py", "attribute", "Python attribute"], "5": ["py", "function", "Python function"]}, "titleterms": {"welcom": 0, "simplestereo": [0, 2], "": 0, "document": 0, "content": [0, 2], "indic": 0, "tabl": 0, "packag": [1, 2], "modul": 2, "submodul": 2, "_rig": 2, "todo": 2, "activ": 2, "calibr": 2, "passiv": 2, "point": 2, "rectif": 2, "unwrap": 2, "phaseunwrap": 2, "util": 2}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 8, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.todo": 2, "sphinx.ext.viewcode": 1, "sphinx": 57}, "alltitles": {"Welcome to SimpleStereo\u2019s documentation!": [[0, "welcome-to-simplestereo-s-documentation"]], "Contents:": [[0, null]], "Indices and tables": [[0, "indices-and-tables"]], "package": [[1, "package"]], "simplestereo package": [[2, "simplestereo-package"]], "Module contents": [[2, "module-simplestereo"]], "simplestereo": [[2, "simplestereo"]], "Submodules": [[2, "submodules"]], "simplestereo._rigs module": [[2, "module-simplestereo._rigs"]], "_rigs": [[2, "rigs"]], "Todo": [[2, "id3"], [2, "id4"], [2, "id5"], [2, "id6"], [2, "id9"], [2, "id14"], [2, "id15"], [2, "id16"], [2, "id17"], [2, "id18"], [2, "id19"]], "simplestereo.active module": [[2, "module-simplestereo.active"]], "active": [[2, "active"]], "simplestereo.calibration module": [[2, "module-simplestereo.calibration"]], "calibration": [[2, "calibration"]], "simplestereo.passive module": [[2, "module-simplestereo.passive"]], "passive": [[2, "passive"]], "simplestereo.points module": [[2, "module-simplestereo.points"]], "points": [[2, "points"]], "simplestereo.rectification module": [[2, "module-simplestereo.rectification"]], "rectification": [[2, "rectification"]], "simplestereo.unwrapping module": [[2, "module-simplestereo.unwrapping"]], "phaseUnwrapping": [[2, "phaseunwrapping"]], "simplestereo.utils module": [[2, "module-simplestereo.utils"]], "utils": [[2, "utils"]]}, "indexentries": {"capture (class in simplestereo.utils)": [[2, "simplestereo.utils.Capture"]], "e (simplestereo._rigs.stereorig property)": [[2, "simplestereo._rigs.StereoRig.E"]], "f (simplestereo._rigs.stereorig property)": [[2, "simplestereo._rigs.StereoRig.F"]], "graycode (class in simplestereo.active)": [[2, "simplestereo.active.GrayCode"]], "graycodedouble (class in simplestereo.active)": [[2, "simplestereo.active.GrayCodeDouble"]], "graycodesingle (in module simplestereo.active)": [[2, "simplestereo.active.GrayCodeSingle"]], "r (simplestereo._rigs.stereorig property)": [[2, "simplestereo._rigs.StereoRig.R"]], "rcommon (simplestereo._rigs.rectifiedstereorig property)": [[2, "simplestereo._rigs.RectifiedStereoRig.Rcommon"]], "rectifiedstereorig (class in simplestereo._rigs)": [[2, "simplestereo._rigs.RectifiedStereoRig"]], "stereoasw (class in simplestereo.passive)": [[2, "simplestereo.passive.StereoASW"]], "stereoftp (class in simplestereo.active)": [[2, "simplestereo.active.StereoFTP"]], "stereoftpanaglyph (class in simplestereo.active)": [[2, "simplestereo.active.StereoFTPAnaglyph"]], "stereoftp_mapping (class in simplestereo.active)": [[2, "simplestereo.active.StereoFTP_Mapping"]], "stereoftp_phaseonly (class in simplestereo.active)": [[2, "simplestereo.active.StereoFTP_PhaseOnly"]], "stereogsw (class in simplestereo.passive)": [[2, "simplestereo.passive.StereoGSW"]], "stereorig (class in simplestereo._rigs)": [[2, "simplestereo._rigs.StereoRig"]], "structuredlightrig (class in simplestereo._rigs)": [[2, "simplestereo._rigs.StructuredLightRig"]], "t (simplestereo._rigs.stereorig property)": [[2, "simplestereo._rigs.StereoRig.T"]], "buildanaglyphfringe() (in module simplestereo.active)": [[2, "simplestereo.active.buildAnaglyphFringe"]], "buildbinaryfringe() (in module simplestereo.active)": [[2, "simplestereo.active.buildBinaryFringe"]], "buildfringe() (in module simplestereo.active)": [[2, "simplestereo.active.buildFringe"]], "chessboardprocam() (in module simplestereo.calibration)": [[2, "simplestereo.calibration.chessboardProCam"]], "chessboardprocamwhite() (in module simplestereo.calibration)": [[2, "simplestereo.calibration.chessboardProCamWhite"]], "chessboardsingle() (in module simplestereo.calibration)": [[2, "simplestereo.calibration.chessboardSingle"]], "chessboardstereo() (in module simplestereo.calibration)": [[2, "simplestereo.calibration.chessboardStereo"]], "compute() (simplestereo.passive.stereoasw method)": [[2, "simplestereo.passive.StereoASW.compute"]], "compute() (simplestereo.passive.stereogsw method)": [[2, "simplestereo.passive.StereoGSW.compute"]], "computeroi() (in module simplestereo.active)": [[2, "simplestereo.active.computeROI"]], "computerectificationmaps() (simplestereo._rigs.rectifiedstereorig method)": [[2, "simplestereo._rigs.RectifiedStereoRig.computeRectificationMaps"]], "convertgrayscale() (simplestereo.active.stereoftp static method)": [[2, "simplestereo.active.StereoFTP.convertGrayscale"]], "convertgrayscale() (simplestereo.active.stereoftpanaglyph static method)": [[2, "simplestereo.active.StereoFTPAnaglyph.convertGrayscale"]], "convertgrayscale() (simplestereo.active.stereoftp_phaseonly static method)": [[2, "simplestereo.active.StereoFTP_PhaseOnly.convertGrayscale"]], "distcoeffs1 (simplestereo._rigs.stereorig property)": [[2, "simplestereo._rigs.StereoRig.distCoeffs1"]], "distcoeffs2 (simplestereo._rigs.stereorig property)": [[2, "simplestereo._rigs.StereoRig.distCoeffs2"]], "distortpoints() (in module simplestereo.points)": [[2, "simplestereo.points.distortPoints"]], "drawcorrespondingepipolarlines() (in module simplestereo.utils)": [[2, "simplestereo.utils.drawCorrespondingEpipolarLines"]], "exportply() (in module simplestereo.points)": [[2, "simplestereo.points.exportPLY"]], "findcentralstripe() (in module simplestereo.active)": [[2, "simplestereo.active.findCentralStripe"]], "fromfile() (simplestereo._rigs.rectifiedstereorig class method)": [[2, "simplestereo._rigs.RectifiedStereoRig.fromFile"]], "fromfile() (simplestereo._rigs.stereorig class method)": [[2, "simplestereo._rigs.StereoRig.fromFile"]], "fromfile() (simplestereo._rigs.structuredlightrig method)": [[2, "simplestereo._rigs.StructuredLightRig.fromFile"]], "fusiellorectify() (in module simplestereo.rectification)": [[2, "simplestereo.rectification.fusielloRectify"]], "generatechessboardsvg() (in module simplestereo.calibration)": [[2, "simplestereo.calibration.generateChessboardSVG"]], "generategraycodeimgs() (in module simplestereo.active)": [[2, "simplestereo.active.generateGrayCodeImgs"]], "get() (simplestereo.utils.capture method)": [[2, "simplestereo.utils.Capture.get"]], "get3dpoints() (simplestereo._rigs.rectifiedstereorig method)": [[2, "simplestereo._rigs.RectifiedStereoRig.get3DPoints"]], "getadimensional3dpoints() (in module simplestereo.points)": [[2, "simplestereo.points.getAdimensional3DPoints"]], "getbaseline() (simplestereo._rigs.stereorig method)": [[2, "simplestereo._rigs.StereoRig.getBaseline"]], "getbestxshearingtransformation() (in module simplestereo.rectification)": [[2, "simplestereo.rectification.getBestXShearingTransformation"]], "getcenters() (simplestereo._rigs.stereorig method)": [[2, "simplestereo._rigs.StereoRig.getCenters"]], "getcloud() (simplestereo.active.graycode method)": [[2, "simplestereo.active.GrayCode.getCloud"]], "getcloud() (simplestereo.active.graycodedouble method)": [[2, "simplestereo.active.GrayCodeDouble.getCloud"]], "getcloud() (simplestereo.active.stereoftp method)": [[2, "simplestereo.active.StereoFTP.getCloud"]], "getcloud() (simplestereo.active.stereoftpanaglyph method)": [[2, "simplestereo.active.StereoFTPAnaglyph.getCloud"]], "getcloud() (simplestereo.active.stereoftp_mapping method)": [[2, "simplestereo.active.StereoFTP_Mapping.getCloud"]], "getcrossproductmatrix() (in module simplestereo.utils)": [[2, "simplestereo.utils.getCrossProductMatrix"]], "getessentialmatrix() (simplestereo._rigs.stereorig method)": [[2, "simplestereo._rigs.StereoRig.getEssentialMatrix"]], "getfittingmatrix() (in module simplestereo.rectification)": [[2, "simplestereo.rectification.getFittingMatrix"]], "getfundamentalmatrix() (simplestereo._rigs.stereorig method)": [[2, "simplestereo._rigs.StereoRig.getFundamentalMatrix"]], "getfundamentalmatrixfromprojections() (in module simplestereo.calibration)": [[2, "simplestereo.calibration.getFundamentalMatrixFromProjections"]], "getphase() (simplestereo.active.stereoftp_phaseonly method)": [[2, "simplestereo.active.StereoFTP_PhaseOnly.getPhase"]], "getprojectionmatrices() (simplestereo._rigs.stereorig method)": [[2, "simplestereo._rigs.StereoRig.getProjectionMatrices"]], "getrectifiedprojectionmatrices() (simplestereo._rigs.rectifiedstereorig method)": [[2, "simplestereo._rigs.RectifiedStereoRig.getRectifiedProjectionMatrices"]], "getresolution() (simplestereo.utils.capture method)": [[2, "simplestereo.utils.Capture.getResolution"]], "importply() (in module simplestereo.points)": [[2, "simplestereo.points.importPLY"]], "intrinsic1 (simplestereo._rigs.stereorig property)": [[2, "simplestereo._rigs.StereoRig.intrinsic1"]], "intrinsic2 (simplestereo._rigs.stereorig property)": [[2, "simplestereo._rigs.StereoRig.intrinsic2"]], "looprectify() (in module simplestereo.rectification)": [[2, "simplestereo.rectification.loopRectify"]], "module": [[2, "module-simplestereo"], [2, "module-simplestereo._rigs"], [2, "module-simplestereo.active"], [2, "module-simplestereo.calibration"], [2, "module-simplestereo.passive"], [2, "module-simplestereo.points"], [2, "module-simplestereo.rectification"], [2, "module-simplestereo.unwrapping"], [2, "module-simplestereo.utils"]], "moveextrinsicorigintofirstcamera() (in module simplestereo.utils)": [[2, "simplestereo.utils.moveExtrinsicOriginToFirstCamera"]], "phaseshift() (in module simplestereo.calibration)": [[2, "simplestereo.calibration.phaseShift"]], "phaseshiftwhite() (in module simplestereo.calibration)": [[2, "simplestereo.calibration.phaseShiftWhite"]], "recthomography1 (simplestereo._rigs.rectifiedstereorig property)": [[2, "simplestereo._rigs.RectifiedStereoRig.rectHomography1"]], "recthomography2 (simplestereo._rigs.rectifiedstereorig property)": [[2, "simplestereo._rigs.RectifiedStereoRig.rectHomography2"]], "rectifyimages() (simplestereo._rigs.rectifiedstereorig method)": [[2, "simplestereo._rigs.RectifiedStereoRig.rectifyImages"]], "save() (simplestereo._rigs.rectifiedstereorig method)": [[2, "simplestereo._rigs.RectifiedStereoRig.save"]], "save() (simplestereo._rigs.stereorig method)": [[2, "simplestereo._rigs.StereoRig.save"]], "setframerate() (simplestereo.utils.capture method)": [[2, "simplestereo.utils.Capture.setFrameRate"]], "setresolution() (simplestereo.utils.capture method)": [[2, "simplestereo.utils.Capture.setResolution"]], "simplestereo": [[2, "module-simplestereo"]], "simplestereo._rigs": [[2, "module-simplestereo._rigs"]], "simplestereo.active": [[2, "module-simplestereo.active"]], "simplestereo.calibration": [[2, "module-simplestereo.calibration"]], "simplestereo.passive": [[2, "module-simplestereo.passive"]], "simplestereo.points": [[2, "module-simplestereo.points"]], "simplestereo.rectification": [[2, "module-simplestereo.rectification"]], "simplestereo.unwrapping": [[2, "module-simplestereo.unwrapping"]], "simplestereo.utils": [[2, "module-simplestereo.utils"]], "start() (simplestereo.utils.capture method)": [[2, "simplestereo.utils.Capture.start"]], "stereorectify() (in module simplestereo.rectification)": [[2, "simplestereo.rectification.stereoRectify"]], "stop() (simplestereo.utils.capture method)": [[2, "simplestereo.utils.Capture.stop"]], "triangulate() (simplestereo._rigs.structuredlightrig method)": [[2, "simplestereo._rigs.StructuredLightRig.triangulate"]], "undistortcameraimage() (simplestereo._rigs.structuredlightrig method)": [[2, "simplestereo._rigs.StructuredLightRig.undistortCameraImage"]], "undistortimages() (simplestereo._rigs.stereorig method)": [[2, "simplestereo._rigs.StereoRig.undistortImages"]]}}) \ No newline at end of file +Search.setIndex({"docnames": ["index", "modules", "simplestereo"], "filenames": ["index.rst", "modules.rst", "simplestereo.rst"], "titles": ["Welcome to SimpleStereo\u2019s documentation!", "package", "simplestereo package"], "terms": {"packag": 0, "modul": [0, 1], "submodul": [0, 1], "_rig": [0, 1], "activ": [0, 1], "calibr": [0, 1], "passiv": [0, 1], "point": [0, 1], "rectif": [0, 1], "unwrap": [0, 1], "util": [0, 1], "index": [0, 2], "search": [0, 2], "page": 0, "simplestereo": 1, "content": 1, "rectifiedstereorig": [1, 2], "rcommon": [1, 2], "computerectificationmap": [1, 2], "fromfil": [1, 2], "get3dpoint": [1, 2], "getrectifiedprojectionmatric": [1, 2], "recthomography1": [1, 2], "recthomography2": [1, 2], "rectifyimag": [1, 2], "save": [1, 2], "stereorig": [1, 2], "e": [1, 2], "f": [1, 2], "r": [1, 2], "t": [1, 2], "distcoeffs1": [1, 2], "distcoeffs2": [1, 2], "getbaselin": [1, 2], "getcent": [1, 2], "getessentialmatrix": [1, 2], "getfundamentalmatrix": [1, 2], "getprojectionmatric": [1, 2], "intrinsic1": [1, 2], "intrinsic2": [1, 2], "undistortimag": [1, 2], "structuredlightrig": [1, 2], "triangul": [1, 2], "undistortcameraimag": [1, 2], "graycod": [1, 2], "getcloud": [1, 2], "graycodedoubl": [1, 2], "graycodesingl": [1, 2], "stereoftp": [1, 2], "convertgrayscal": [1, 2], "stereoftpanaglyph": [1, 2], "stereoftp_map": [1, 2], "stereoftp_phaseonli": [1, 2], "getphas": [1, 2], "buildanaglyphfring": [1, 2], "buildbinaryfring": [1, 2], "buildfring": [1, 2], "computeroi": [1, 2], "findcentralstrip": [1, 2], "generategraycodeimg": [1, 2], "chessboardprocam": [1, 2], "chessboardprocamwhit": [1, 2], "chessboardsingl": [1, 2], "chessboardstereo": [1, 2], "generatechessboardsvg": [1, 2], "getfundamentalmatrixfromproject": [1, 2], "phaseshift": [1, 2], "phaseshiftwhit": [1, 2], "stereoasw": [1, 2], "comput": [1, 2], "stereogsw": [1, 2], "distortpoint": [1, 2], "exportpli": [1, 2], "getadimensional3dpoint": [1, 2], "importpli": [1, 2], "fusiellorectifi": [1, 2], "getbestxshearingtransform": [1, 2], "getfittingmatrix": [1, 2], "looprectifi": [1, 2], "stereorectifi": [1, 2], "phaseunwrap": 1, "captur": [1, 2], "get": [1, 2], "getresolut": [1, 2], "setframer": [1, 2], "setresolut": [1, 2], "start": [1, 2], "stop": [1, 2], "drawcorrespondingepipolarlin": [1, 2], "getcrossproductmatrix": [1, 2], "moveextrinsicorigintofirstcamera": [1, 2], "initi": 2, "document": 2, "docstr": 2, "follow": 2, "numpi": 2, "style": 2, "wherev": 2, "possibl": 2, "see": 2, "http": 2, "numpydoc": 2, "readthedoc": 2, "io": 2, "en": 2, "latest": 2, "format": 2, "html": 2, "main": 2, "class": 2, "load": 2, "level": 2, "py": 2, "__init__": 2, "add": 2, "new": 2, "rig": 2, "uncalibr": 2, "stereo": 2, "arg": 2, "sourc": 2, "base": 2, "keep": 2, "togeth": 2, "manag": 2, "all": 2, "paramet": 2, "rectifi": 2, "It": 2, "includ": 2, "plu": 2, "two": 2, "homographi": 2, "differ": 2, "from": 2, "opencv": 2, "here": 2, "pixel": 2, "domain": 2, "ar": 2, "taken": 2, "input": 2, "ones": 2, "commonli": 2, "refer": 2, "literatur": 2, "transform": 2, "object": 2, "space": 2, "ndarrai": 2, "3x3": 2, "matric": 2, "repres": 2, "common": 2, "camera": 2, "orient": 2, "after": 2, "sequenc": 2, "A": 2, "altern": 2, "same": 2, "order": 2, "attribut": 2, "method": 2, "properti": 2, "destdim": 2, "none": 2, "alpha": 2, "1": 2, "map": 2, "undistort": 2, "pair": 2, "thi": 2, "wrap": 2, "cv2": 2, "initundistortrectifymap": 2, "custom": 2, "fit": 2, "algorithm": 2, "imag": 2, "within": 2, "dimens": 2, "modifi": 2, "origin": 2, "matrix": 2, "appli": 2, "affin": 2, "x": 2, "y": 2, "scale": 2, "translat": 2, "shear": 2, "axi": 2, "onli": 2, "without": 2, "lose": 2, "The": 2, "store": 2, "intern": 2, "i": 2, "call": 2, "constructor": 2, "default": 2, "can": 2, "later": 2, "chang": 2, "its": 2, "set": 2, "tupl": 2, "option": 2, "resolut": 2, "destin": 2, "width": 2, "height": 2, "first": 2, "float": 2, "between": 2, "0": 2, "both": 2, "If": 2, "corner": 2, "preserv": 2, "valid": 2, "rectangl": 2, "made": 2, "visibl": 2, "intermedi": 2, "valu": 2, "produc": 2, "result": 2, "middl": 2, "extrem": 2, "skew": 2, "posit": 2, "do": 2, "work": 2, "well": 2, "return": 2, "type": 2, "note": 2, "us": 2, "most": 2, "paper": 2, "provid": 2, "rotat": 2, "3d": 2, "librari": 2, "alwai": 2, "To": 2, "adapt": 2, "other": 2, "function": 2, "given": 2, "recthomographi": 2, "dot": 2, "cameramatrix": 2, "For": 2, "each": 2, "h": 2, "classmethod": 2, "filepath": 2, "stereorigrectifi": 2, "json": 2, "file": 2, "str": 2, "path": 2, "contain": 2, "an": 2, "disparitymap": 2, "dispar": 2, "wa": 2, "done": 2, "real": 2, "world": 2, "unit": 2, "g": 2, "millimet": 2, "output": 2, "would": 2, "left": 2, "dens": 2, "have": 2, "arrai": 2, "shape": 2, "3": 2, "where": 2, "coordin": 2, "z": 2, "associ": 2, "calcul": 2, "project": 2, "2": 2, "share": 2, "one": 2, "horizont": 2, "displac": 2, "baselin": 2, "intrins": 2, "depend": 2, "rigid": 2, "manipul": 2, "3x4": 2, "second": 2, "img1": 2, "img2": 2, "interpol": 2, "magicmock": 2, "id": 2, "140040679392848": 2, "coupl": 2, "come": 2, "must": 2, "right": 2, "remap": 2, "dure": 2, "befor": 2, "final": 2, "mat": 2, "int": 2, "interpolationflag": 2, "inter_nearest": 2, "inter_linear": 2, "inter_cub": 2, "img1_rect": 2, "img2_rect": 2, "configur": 2, "current": 2, "res1": 2, "res2": 2, "reprojectionerror": 2, "essenti": 2, "fundament": 2, "thei": 2, "avail": 2, "mai": 2, "need": 2, "list": 2, "form": 2, "fx": 2, "tx": 2, "fy": 2, "ty": 2, "distort": 2, "coeffici": 2, "4": 2, "5": 2, "8": 2, "12": 2, "14": 2, "element": 2, "1st": 2, "2nd": 2, "system": 2, "vector": 2, "total": 2, "reproject": 2, "error": 2, "convent": 2, "henc": 2, "extrins": 2, "ident": 2, "zero": 2, "your": 2, "place": 2, "you": 2, "convert": 2, "norm": 2, "length": 2, "center": 2, "anywai": 2, "ha": 2, "free": 2, "factor": 2, "changecamera": 2, "fals": 2, "centerprincipalpoint": 2, "getoptimalnewcameramatrix": 2, "otherwis": 2, "consid": 2, "when": 2, "bool": 2, "skip": 2, "true": 2, "minimum": 2, "unwant": 2, "so": 2, "even": 2, "remov": 2, "some": 2, "retain": 2, "extra": 2, "black": 2, "accept": 2, "too": 2, "princip": 2, "img1_undist": 2, "img2_undist": 2, "cameramatrixnew1": 2, "cameramatrixnew2": 2, "child": 2, "structur": 2, "light": 2, "campoint": 2, "projpoint": 2, "projector": 2, "correspond": 2, "proce": 2, "last": 2, "alreadi": 2, "imgobj": 2, "helper": 2, "black_thr": 2, "40": 2, "white_thr": 2, "wrapper": 2, "grai": 2, "code": 2, "implement": 2, "threshold": 2, "number": 2, "255": 2, "bright": 2, "requir": 2, "fulli": 2, "illumin": 2, "white": 2, "computeshadowmask": 2, "pattern": 2, "invers": 2, "getprojpixel": 2, "unaccur": 2, "especi": 2, "along": 2, "border": 2, "case": 2, "ignor": 2, "pass": 2, "narrow": 2, "roi": 2, "perform": 2, "acquir": 2, "like": 2, "structured_light_graycodepattern": 2, "ani": 2, "full": 2, "region": 2, "interest": 2, "upper": 2, "n": 2, "cloud": 2, "nan": 2, "invalid": 2, "locat": 2, "projr": 2, "roi1": 2, "roi2": 2, "dimension": 2, "onel": 2, "png": 2, "oner": 2, "twol": 2, "twor": 2, "As": 2, "alia": 2, "fring": 2, "period": 2, "shift": 2, "stripecolor": 2, "red": 2, "stripesensit": 2, "fourier": 2, "profilometri": 2, "fringedim": 2, "bgr": 2, "color": 2, "central": 2, "stripe": 2, "chosen": 2, "among": 2, "blue": 2, "green": 2, "also": 2, "b": 2, "sensit": 2, "find": 2, "detail": 2, "pasqual": 2, "lafiosca": 2, "et": 2, "al": 2, "autom": 2, "aircraft": 2, "dent": 2, "inspect": 2, "via": 2, "sensor": 2, "2022": 2, "doi": 2, "org": 2, "10": 2, "3390": 2, "s22020433": 2, "static": 2, "img": 2, "grayscal": 2, "max": 2, "highest": 2, "over": 2, "allow": 2, "fft": 2, "properli": 2, "gamma": 2, "correct": 2, "ve": 2, "tri": 2, "approach": 2, "simpl": 2, "best": 2, "radius_factor": 2, "unwrappingmethod": 2, "plot": 2, "process": 2, "radiu": 2, "band": 2, "filter": 2, "pointer": 2, "take": 2, "phase": 2, "argument": 2, "np": 2, "select": 2, "anaglyph": 2, "build": 2, "progress": 2, "guo": 2, "improv": 2, "automat": 2, "measur": 2, "1990": 2, "expect": 2, "func": 2, "classic": 2, "doe": 2, "virtual": 2, "plane": 2, "estim": 2, "dim": 2, "1280": 2, "720": 2, "vertic": 2, "dtype": 2, "140040679619920": 2, "sinusoid": 2, "assum": 2, "complementari": 2, "actual": 2, "extract": 2, "three": 2, "singl": 2, "scan": 2, "subtract": 2, "suppress": 2, "dc": 2, "compon": 2, "serv": 2, "purpos": 2, "obtain": 2, "ftp": 2, "rang": 2, "match": 2, "uint8": 2, "140040679614672": 2, "binari": 2, "integ": 2, "direct": 2, "drawn": 2, "140040701967952": 2, "blackthreshold": 2, "extramargin": 2, "exclud": 2, "usual": 2, "whole": 2, "area": 2, "attempt": 2, "insid": 2, "biggest": 2, "contour": 2, "safeti": 2, "margin": 2, "reduc": 2, "w": 2, "rewrit": 2, "complet": 2, "Not": 2, "suitabl": 2, "product": 2, "linear": 2, "subpixel": 2, "accuraci": 2, "scipi": 2, "interp1d": 2, "kind": 2, "miss": 2, "fill": 2, "nearest": 2, "targetdir": 2, "gener": 2, "Then": 2, "half": 2, "string": 2, "directori": 2, "creat": 2, "exist": 2, "count": 2, "circl": 2, "findcirclesgrid": 2, "refin": 2, "cornersubpix": 2, "chessboard": 2, "projectorresolut": 2, "chessboards": 2, "6": 2, "7": 2, "squares": 2, "camintrins": 2, "camdistcoeff": 2, "mit": 2, "licenc": 2, "github": 2, "com": 2, "kamino410": 2, "procam": 2, "daniel": 2, "moreno": 2, "gabriel": 2, "taubin": 2, "accur": 2, "robust": 2, "1109": 2, "3dimpvt": 2, "2012": 2, "77": 2, "put": 2, "per": 2, "normal": 2, "At": 2, "least": 2, "suggest": 2, "should": 2, "avoid": 2, "ambigu": 2, "squar": 2, "size": 2, "known": 2, "metric": 2, "min": 2, "iter": 2, "high": 2, "re": 2, "extend": 2, "top": 2, "condit": 2, "exact": 2, "col": 2, "row": 2, "perviewerror": 2, "view": 2, "rm": 2, "showimag": 2, "distortioncoeffsnumb": 2, "side": 2, "exampl": 2, "mm": 2, "reconstruct": 2, "show": 2, "check": 2, "detect": 2, "either": 2, "specifi": 2, "pleas": 2, "small": 2, "subset": 2, "advanc": 2, "found": 2, "disabl": 2, "basic": 2, "radial": 2, "tangenti": 2, "retval": 2, "calibratecamera": 2, "distcoeff": 2, "rvec": 2, "tvec": 2, "20": 2, "write": 2, "desir": 2, "svg": 2, "express": 2, "column": 2, "line": 2, "10x7": 2, "9": 2, "howev": 2, "exactli": 2, "softwar": 2, "p1": 2, "p2": 2, "lesson": 2, "cristina": 2, "turrini": 2, "unimi": 2, "trento": 2, "09": 2, "04": 2, "2017": 2, "cameraimag": 2, "heterodyn": 2, "principl": 2, "reich": 2, "1997": 2, "In": 2, "descend": 2, "1024": 2, "512": 2, "instead": 2, "target": 2, "defin": 2, "less": 2, "subject": 2, "nois": 2, "uncertanti": 2, "simpler": 2, "stereobm": 2, "stereosgbm": 2, "winsiz": 2, "35": 2, "maxdispar": 2, "16": 2, "mindispar": 2, "gammac": 2, "gammap": 2, "17": 2, "consist": 2, "support": 2, "weight": 2, "k": 2, "yoon": 2, "kweon": 2, "2006": 2, "window": 2, "odd": 2, "maximum": 2, "increas": 2, "influenc": 2, "proxim": 2, "non": 2, "occlud": 2, "assign": 2, "idea": 2, "occlus": 2, "local": 2, "geodes": 2, "asmaa": 2, "hosni": 2, "2009": 2, "enabl": 2, "run": 2, "time": 2, "roughli": 2, "doubl": 2, "version": 2, "written": 2, "everi": 2, "tradit": 2, "remain": 2, "boundari": 2, "prove": 2, "50": 2, "faster": 2, "signific": 2, "decreas": 2, "qualiti": 2, "veri": 2, "slow": 2, "384x288": 2, "than": 2, "sec": 2, "cpu": 2, "while": 2, "60": 2, "1007": 2, "s11554": 2, "012": 2, "0313": 2, "yk": 2, "smoother": 2, "could": 2, "respect": 2, "int16": 2, "11": 2, "fmax": 2, "120": 2, "bin": 2, "incomplet": 2, "michael": 2, "bleyer": 2, "margrit": 2, "gelautz": 2, "christoph": 2, "rhemann": 2, "cap": 2, "distanc": 2, "histogram": 2, "mutual": 2, "inform": 2, "warn": 2, "optim": 2, "clear": 2, "formula": 2, "sum": 2, "cost": 2, "subsequ": 2, "channel": 2, "rel": 2, "multipli": 2, "k1": 2, "k2": 2, "k3": 2, "k4": 2, "k5": 2, "k6": 2, "s1": 2, "s2": 2, "s3": 2, "s4": 2, "\u03c4x": 2, "\u03c4y": 2, "points3d": 2, "referenceimag": 2, "precis": 2, "export": 2, "raw": 2, "ply": 2, "ascii": 2, "absolut": 2, "decim": 2, "higher": 2, "caus": 2, "bigger": 2, "adimension": 2, "model": 2, "lead": 2, "incorrect": 2, "proport": 2, "filenam": 2, "import": 2, "data": 2, "read": 2, "dict": 2, "illustr": 2, "compact": 2, "fusiello": 2, "machin": 2, "vision": 2, "applic": 2, "2000": 2, "rectifiedstereorigobj": 2, "minim": 2, "affect": 2, "par": 2, "computi": 2, "cvpr": 2, "1999": 2, "loop": 2, "c": 2, "zhang": 2, "": 2, "tranform": 2, "account": 2, "intrinsicmatrix1": 2, "intrinsicmatrix2": 2, "h1": 2, "h2": 2, "dims1": 2, "dims2": 2, "desid": 2, "more": 2, "bound": 2, "One": 2, "flip": 2, "fail": 2, "epipol": 2, "close": 2, "recalcul": 2, "standard": 2, "averag": 2, "perspect": 2, "strategi": 2, "devic": 2, "flipi": 2, "video": 2, "stream": 2, "continu": 2, "separ": 2, "thread": 2, "grab": 2, "frame": 2, "lag": 2, "webcam": 2, "url": 2, "open": 2, "connect": 2, "protocol": 2, "usernam": 2, "password": 2, "script": 2, "param": 2, "rais": 2, "valueerror": 2, "cannot": 2, "insert": 2, "sleep": 2, "focal": 2, "retriev": 2, "end": 2, "fp": 2, "framer": 2, "successfulli": 2, "heigth": 2, "No": 2, "stai": 2, "updat": 2, "finish": 2, "rememb": 2, "x1": 2, "x2": 2, "thick": 2, "draw": 2, "epipolar": 2, "know": 2, "directli": 2, "v": 2, "antisymmetr": 2, "cross": 2, "often": 2, "indic": 2, "r1": 2, "r2": 2, "t1": 2, "t2": 2, "anywher": 2, "els": 2, "particularli": 2, "go": 2, "3x1": 2}, "objects": {"": [[2, 0, 0, "-", "simplestereo"]], "simplestereo": [[2, 0, 0, "-", "_rigs"], [2, 0, 0, "-", "active"], [2, 0, 0, "-", "calibration"], [2, 0, 0, "-", "passive"], [2, 0, 0, "-", "points"], [2, 0, 0, "-", "rectification"], [2, 0, 0, "-", "unwrapping"], [2, 0, 0, "-", "utils"]], "simplestereo._rigs": [[2, 1, 1, "", "RectifiedStereoRig"], [2, 1, 1, "", "StereoRig"], [2, 1, 1, "", "StructuredLightRig"]], "simplestereo._rigs.RectifiedStereoRig": [[2, 2, 1, "", "Rcommon"], [2, 3, 1, "", "computeRectificationMaps"], [2, 3, 1, "", "fromFile"], [2, 3, 1, "", "get3DPoints"], [2, 3, 1, "", "getRectifiedProjectionMatrices"], [2, 2, 1, "", "rectHomography1"], [2, 2, 1, "", "rectHomography2"], [2, 3, 1, "", "rectifyImages"], [2, 3, 1, "", "save"]], "simplestereo._rigs.StereoRig": [[2, 2, 1, "", "E"], [2, 2, 1, "", "F"], [2, 2, 1, "", "R"], [2, 2, 1, "", "T"], [2, 2, 1, "", "distCoeffs1"], [2, 2, 1, "", "distCoeffs2"], [2, 3, 1, "", "fromFile"], [2, 3, 1, "", "getBaseline"], [2, 3, 1, "", "getCenters"], [2, 3, 1, "", "getEssentialMatrix"], [2, 3, 1, "", "getFundamentalMatrix"], [2, 3, 1, "", "getProjectionMatrices"], [2, 2, 1, "", "intrinsic1"], [2, 2, 1, "", "intrinsic2"], [2, 3, 1, "", "save"], [2, 3, 1, "", "undistortImages"]], "simplestereo._rigs.StructuredLightRig": [[2, 3, 1, "", "fromFile"], [2, 3, 1, "", "triangulate"], [2, 3, 1, "", "undistortCameraImage"]], "simplestereo.active": [[2, 1, 1, "", "GrayCode"], [2, 1, 1, "", "GrayCodeDouble"], [2, 4, 1, "", "GrayCodeSingle"], [2, 1, 1, "", "StereoFTP"], [2, 1, 1, "", "StereoFTPAnaglyph"], [2, 1, 1, "", "StereoFTP_Mapping"], [2, 1, 1, "", "StereoFTP_PhaseOnly"], [2, 5, 1, "", "buildAnaglyphFringe"], [2, 5, 1, "", "buildBinaryFringe"], [2, 5, 1, "", "buildFringe"], [2, 5, 1, "", "computeROI"], [2, 5, 1, "", "findCentralStripe"], [2, 5, 1, "", "generateGrayCodeImgs"]], "simplestereo.active.GrayCode": [[2, 3, 1, "", "getCloud"]], "simplestereo.active.GrayCodeDouble": [[2, 3, 1, "", "getCloud"]], "simplestereo.active.StereoFTP": [[2, 3, 1, "", "convertGrayscale"], [2, 3, 1, "", "getCloud"]], "simplestereo.active.StereoFTPAnaglyph": [[2, 3, 1, "", "convertGrayscale"], [2, 3, 1, "", "getCloud"]], "simplestereo.active.StereoFTP_Mapping": [[2, 3, 1, "", "getCloud"]], "simplestereo.active.StereoFTP_PhaseOnly": [[2, 3, 1, "", "convertGrayscale"], [2, 3, 1, "", "getPhase"]], "simplestereo.calibration": [[2, 5, 1, "", "chessboardProCam"], [2, 5, 1, "", "chessboardProCamWhite"], [2, 5, 1, "", "chessboardSingle"], [2, 5, 1, "", "chessboardStereo"], [2, 5, 1, "", "generateChessboardSVG"], [2, 5, 1, "", "getFundamentalMatrixFromProjections"], [2, 5, 1, "", "phaseShift"], [2, 5, 1, "", "phaseShiftWhite"]], "simplestereo.passive": [[2, 1, 1, "", "StereoASW"], [2, 1, 1, "", "StereoGSW"]], "simplestereo.passive.StereoASW": [[2, 3, 1, "", "compute"]], "simplestereo.passive.StereoGSW": [[2, 3, 1, "", "compute"]], "simplestereo.points": [[2, 5, 1, "", "distortPoints"], [2, 5, 1, "", "exportPLY"], [2, 5, 1, "", "getAdimensional3DPoints"], [2, 5, 1, "", "importPLY"]], "simplestereo.rectification": [[2, 5, 1, "", "fusielloRectify"], [2, 5, 1, "", "getBestXShearingTransformation"], [2, 5, 1, "", "getFittingMatrix"], [2, 5, 1, "", "loopRectify"], [2, 5, 1, "", "stereoRectify"]], "simplestereo.utils": [[2, 1, 1, "", "Capture"], [2, 5, 1, "", "drawCorrespondingEpipolarLines"], [2, 5, 1, "", "getCrossProductMatrix"], [2, 5, 1, "", "moveExtrinsicOriginToFirstCamera"]], "simplestereo.utils.Capture": [[2, 3, 1, "", "get"], [2, 3, 1, "", "getResolution"], [2, 3, 1, "", "setFrameRate"], [2, 3, 1, "", "setResolution"], [2, 3, 1, "", "start"], [2, 3, 1, "", "stop"]]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:property", "3": "py:method", "4": "py:attribute", "5": "py:function"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "property", "Python property"], "3": ["py", "method", "Python method"], "4": ["py", "attribute", "Python attribute"], "5": ["py", "function", "Python function"]}, "titleterms": {"welcom": 0, "simplestereo": [0, 2], "": 0, "document": 0, "content": [0, 2], "indic": 0, "tabl": 0, "packag": [1, 2], "modul": 2, "submodul": 2, "_rig": 2, "todo": 2, "activ": 2, "calibr": 2, "passiv": 2, "point": 2, "rectif": 2, "unwrap": 2, "phaseunwrap": 2, "util": 2}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.todo": 2, "sphinx.ext.viewcode": 1, "sphinx": 60}, "alltitles": {"Welcome to SimpleStereo\u2019s documentation!": [[0, "welcome-to-simplestereo-s-documentation"]], "Contents:": [[0, null]], "Indices and tables": [[0, "indices-and-tables"]], "package": [[1, "package"]], "simplestereo package": [[2, "simplestereo-package"]], "Module contents": [[2, "module-simplestereo"]], "simplestereo": [[2, "simplestereo"]], "Submodules": [[2, "submodules"]], "simplestereo._rigs module": [[2, "module-simplestereo._rigs"]], "_rigs": [[2, "rigs"]], "Todo": [[2, "id3"], [2, "id4"], [2, "id5"], [2, "id6"], [2, "id9"], [2, "id14"], [2, "id15"], [2, "id16"], [2, "id17"], [2, "id18"], [2, "id19"]], "simplestereo.active module": [[2, "module-simplestereo.active"]], "active": [[2, "active"]], "simplestereo.calibration module": [[2, "module-simplestereo.calibration"]], "calibration": [[2, "calibration"]], "simplestereo.passive module": [[2, "module-simplestereo.passive"]], "passive": [[2, "passive"]], "simplestereo.points module": [[2, "module-simplestereo.points"]], "points": [[2, "points"]], "simplestereo.rectification module": [[2, "module-simplestereo.rectification"]], "rectification": [[2, "rectification"]], "simplestereo.unwrapping module": [[2, "module-simplestereo.unwrapping"]], "phaseUnwrapping": [[2, "phaseunwrapping"]], "simplestereo.utils module": [[2, "module-simplestereo.utils"]], "utils": [[2, "utils"]]}, "indexentries": {"capture (class in simplestereo.utils)": [[2, "simplestereo.utils.Capture"]], "e (simplestereo._rigs.stereorig property)": [[2, "simplestereo._rigs.StereoRig.E"]], "f (simplestereo._rigs.stereorig property)": [[2, "simplestereo._rigs.StereoRig.F"]], "graycode (class in simplestereo.active)": [[2, "simplestereo.active.GrayCode"]], "graycodedouble (class in simplestereo.active)": [[2, "simplestereo.active.GrayCodeDouble"]], "graycodesingle (in module simplestereo.active)": [[2, "simplestereo.active.GrayCodeSingle"]], "r (simplestereo._rigs.stereorig property)": [[2, "simplestereo._rigs.StereoRig.R"]], "rcommon (simplestereo._rigs.rectifiedstereorig property)": [[2, "simplestereo._rigs.RectifiedStereoRig.Rcommon"]], "rectifiedstereorig (class in simplestereo._rigs)": [[2, "simplestereo._rigs.RectifiedStereoRig"]], "stereoasw (class in simplestereo.passive)": [[2, "simplestereo.passive.StereoASW"]], "stereoftp (class in simplestereo.active)": [[2, "simplestereo.active.StereoFTP"]], "stereoftpanaglyph (class in simplestereo.active)": [[2, "simplestereo.active.StereoFTPAnaglyph"]], "stereoftp_mapping (class in simplestereo.active)": [[2, "simplestereo.active.StereoFTP_Mapping"]], "stereoftp_phaseonly (class in simplestereo.active)": [[2, "simplestereo.active.StereoFTP_PhaseOnly"]], "stereogsw (class in simplestereo.passive)": [[2, "simplestereo.passive.StereoGSW"]], "stereorig (class in simplestereo._rigs)": [[2, "simplestereo._rigs.StereoRig"]], "structuredlightrig (class in simplestereo._rigs)": [[2, "simplestereo._rigs.StructuredLightRig"]], "t (simplestereo._rigs.stereorig property)": [[2, "simplestereo._rigs.StereoRig.T"]], "buildanaglyphfringe() (in module simplestereo.active)": [[2, "simplestereo.active.buildAnaglyphFringe"]], "buildbinaryfringe() (in module simplestereo.active)": [[2, "simplestereo.active.buildBinaryFringe"]], "buildfringe() (in module simplestereo.active)": [[2, "simplestereo.active.buildFringe"]], "chessboardprocam() (in module simplestereo.calibration)": [[2, "simplestereo.calibration.chessboardProCam"]], "chessboardprocamwhite() (in module simplestereo.calibration)": [[2, "simplestereo.calibration.chessboardProCamWhite"]], "chessboardsingle() (in module simplestereo.calibration)": [[2, "simplestereo.calibration.chessboardSingle"]], "chessboardstereo() (in module simplestereo.calibration)": [[2, "simplestereo.calibration.chessboardStereo"]], "compute() (simplestereo.passive.stereoasw method)": [[2, "simplestereo.passive.StereoASW.compute"]], "compute() (simplestereo.passive.stereogsw method)": [[2, "simplestereo.passive.StereoGSW.compute"]], "computeroi() (in module simplestereo.active)": [[2, "simplestereo.active.computeROI"]], "computerectificationmaps() (simplestereo._rigs.rectifiedstereorig method)": [[2, "simplestereo._rigs.RectifiedStereoRig.computeRectificationMaps"]], "convertgrayscale() (simplestereo.active.stereoftp static method)": [[2, "simplestereo.active.StereoFTP.convertGrayscale"]], "convertgrayscale() (simplestereo.active.stereoftpanaglyph static method)": [[2, "simplestereo.active.StereoFTPAnaglyph.convertGrayscale"]], "convertgrayscale() (simplestereo.active.stereoftp_phaseonly static method)": [[2, "simplestereo.active.StereoFTP_PhaseOnly.convertGrayscale"]], "distcoeffs1 (simplestereo._rigs.stereorig property)": [[2, "simplestereo._rigs.StereoRig.distCoeffs1"]], "distcoeffs2 (simplestereo._rigs.stereorig property)": [[2, "simplestereo._rigs.StereoRig.distCoeffs2"]], "distortpoints() (in module simplestereo.points)": [[2, "simplestereo.points.distortPoints"]], "drawcorrespondingepipolarlines() (in module simplestereo.utils)": [[2, "simplestereo.utils.drawCorrespondingEpipolarLines"]], "exportply() (in module simplestereo.points)": [[2, "simplestereo.points.exportPLY"]], "findcentralstripe() (in module simplestereo.active)": [[2, "simplestereo.active.findCentralStripe"]], "fromfile() (simplestereo._rigs.rectifiedstereorig class method)": [[2, "simplestereo._rigs.RectifiedStereoRig.fromFile"]], "fromfile() (simplestereo._rigs.stereorig class method)": [[2, "simplestereo._rigs.StereoRig.fromFile"]], "fromfile() (simplestereo._rigs.structuredlightrig method)": [[2, "simplestereo._rigs.StructuredLightRig.fromFile"]], "fusiellorectify() (in module simplestereo.rectification)": [[2, "simplestereo.rectification.fusielloRectify"]], "generatechessboardsvg() (in module simplestereo.calibration)": [[2, "simplestereo.calibration.generateChessboardSVG"]], "generategraycodeimgs() (in module simplestereo.active)": [[2, "simplestereo.active.generateGrayCodeImgs"]], "get() (simplestereo.utils.capture method)": [[2, "simplestereo.utils.Capture.get"]], "get3dpoints() (simplestereo._rigs.rectifiedstereorig method)": [[2, "simplestereo._rigs.RectifiedStereoRig.get3DPoints"]], "getadimensional3dpoints() (in module simplestereo.points)": [[2, "simplestereo.points.getAdimensional3DPoints"]], "getbaseline() (simplestereo._rigs.stereorig method)": [[2, "simplestereo._rigs.StereoRig.getBaseline"]], "getbestxshearingtransformation() (in module simplestereo.rectification)": [[2, "simplestereo.rectification.getBestXShearingTransformation"]], "getcenters() (simplestereo._rigs.stereorig method)": [[2, "simplestereo._rigs.StereoRig.getCenters"]], "getcloud() (simplestereo.active.graycode method)": [[2, "simplestereo.active.GrayCode.getCloud"]], "getcloud() (simplestereo.active.graycodedouble method)": [[2, "simplestereo.active.GrayCodeDouble.getCloud"]], "getcloud() (simplestereo.active.stereoftp method)": [[2, "simplestereo.active.StereoFTP.getCloud"]], "getcloud() (simplestereo.active.stereoftpanaglyph method)": [[2, "simplestereo.active.StereoFTPAnaglyph.getCloud"]], "getcloud() (simplestereo.active.stereoftp_mapping method)": [[2, "simplestereo.active.StereoFTP_Mapping.getCloud"]], "getcrossproductmatrix() (in module simplestereo.utils)": [[2, "simplestereo.utils.getCrossProductMatrix"]], "getessentialmatrix() (simplestereo._rigs.stereorig method)": [[2, "simplestereo._rigs.StereoRig.getEssentialMatrix"]], "getfittingmatrix() (in module simplestereo.rectification)": [[2, "simplestereo.rectification.getFittingMatrix"]], "getfundamentalmatrix() (simplestereo._rigs.stereorig method)": [[2, "simplestereo._rigs.StereoRig.getFundamentalMatrix"]], "getfundamentalmatrixfromprojections() (in module simplestereo.calibration)": [[2, "simplestereo.calibration.getFundamentalMatrixFromProjections"]], "getphase() (simplestereo.active.stereoftp_phaseonly method)": [[2, "simplestereo.active.StereoFTP_PhaseOnly.getPhase"]], "getprojectionmatrices() (simplestereo._rigs.stereorig method)": [[2, "simplestereo._rigs.StereoRig.getProjectionMatrices"]], "getrectifiedprojectionmatrices() (simplestereo._rigs.rectifiedstereorig method)": [[2, "simplestereo._rigs.RectifiedStereoRig.getRectifiedProjectionMatrices"]], "getresolution() (simplestereo.utils.capture method)": [[2, "simplestereo.utils.Capture.getResolution"]], "importply() (in module simplestereo.points)": [[2, "simplestereo.points.importPLY"]], "intrinsic1 (simplestereo._rigs.stereorig property)": [[2, "simplestereo._rigs.StereoRig.intrinsic1"]], "intrinsic2 (simplestereo._rigs.stereorig property)": [[2, "simplestereo._rigs.StereoRig.intrinsic2"]], "looprectify() (in module simplestereo.rectification)": [[2, "simplestereo.rectification.loopRectify"]], "module": [[2, "module-simplestereo"], [2, "module-simplestereo._rigs"], [2, "module-simplestereo.active"], [2, "module-simplestereo.calibration"], [2, "module-simplestereo.passive"], [2, "module-simplestereo.points"], [2, "module-simplestereo.rectification"], [2, "module-simplestereo.unwrapping"], [2, "module-simplestereo.utils"]], "moveextrinsicorigintofirstcamera() (in module simplestereo.utils)": [[2, "simplestereo.utils.moveExtrinsicOriginToFirstCamera"]], "phaseshift() (in module simplestereo.calibration)": [[2, "simplestereo.calibration.phaseShift"]], "phaseshiftwhite() (in module simplestereo.calibration)": [[2, "simplestereo.calibration.phaseShiftWhite"]], "recthomography1 (simplestereo._rigs.rectifiedstereorig property)": [[2, "simplestereo._rigs.RectifiedStereoRig.rectHomography1"]], "recthomography2 (simplestereo._rigs.rectifiedstereorig property)": [[2, "simplestereo._rigs.RectifiedStereoRig.rectHomography2"]], "rectifyimages() (simplestereo._rigs.rectifiedstereorig method)": [[2, "simplestereo._rigs.RectifiedStereoRig.rectifyImages"]], "save() (simplestereo._rigs.rectifiedstereorig method)": [[2, "simplestereo._rigs.RectifiedStereoRig.save"]], "save() (simplestereo._rigs.stereorig method)": [[2, "simplestereo._rigs.StereoRig.save"]], "setframerate() (simplestereo.utils.capture method)": [[2, "simplestereo.utils.Capture.setFrameRate"]], "setresolution() (simplestereo.utils.capture method)": [[2, "simplestereo.utils.Capture.setResolution"]], "simplestereo": [[2, "module-simplestereo"]], "simplestereo._rigs": [[2, "module-simplestereo._rigs"]], "simplestereo.active": [[2, "module-simplestereo.active"]], "simplestereo.calibration": [[2, "module-simplestereo.calibration"]], "simplestereo.passive": [[2, "module-simplestereo.passive"]], "simplestereo.points": [[2, "module-simplestereo.points"]], "simplestereo.rectification": [[2, "module-simplestereo.rectification"]], "simplestereo.unwrapping": [[2, "module-simplestereo.unwrapping"]], "simplestereo.utils": [[2, "module-simplestereo.utils"]], "start() (simplestereo.utils.capture method)": [[2, "simplestereo.utils.Capture.start"]], "stereorectify() (in module simplestereo.rectification)": [[2, "simplestereo.rectification.stereoRectify"]], "stop() (simplestereo.utils.capture method)": [[2, "simplestereo.utils.Capture.stop"]], "triangulate() (simplestereo._rigs.structuredlightrig method)": [[2, "simplestereo._rigs.StructuredLightRig.triangulate"]], "undistortcameraimage() (simplestereo._rigs.structuredlightrig method)": [[2, "simplestereo._rigs.StructuredLightRig.undistortCameraImage"]], "undistortimages() (simplestereo._rigs.stereorig method)": [[2, "simplestereo._rigs.StereoRig.undistortImages"]]}}) \ No newline at end of file diff --git a/docs/simplestereo.html b/docs/simplestereo.html index dbe20a9..e50193c 100644 --- a/docs/simplestereo.html +++ b/docs/simplestereo.html @@ -1,18 +1,17 @@ - - + - + simplestereo package — SimpleStereo 1 documentation - - - - - - + + + + + + @@ -41,23 +40,23 @@

Navigation

-

simplestereo package

+

simplestereo package

-

Module contents

+

Module contents

-

simplestereo

+

simplestereo

Module initialization.

Documentation DOCSTRING follows numpy-style wherever possible. See https://numpydoc.readthedocs.io/en/latest/format.html

-

Submodules

+

Submodules

-

simplestereo._rigs module

+

simplestereo._rigs module

-

_rigs

+

_rigs

Main classes loaded at package level.

See :py:module:`__init__.py`.

@@ -69,7 +68,7 @@

_rigs

-class simplestereo._rigs.RectifiedStereoRig(Rcommon, rectHomography1, rectHomography2, *args)[source]
+class simplestereo._rigs.RectifiedStereoRig(Rcommon, rectHomography1, rectHomography2, *args)[source]

Bases: StereoRig

Keep together and manage all parameters of a calibrated and rectified stereo rig.

It includes all the parameters of StereoRig plus two rectifying homographies. Differently from OpenCV, @@ -145,12 +144,12 @@

_rigs
-property Rcommon
+property Rcommon
-computeRectificationMaps(destDims=None, alpha=1)[source]
+computeRectificationMaps(destDims=None, alpha=1)[source]

Compute the two maps to undistort and rectify the stereo pair.

This method wraps cv2.initUndistortRectifyMap() plus a custom fitting algorithm to keep image within dimensions. It modifies the original camera matrix applying affine transformations (x-y scale and translation, shear (x axis only)) @@ -181,7 +180,7 @@

_rigs
-classmethod fromFile(filepath)[source]
+classmethod fromFile(filepath)[source]

Alternative initialization of StereoRigRectified object from JSON file.

Parameters:
@@ -198,7 +197,7 @@

_rigs
-get3DPoints(disparityMap)[source]
+get3DPoints(disparityMap)[source]

Get the 3D points in the space from the disparity map.

If the calibration was done with real world units (e.g. millimeters), the output would be in the same units. The world origin will be in the @@ -219,7 +218,7 @@

_rigs
-getRectifiedProjectionMatrices()[source]
+getRectifiedProjectionMatrices()[source]

Calculate the projection matrices of camera 1 and camera 2 after rectification.

New projection matrices, after rectification, share the same orientation Rcommon, have only one horizontal displacement (the baseline) and @@ -237,17 +236,17 @@

_rigs
-property rectHomography1
+property rectHomography1
-property rectHomography2
+property rectHomography2
-rectifyImages(img1, img2, interpolation=<MagicMock id='140581085517952'>)[source]
+rectifyImages(img1, img2, interpolation=<MagicMock id='140040679392848'>)[source]

Undistort, rectify and apply affine transformation to a couple of images coming from the stereo rig.

img1 and img2 must be provided as in calibration (es. img1 is the left image, img2 the right one). This method is wraps cv2.remap() for two images of the stereo pair. The maps used are computed by @@ -272,7 +271,7 @@

_rigs
-save(filepath)[source]
+save(filepath)[source]

Save configuration to JSON file.

Save the current stereo rig configuration to a JSON file that can be loaded later.

@@ -286,7 +285,7 @@

_rigs
-class simplestereo._rigs.StereoRig(res1, res2, intrinsic1, intrinsic2, distCoeffs1, distCoeffs2, R, T, F=None, E=None, reprojectionError=None)[source]
+class simplestereo._rigs.StereoRig(res1, res2, intrinsic1, intrinsic2, distCoeffs1, distCoeffs2, R, T, F=None, E=None, reprojectionError=None)[source]

Bases: object

Keep together and manage all parameters of a calibrated stereo rig.

The essential E and fundamental F matrices are optional as they are not always available. @@ -355,37 +354,37 @@

_rigs
-property E
+property E
-property F
+property F
-property R
+property R
-property T
+property T
-property distCoeffs1
+property distCoeffs1
-property distCoeffs2
+property distCoeffs2
-classmethod fromFile(filepath)[source]
+classmethod fromFile(filepath)[source]

Alternative initialization of StereoRig object from JSON file.

Parameters:
@@ -402,7 +401,7 @@

_rigs
-getBaseline()[source]
+getBaseline()[source]

Calculate the norm of the vector from camera 1 to camera 2.

Returns:
@@ -416,7 +415,7 @@

_rigs
-getCenters()[source]
+getCenters()[source]

Calculate camera centers in world coordinates.

Anyway first camera will always be centered in zero (returned anyway).

@@ -432,7 +431,7 @@

_rigs
-getEssentialMatrix()[source]
+getEssentialMatrix()[source]

Returns the essential matrix E.

If not set, E is computed from the fundamental matrix F and the camera matrices.

@@ -449,7 +448,7 @@

_rigs
-getFundamentalMatrix()[source]
+getFundamentalMatrix()[source]

Returns the fundamental matrix F.

If not set, F is computed from projection matrices using simplestereo.calibration.getFundamentalMatrixFromProjections().

@@ -467,7 +466,7 @@

_rigs
-getProjectionMatrices()[source]
+getProjectionMatrices()[source]

Calculate the projection matrices of camera 1 and camera 2.

Returns:
@@ -482,17 +481,17 @@

_rigs
-property intrinsic1
+property intrinsic1
-property intrinsic2
+property intrinsic2
-save(filepath)[source]
+save(filepath)[source]

Save configuration to JSON file.

Save the current stereo rig configuration to a JSON file that can be loaded later.

@@ -504,7 +503,7 @@

_rigs
-undistortImages(img1, img2, changeCameras=False, alpha=1, destDims=None, centerPrincipalPoint=False)[source]
+undistortImages(img1, img2, changeCameras=False, alpha=1, destDims=None, centerPrincipalPoint=False)[source]

Undistort two given images of the stereo rig.

This method wraps cv2.getOptimalNewCameraMatrix() followed by cv2.undistort() for both images. @@ -545,7 +544,7 @@

_rigs
-class simplestereo._rigs.StructuredLightRig(r)[source]
+class simplestereo._rigs.StructuredLightRig(r)[source]

Bases: StereoRig

StereoRig child class with structured light methods.

@@ -599,7 +598,7 @@

_rigs
-fromFile()[source]
+fromFile()[source]

Alternative initialization of StereoRig object from JSON file.

Parameters:
@@ -616,7 +615,7 @@

_rigs
-triangulate(camPoints, projPoints)[source]
+triangulate(camPoints, projPoints)[source]

Given camera-projector correspondences, proceed with triangulation.

@@ -638,7 +637,7 @@

_rigs
-undistortCameraImage(imgObj)[source]
+undistortCameraImage(imgObj)[source]

Undistort camera image.

Parameters:
@@ -654,9 +653,9 @@

_rigs

-

simplestereo.active module

+

simplestereo.active module

-

active

+

active

Contains classes to manage active stereo algorithms and helper functions. This module contains both conventional active stereo (2 cameras + @@ -664,7 +663,7 @@

active
-class simplestereo.active.GrayCode(rig, black_thr=40, white_thr=5)[source]
+class simplestereo.active.GrayCode(rig, black_thr=40, white_thr=5)[source]

Bases: object

Wrapper for the Gray code method from OpenCV.

Structured-light implementation using camera-projector @@ -702,7 +701,7 @@

active
-getCloud(images, roi=None)[source]
+getCloud(images, roi=None)[source]

Perform the 3D point calculation from a list of images.

Parameters:
@@ -733,7 +732,7 @@

active
-class simplestereo.active.GrayCodeDouble(rig, projRes, black_thr=40, white_thr=5)[source]
+class simplestereo.active.GrayCodeDouble(rig, projRes, black_thr=40, white_thr=5)[source]

Bases: object

Wrapper for the Gray code method from OpenCV.

Conventional active stereo implementation, i.e. using two calibrated cameras and @@ -771,7 +770,7 @@

active
-getCloud(images, roi1=None, roi2=None)[source]
+getCloud(images, roi1=None, roi2=None)[source]

Perform the 3D point calculation from a list of images.

Parameters:
@@ -801,13 +800,13 @@

active
-simplestereo.active.GrayCodeSingle
+simplestereo.active.GrayCodeSingle

alias of GrayCode

-class simplestereo.active.StereoFTP(stereoRig, fringe, period, shift=0, stripeColor='red', stripeSensitivity=0.5)[source]
+class simplestereo.active.StereoFTP(stereoRig, fringe, period, shift=0, stripeColor='red', stripeSensitivity=0.5)[source]

Bases: object

Manager of the Stereo Fourier Transform Profilometry.

@@ -844,7 +843,7 @@

active
-static convertGrayscale(img)[source]
+static convertGrayscale(img)[source]

Convert to grayscale using max.

This keeps highest BGR value over the central stripe (e.g. (0,0,255) -> 255), allowing the FFT to work properly.

@@ -872,7 +871,7 @@

active
-getCloud(imgObj, radius_factor=0.5, roi=None, unwrappingMethod=None, plot=False)[source]
+getCloud(imgObj, radius_factor=0.5, roi=None, unwrappingMethod=None, plot=False)[source]

Process an image and get the point cloud.

Parameters:
@@ -899,7 +898,7 @@

active
-class simplestereo.active.StereoFTPAnaglyph(stereoRig, fringe, period, shift=0, stripeColor='red', stripeSensitivity=0.5)[source]
+class simplestereo.active.StereoFTPAnaglyph(stereoRig, fringe, period, shift=0, stripeColor='red', stripeSensitivity=0.5)[source]

Bases: StereoFTP

Manager of the Stereo Fourier Transform Profilometry using an anaglyph pattern build with buildAnaglyphFringe().

@@ -934,7 +933,7 @@

active
-static convertGrayscale(img)[source]
+static convertGrayscale(img)[source]

Convert to grayscale using Guo et al., “Improved fourier transform profilometry for the automatic measurement of 3D object shapes”, 1990.

@@ -957,7 +956,7 @@

active
-getCloud(imgObj, radius_factor=0.5, roi=None, unwrappingMethod=None, plot=False)[source]
+getCloud(imgObj, radius_factor=0.5, roi=None, unwrappingMethod=None, plot=False)[source]

Process an anaglyph image and get the point cloud.

The pattern expected to be projected on the object is the one produced by :func:buildAnaglyphFringe.

@@ -986,7 +985,7 @@

active
-class simplestereo.active.StereoFTP_Mapping(stereoRig, fringe, period, shift=0, stripeColor='red', stripeSensitivity=0.5)[source]
+class simplestereo.active.StereoFTP_Mapping(stereoRig, fringe, period, shift=0, stripeColor='red', stripeSensitivity=0.5)[source]

Bases: StereoFTP

Manager of the classic Stereo Fourier Transform Profilometry.

Classic method (does not use a virtual reference plane) but it does @@ -1018,7 +1017,7 @@

active
-getCloud(imgObj, radius_factor=0.5, roi=None, unwrappingMethod=None, plot=False)[source]
+getCloud(imgObj, radius_factor=0.5, roi=None, unwrappingMethod=None, plot=False)[source]

Process an image and get the point cloud.

Parameters:
@@ -1045,7 +1044,7 @@

active
-class simplestereo.active.StereoFTP_PhaseOnly(stereoRig, fringe, period, shift=0, stripeColor='red', stripeSensitivity=0.5)[source]
+class simplestereo.active.StereoFTP_PhaseOnly(stereoRig, fringe, period, shift=0, stripeColor='red', stripeSensitivity=0.5)[source]

Bases: object

Manager of the Stereo Fourier Transform Profilometry.

@@ -1075,7 +1074,7 @@

active
-static convertGrayscale(img)[source]
+static convertGrayscale(img)[source]

Convert to grayscale using max.

This keeps highest BGR value over the central stripe (e.g. (0,0,255) -> 255), allowing the FFT to work properly.

@@ -1098,7 +1097,7 @@

active
-getPhase(imgObj, radius_factor=0.5, roi=None, plot=False)[source]
+getPhase(imgObj, radius_factor=0.5, roi=None, plot=False)[source]

Process an image and get the point cloud.

Parameters:
@@ -1123,7 +1122,7 @@

active
-simplestereo.active.buildAnaglyphFringe(period=10, shift=0, dims=(1280, 720), vertical=False, dtype=<MagicMock id='140581084609120'>)[source]
+simplestereo.active.buildAnaglyphFringe(period=10, shift=0, dims=(1280, 720), vertical=False, dtype=<MagicMock id='140040679619920'>)[source]

Build sinusoidal anaglyph fringe image.

Assumes BGR images, using blue and red as complementary colors and green as central stripe. This allows to actually extract three @@ -1152,7 +1151,7 @@

active
-simplestereo.active.buildBinaryFringe(period=10, shift=0, dims=(1280, 720), vertical=False, stripeColor=None, dtype=<MagicMock id='140581084546096'>)[source]
+simplestereo.active.buildBinaryFringe(period=10, shift=0, dims=(1280, 720), vertical=False, stripeColor=None, dtype=<MagicMock id='140040679614672'>)[source]

Build binary fringe image.

Parameters:
@@ -1181,7 +1180,7 @@

active
-simplestereo.active.buildFringe(period, shift=0, dims=(1280, 720), vertical=False, stripeColor=None, dtype=<MagicMock id='140581084574480'>)[source]
+simplestereo.active.buildFringe(period, shift=0, dims=(1280, 720), vertical=False, stripeColor=None, dtype=<MagicMock id='140040701967952'>)[source]

Build sinusoidal fringe image.

Parameters:
@@ -1209,7 +1208,7 @@

active
-simplestereo.active.computeROI(img, blackThreshold=10, extraMargin=0)[source]
+simplestereo.active.computeROI(img, blackThreshold=10, extraMargin=0)[source]

Exclude black regions along borders.

Usually the projector does not illuminate the whole image area. This function attempts to find the region of interest as a rectangle @@ -1235,7 +1234,7 @@

active
-simplestereo.active.findCentralStripe(image, color='r', sensitivity=0.5, interpolation='linear')[source]
+simplestereo.active.findCentralStripe(image, color='r', sensitivity=0.5, interpolation='linear')[source]

Find coordinates of a colored stripe in the image.

Search is done with subpixel accuracy only along the x-axis direction.

@@ -1266,7 +1265,7 @@

active
-simplestereo.active.generateGrayCodeImgs(targetDir, resolution)[source]
+simplestereo.active.generateGrayCodeImgs(targetDir, resolution)[source]

Generate Gray Codes and save it to PNG images.

Starts from the couple of images 0.png and 1.png (one is the inverse of the other). Then 2.png is coupled with 3.png and so on. @@ -1291,9 +1290,9 @@

active
-

simplestereo.calibration module

+

simplestereo.calibration module

-

calibration

+

calibration

Contains different calibration algorithms.

Todo

@@ -1302,7 +1301,7 @@

calibration
-simplestereo.calibration.chessboardProCam(images, projectorResolution, chessboardSize=(6, 7), squareSize=1, black_thr=40, white_thr=5, camIntrinsic=None, camDistCoeffs=None)[source]
+simplestereo.calibration.chessboardProCam(images, projectorResolution, chessboardSize=(6, 7), squareSize=1, black_thr=40, white_thr=5, camIntrinsic=None, camDistCoeffs=None)[source]

Performs stereo calibration between a camera (reference) and a projector.

Adapted from the code available (MIT licence) at https://github.com/kamino410/procam-calibration and based on the paper of Daniel Moreno and Gabriel Taubin, “Simple, accurate, and @@ -1324,8 +1323,8 @@

calibration
-simplestereo.calibration.chessboardProCamWhite(images, projectorResolution, chessboardSize=(6, 7), squareSize=1, black_thr=40, white_thr=5, camIntrinsic=None, camDistCoeffs=None, extended=False)[source]
+simplestereo.calibration.chessboardProCamWhite(images, projectorResolution, chessboardSize=(6, 7), squareSize=1, black_thr=40, white_thr=5, camIntrinsic=None, camDistCoeffs=None, extended=False)[source]

Performs stereo calibration between a camera (reference) and a projector.

Requires a chessboard with black top-left square. Adapted from the code available (MIT licence) at https://github.com/kamino410/procam-calibration @@ -1387,7 +1386,7 @@

calibration
-simplestereo.calibration.chessboardSingle(images, chessboardSize=(6, 7), squareSize=1, showImages=False)[source]
+simplestereo.calibration.chessboardSingle(images, chessboardSize=(6, 7), squareSize=1, showImages=False, distortionCoeffsNumber=5)[source]

Calibrate a single camera with a chessboard pattern.

Parameters:
@@ -1399,6 +1398,11 @@

calibrationOpenCV documentation. +Please note that this library uses only a small subset of the advanced calibration options found in OpenCV. +If set to 0 distortion correction is disabled (coefficients will be 0). +Default to 5 (basic radial and tangential distortion correction).

Returns:
@@ -1416,7 +1420,7 @@

calibration
-simplestereo.calibration.chessboardStereo(images, chessboardSize=(6, 7), squareSize=1)[source]
+simplestereo.calibration.chessboardStereo(images, chessboardSize=(6, 7), squareSize=1, distortionCoeffsNumber=5)[source]

Performs stereo calibration between two cameras and returns a StereoRig object.

First camera (generally left) will be put in world origin.

@@ -1427,8 +1431,13 @@

calibrationOpenCV documentation. +Please note that this library uses only a small subset of the advanced calibration options found in OpenCV. +If set to 0 distortion correction is disabled (coefficients will be 0). +Default to 5 (basic radial and tangential distortion correction).

Returns:
@@ -1443,7 +1452,7 @@

calibration
-simplestereo.calibration.generateChessboardSVG(chessboardSize, filepath, squareSize=20, border=10)[source]
+simplestereo.calibration.generateChessboardSVG(chessboardSize, filepath, squareSize=20, border=10)[source]

Write the desired chessboard to a SVG file.

chessboardSize is expressed as (columns, rows) tuple, counting internal line columns and rows as OpenCV does (e.g. to obtain a 10x7 chessboard, use (9,6)).

@@ -1460,7 +1469,7 @@

calibration
-simplestereo.calibration.getFundamentalMatrixFromProjections(P1, P2)[source]
+simplestereo.calibration.getFundamentalMatrixFromProjections(P1, P2)[source]

Compute the fundamental matrix from two projection matrices.

The algorithm is adapted from an original lesson of Cristina Turrini, UNIMI, Trento (09/04/2017).

@@ -1481,7 +1490,7 @@

calibration
-simplestereo.calibration.phaseShift(periods, projectorResolution, cameraImages, chessboardSize=(6, 7), squareSize=1, camIntrinsic=None, camDistCoeffs=None)[source]
+simplestereo.calibration.phaseShift(periods, projectorResolution, cameraImages, chessboardSize=(6, 7), squareSize=1, camIntrinsic=None, camDistCoeffs=None)[source]

Calibrate camera and projector using phase shifting and the heterodyne principle [Reich 1997].

@@ -1515,7 +1524,7 @@

calibration
-simplestereo.calibration.phaseShiftWhite(periods, projectorResolution, cameraImages, chessboardSize=(6, 7), squareSize=1, camIntrinsic=None, camDistCoeffs=None, extended=False)[source]
+simplestereo.calibration.phaseShiftWhite(periods, projectorResolution, cameraImages, chessboardSize=(6, 7), squareSize=1, camIntrinsic=None, camDistCoeffs=None, extended=False)[source]

Calibrate camera and projector using phase shifting and heterodyne principle [Reich 1997]. Using center of white squares instead of corners as targets.

@@ -1555,15 +1564,15 @@

calibration -

simplestereo.passive module

+

simplestereo.passive module

-

passive

+

passive

Contains different passive stereo algorithms to build disparity maps.

Simpler algorithms, like StereoBM and StereoSGBM, are already implemented in OpenCV.

-class simplestereo.passive.StereoASW(winSize=35, maxDisparity=16, minDisparity=0, gammaC=5, gammaP=17.5, consistent=False)[source]
+class simplestereo.passive.StereoASW(winSize=35, maxDisparity=16, minDisparity=0, gammaC=5, gammaP=17.5, consistent=False)[source]

Bases: object

Custom implementation of “Adaptive Support-Weight Approach for Correspondence Search”, K. Yoon, I. Kweon, 2006.

@@ -1610,7 +1619,7 @@

passive
-compute(img1, img2)[source]
+compute(img1, img2)[source]

Compute disparity map for BGR images.

Parameters:
@@ -1632,7 +1641,7 @@

passive
-class simplestereo.passive.StereoGSW(winSize=11, maxDisparity=16, minDisparity=0, gamma=10, fMax=120, iterations=3, bins=20)[source]
+class simplestereo.passive.StereoGSW(winSize=11, maxDisparity=16, minDisparity=0, gamma=10, fMax=120, iterations=3, bins=20)[source]

Bases: object

Incomplete implementation of “Local stereo matching using geodesic support weights”, Asmaa Hosni, Michael Bleyer, Margrit Gelautz and Christoph Rhemann (2009).

@@ -1666,7 +1675,7 @@

passive
-compute(img1, img2)[source]
+compute(img1, img2)[source]

Compute disparity map for 3-color channel images.

@@ -1674,14 +1683,14 @@

passive -

simplestereo.points module

+

simplestereo.points module

-

points

+

points

Functions to manage point clouds.

-simplestereo.points.distortPoints(points, distCoeff)[source]
+simplestereo.points.distortPoints(points, distCoeff)[source]

Undistort relative coordinate points.

Parameters:
@@ -1708,7 +1717,7 @@

points
-simplestereo.points.exportPLY(points3D, filepath, referenceImage=None, precision=6)[source]
+simplestereo.points.exportPLY(points3D, filepath, referenceImage=None, precision=6)[source]

Export raw point cloud to PLY file (ASCII).

Parameters:
@@ -1729,7 +1738,7 @@

points
-simplestereo.points.getAdimensional3DPoints(disparityMap)[source]
+simplestereo.points.getAdimensional3DPoints(disparityMap)[source]

Get adimensional 3D points from the disparity map.

This is the adimensional version of RectifiedStereoRig.get3DPoints(). @@ -1756,7 +1765,7 @@

points
-simplestereo.points.importPLY(filename, *properties)[source]
+simplestereo.points.importPLY(filename, *properties)[source]

Import 3D coordinates from PLY file.

Parameters:
@@ -1783,14 +1792,14 @@

points
-

simplestereo.rectification module

+

simplestereo.rectification module

-

rectification

+

rectification

Contains different rectification algorithms.

-simplestereo.rectification.fusielloRectify(rig)[source]
+simplestereo.rectification.fusielloRectify(rig)[source]

Computes the two rectifying homographies and returns a RectifiedStereoRig.

This method uses the algorithm illustrated in A compact algorithm for rectification of stereo pair, A. Fusiello et al., Machine Vision and Applications (2000).

@@ -1809,7 +1818,7 @@

rectification
-simplestereo.rectification.getBestXShearingTransformation(rectHomography, dims)[source]
+simplestereo.rectification.getBestXShearingTransformation(rectHomography, dims)[source]

Get best shear transformation (affine) over x axis that minimizes distortion.

Applying a shearing transformation over the x axis does not affect rectification and allows to reduce image distortion. @@ -1837,7 +1846,7 @@

rectification
-simplestereo.rectification.getFittingMatrix(intrinsicMatrix1, intrinsicMatrix2, H1, H2, dims1, dims2, distCoeffs1=None, distCoeffs2=None, destDims=None, alpha=1)[source]
+simplestereo.rectification.getFittingMatrix(intrinsicMatrix1, intrinsicMatrix2, H1, H2, dims1, dims2, distCoeffs1=None, distCoeffs2=None, destDims=None, alpha=1)[source]

Compute affine tranformation to fit the rectified images into desidered dimensions.

After rectification usually the image is no more into the original image bounds. One can apply any transformation that do not affect disparity to fit the image into boundaries. @@ -1872,7 +1881,7 @@

rectification
-simplestereo.rectification.loopRectify(rig)[source]
+simplestereo.rectification.loopRectify(rig)[source]

Computes the two rectifying homographies and returns a RectifiedStereoRig.

This method is an implementation of the algorithm illustrated in Computying rectifying homographies for stereo vision, CVPR 1999, Loop C. and Zhang Z. @@ -1898,7 +1907,7 @@

rectification
-simplestereo.rectification.stereoRectify(rig)[source]
+simplestereo.rectification.stereoRectify(rig)[source]

Rectify the StereoRig object using the standard OpenCV algorithm.

This function computes the new common camera orientation by averaging. It does not produce the rectifying homographies with minimal perspective distortion.

@@ -1917,21 +1926,21 @@

rectification -

simplestereo.unwrapping module

+

simplestereo.unwrapping module

-

phaseUnwrapping

+

phaseUnwrapping

Contains different phase unwrapping strategies.

-

simplestereo.utils module

+

simplestereo.utils module

-

utils

+

utils

This module provides general utilities.

-class simplestereo.utils.Capture(device=0, flipY=False)[source]
+class simplestereo.utils.Capture(device=0, flipY=False)[source]

Bases: object

Capture a video stream continuously.

Allows to capture a video stream in a separate thread and grab the current frame when needed, @@ -1982,20 +1991,20 @@

utils
-get()[source]
+get()[source]

Retrieve the current frame.

Returns None if there is no frame (e.g. end of video file).

-getResolution()[source]
+getResolution()[source]

Return current resolution as (width, height) tuple.

-setFrameRate(fps)[source]
+setFrameRate(fps)[source]

Set framerate of the camera.

Do not call this for video files or when the thread is running. It works only for supported cameras.

@@ -2014,7 +2023,7 @@

utils
-setResolution(width, height)[source]
+setResolution(width, height)[source]

Set resolution of the camera.

Do not call this for video files or when the thread is running. It works only for supported cameras.

@@ -2036,7 +2045,7 @@

utils
-start()[source]
+start()[source]

Start the capture in a separate thread.

No need to call this for video files. The thread continuously calls grab() to stay updated to the last frame, @@ -2045,7 +2054,7 @@

utils
-stop()[source]
+stop()[source]

Stop the capture.

When finished, remember to call this method to stop the capturing thread. No need to call this for video files.

@@ -2055,7 +2064,7 @@

utils
-simplestereo.utils.drawCorrespondingEpipolarLines(img1, img2, F, x1=[], x2=[], color=(0, 0, 255), thickness=1)[source]
+simplestereo.utils.drawCorrespondingEpipolarLines(img1, img2, F, x1=[], x2=[], color=(0, 0, 255), thickness=1)[source]

Draw epipolar lines passing by given coordinates in img1 or img1.

The epipolar lines can be drawn on the images, knowing the fundamental matrix. @@ -2086,7 +2095,7 @@

utils
-simplestereo.utils.getCrossProductMatrix(v)[source]
+simplestereo.utils.getCrossProductMatrix(v)[source]

Build the 3x3 antisymmetric matrix representing the cross product with v.

In literature this is often indicated as [v]x.

@@ -2104,7 +2113,7 @@

utils
-simplestereo.utils.moveExtrinsicOriginToFirstCamera(R1, R2, t1, t2)[source]
+simplestereo.utils.moveExtrinsicOriginToFirstCamera(R1, R2, t1, t2)[source]

Center extrinsic parameters world coordinate system into camera 1.

Compute R (rotation from camera 1 to camera 2) and T (translation from camera 1 to camera 2) as used in OpenCV from extrinsic of two cameras centered anywhere else. @@ -2335,8 +2344,8 @@

Navigation

\ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 6334551..f023898 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "SimpleStereo" -version = "1.0.6.1" +version = "1.0.7" authors = [ { name="decadenza" }, ] diff --git a/simplestereo/calibration.py b/simplestereo/calibration.py index ad22739..16adb61 100755 --- a/simplestereo/calibration.py +++ b/simplestereo/calibration.py @@ -83,7 +83,7 @@ def chessboardSingle(images, chessboardSize = DEFAULT_CHESSBOARD_SIZE, squareSiz cv2.waitKey(0) flags = _getCalibrationFlags(distortionCoeffsNumber) - + return cv2.calibrateCamera(objpoints, imgpoints, gray.shape[::-1], None, None, flags=flags, criteria=DEFAULT_TERMINATION_CRITERIA) @@ -204,7 +204,7 @@ def chessboardProCam(images, projectorResolution, chessboardSize = DEFAULT_CHESS required for valid pixels, between the graycode pattern and its inverse images. Default to 5. camIntrinsic : numpy.ndarray, optional A 3x3 matrix representing camera intrinsic parameters. If not given it will be calculated. - camIntrinsic : list, optional + camDistCoeffs : list, optional Camera distortion coefficients of 4, 5, 8, 12 or 14 elements (refer to OpenCV documentation). If not given they will be calculated. normalize : bool