]> rtime.felk.cvut.cz Git - opencv.git/commitdiff
Problems found by tool. Added GetRows deltaRow arg; SVD args fixed; FindHomography...
authorjamesb <jamesb@73c94f0f-984f-4a5f-82bc-2d8db8d8ee08>
Mon, 22 Mar 2010 20:27:46 +0000 (20:27 +0000)
committerjamesb <jamesb@73c94f0f-984f-4a5f-82bc-2d8db8d8ee08>
Mon, 22 Mar 2010 20:27:46 +0000 (20:27 +0000)
git-svn-id: https://code.ros.org/svn/opencv/trunk@2881 73c94f0f-984f-4a5f-82bc-2d8db8d8ee08

opencv/doc/cv_calibration_3d.tex
opencv/doc/cv_motion_tracking.tex
opencv/doc/cxcore_array_operations.tex
opencv/doc/latex2sphinx/latex.py

index babd203daf747257d40213b1904663c8bf0eec2f..a333d29c937584b15e272974461988835d23a1ac 100644 (file)
@@ -653,7 +653,7 @@ Finds the perspective transformation between two planes.
 
 \cvdefC{void cvFindHomography( \par const CvMat* srcPoints,\par const CvMat* dstPoints,\par CvMat* H \par
 int method=0, \par double ransacReprojThreshold=0, \par CvMat* status=NULL);}
-\cvdefPy{FindHomography(srcPoints,dstPoints,H,method,ransacReprojThreshold=0.0)-> H}
+\cvdefPy{FindHomography(srcPoints,dstPoints,H,method,ransacReprojThreshold=0.0, status=None)-> H}
 \cvdefCpp{Mat findHomography( const Mat\& srcPoints, const Mat\& dstPoints,\par
                     Mat\& status, int method=0,\par
                     double ransacReprojThreshold=0 );\newline
@@ -869,7 +869,7 @@ Returns the new camera matrix based on the free scaling parameter
     \par CvMat* newCameraMatrix,
     \par CvSize newImageSize=cvSize(0,0),
     \par CvRect* validPixROI=0 );}
-\cvdefPy{GetOptimalNewCameraMatrix(cameraMatrix, distCoeffs, imageSize, alpha, newImageSize=(0,0), validPixROI=0) -> None}
+\cvdefPy{GetOptimalNewCameraMatrix(cameraMatrix, distCoeffs, imageSize, alpha, newCameraMatrix, newImageSize=(0,0), validPixROI=0) -> None}
 \cvdefCpp{Mat getOptimalNewCameraMatrix(
     \par const Mat\& cameraMatrix, const Mat\& distCoeffs,
     \par Size imageSize, double alpha, Size newImageSize=Size(),
@@ -880,7 +880,7 @@ Returns the new camera matrix based on the free scaling parameter
 \cvarg{distCoeffs}{The input 4x1, 1x4, 5x1 or 1x5 vector of distortion coefficients $(k_1, k_2, p_1, p_2[, k_3])$}.
 \cvarg{imageSize}{The original image size}
 \cvarg{alpha}{The free scaling parameter between 0 (when all the pixels in the undistorted image will be valid) and 1 (when all the source image pixels will be retained in the undistorted image); see \cvCross{StereoRectify}{stereoRectify}}
-\cvC{\cvarg{newCameraMatrix}{The output new camera matrix.}}
+\cvarg{newCameraMatrix}{The output new camera matrix.}
 \cvarg{newImageSize}{The image size after rectification. By default it will be set to \texttt{imageSize}.}
 \cvarg{validPixROI}{The optional output rectangle that will outline all-good-pixels region in the undistorted image. See \texttt{roi1, roi2} description in \cvCross{StereoRectify}{stereoRectify}}
 \end{description}
@@ -895,7 +895,7 @@ Finds the initial camera matrix from the 3D-2D point correspondences
                                      \par const CvMat* npoints, CvSize imageSize,
                                      \par CvMat* cameraMatrix,
                                      \par double aspectRatio=1.);}                                     
-\cvdefPy{InitCameraMatrix2D( objectPoints, imagePoints, npoints, imageSize, cameraMatrix, aspectRatio=1.) -> None}
+\cvdefPy{InitIntrinsicParams2D(objectPoints, imagePoints, npoints, imageSize, cameraMatrix, aspectRatio=1.) -> None}
 \cvdefCpp{Mat initCameraMatrix2D( const vector<vector<Point3f> >\& objectPoints,\par
                         const vector<vector<Point2f> >\& imagePoints,\par
                         Size imageSize, double aspectRatio=1.);}
@@ -1357,7 +1357,7 @@ Computes rectification transforms for each head of a calibrated stereo camera.
                       \par CvMat* Q=0, int flags=CV\_CALIB\_ZERO\_DISPARITY,
                       \par double alpha=-1, CvSize newImageSize=cvSize(0,0),
                       \par CvRect* roi1=0, CvRect* roi2=0);}
-\cvdefPy{StereoRectify( cameraMatrix1, cameraMatrix2, distCoeffs1, distCoeffs2, imageSize, R, T, R1, R2, P1, P2, Q=NULL, flags=CV\_CALIB\_ZERO\_DISPARITY, alpha=-1, newImageSize=(0,0))-> None}
+\cvdefPy{StereoRectify( cameraMatrix1, cameraMatrix2, distCoeffs1, distCoeffs2, imageSize, R, T, R1, R2, P1, P2, Q=NULL, flags=CV\_CALIB\_ZERO\_DISPARITY, alpha=-1, newImageSize=(0,0))-> (roi1, roi2)}
 
 \cvdefCpp{void stereoRectify( const Mat\& cameraMatrix1, const Mat\& distCoeffs1,\par
                     const Mat\& cameraMatrix2, const Mat\& distCoeffs2,\par
index 984d463f1dbcb7b7e90a5593710f08c033bde287..fcdc29371d9acc16ee88b68d130e42c72a789f6b 100644 (file)
@@ -198,14 +198,19 @@ Finds the object center, size, and orientation.
 
 \cvdefC{
 int cvCamShift( \par const CvArr* prob\_image,\par CvRect window,\par CvTermCriteria criteria,\par CvConnectedComp* comp,\par CvBox2D* box=NULL );
-}\cvdefPy{CamShift(prob\_image,window,criteria,box=NULL)-> comp}
+}
+\cvdefPy{CamShift(prob\_image,window,criteria)-> (int, comp, box)}
 
 \begin{description}
 \cvarg{prob\_image}{Back projection of object histogram (see \cvCPyCross{CalcBackProject})}
 \cvarg{window}{Initial search window}
 \cvarg{criteria}{Criteria applied to determine when the window search should be finished}
 \cvarg{comp}{Resultant structure that contains the converged search window coordinates (\texttt{comp->rect} field) and the sum of all of the pixels inside the window (\texttt{comp->area} field)}
+\ifC % {
 \cvarg{box}{Circumscribed box for the object. If not \texttt{NULL}, it contains object size and orientation}
+\else % }{
+\cvarg{box}{Circumscribed box for the object.}
+\fi % }
 \end{description}
 
 The function implements the CAMSHIFT object tracking algrorithm
index 4b15e66e78e8dd4e2a17ec93b91d8b74377f4bc8..b5d2a36b5c0ee220721368a5b6bc24b6cb424573 100644 (file)
@@ -1564,12 +1564,13 @@ The function \texttt{GetRow} returns a single row from the input array.
 \cvCPyFunc{GetRows}
 Returns array row span.
 
-\cvdefPy{GetRows(arr,startRow,endRow)-> submat}
+\cvdefPy{GetRows(arr,startRow,endRow,deltaRow=1)-> submat}
 
 \begin{description}
 \cvarg{arr}{Input array}
 \cvarg{startRow}{Zero-based index of the starting row (inclusive) of the span}
 \cvarg{endRow}{Zero-based index of the ending row (exclusive) of the span}
+\cvarg{deltaRow}{Index step in the row span.}
 \cvarg{submat}{resulting multi-row array}
 \end{description}
 
@@ -3417,7 +3418,7 @@ the high-level counterparts (inv and solve).
 Performs singular value decomposition of a real floating-point matrix.
 
 \cvdefC{void cvSVD(\par CvArr* A, \par CvArr* W, \par CvArr* U=NULL, \par CvArr* V=NULL, \par int flags=0);}
-\cvdefPy{SVD(A,flags=0)-> (W,U,V)}
+\cvdefPy{SVD(A,W, U = None, V = None, flags=0)-> None}
 
 \begin{description}
 \cvarg{A}{Source $\texttt{M} \times \texttt{N}$ matrix}
index 64caa4ada90a1c26008f6d204f332b1cc23cc355..a551ee8af178d524c1e94dce59e579e044ca3676 100644 (file)
@@ -237,6 +237,24 @@ class SphinxWriter:
             if str(l[0]) != self.function_props['name']:
                 self.report_error(c, 'Decl "%s" does not match function name "%s"' % (str(l[0]), self.function_props['name']))
             self.function_props['signature'] = l
+            if l[0] in python_api:
+                (ins, outs) = python_api[l[0]]
+                ins = [a for a in ins if not 'O' in a.flags]
+                if outs != None:
+                    outs = outs.split(',')
+                if len(ins) != len(l[1]):
+                    self.report_error(c, "function %s documented arity %d, code arity %d" % (l[0], len(l[1]), len(ins)))
+                if outs == None:
+                    if l[2] != 'None':
+                        self.report_error(c, "function %s documented None, but code has %s" % (l[0], l[2]))
+                else:
+                    if isinstance(l[2], str):
+                        doc_outs = [l[2]]
+                    else:
+                        doc_outs = l[2]
+                    print doc_outs, len(doc_outs)
+                    if len(outs) != len(doc_outs):
+                        self.report_error(c, "function %s output documented tuple %d, code %d" % (l[0], len(outs), len(doc_outs)))
         except pp.ParseException, pe:
             self.report_error(c, str(pe))
             print s