]> rtime.felk.cvut.cz Git - opencv.git/commitdiff
Many fixes for Python function signatures
authorjamesb <jamesb@73c94f0f-984f-4a5f-82bc-2d8db8d8ee08>
Fri, 19 Mar 2010 00:54:46 +0000 (00:54 +0000)
committerjamesb <jamesb@73c94f0f-984f-4a5f-82bc-2d8db8d8ee08>
Fri, 19 Mar 2010 00:54:46 +0000 (00:54 +0000)
git-svn-id: https://code.ros.org/svn/opencv/trunk@2858 73c94f0f-984f-4a5f-82bc-2d8db8d8ee08

13 files changed:
opencv/doc/HighGui.tex
opencv/doc/cv_calibration_3d.tex
opencv/doc/cv_feature_detection.tex
opencv/doc/cv_histograms.tex
opencv/doc/cv_image_filtering.tex
opencv/doc/cv_image_transform.tex
opencv/doc/cv_image_warping.tex
opencv/doc/cv_motion_tracking.tex
opencv/doc/cv_planar_subdivisions.tex
opencv/doc/cv_struct_shape_analysis.tex
opencv/doc/cxcore_array_operations.tex
opencv/doc/cxcore_drawing_functions.tex
opencv/doc/latex2sphinx/latex.py

index 23b3c198cdd91b4861480389ea054203cd4e3a45..bf93cae15ce3e172e7e5d0b918e9707e7cb49f7f 100644 (file)
@@ -40,7 +40,7 @@ Creates a trackbar and attaches it to the specified window
 int cvCreateTrackbar( \par const char* trackbarName, \par const char* windowName,
                       \par int* value, \par int count, \par CvTrackbarCallback onChange );
 }
-\cvdefPy{CreateTrackbar(trackbarName, windowName, value, count, onChange)}
+\cvdefPy{CreateTrackbar(trackbarName, windowName, value, count, onChange) -> None}
 \begin{lstlisting}
 CV_EXTERN_C_FUNCPTR( void (*CvTrackbarCallback)(int pos) );
 \end{lstlisting}
@@ -288,7 +288,7 @@ Loads an image from a file.
 
 \cvdefC{
 IplImage* cvLoadImage( \par const char* filename, \par int iscolor=CV\_LOAD\_IMAGE\_COLOR );}
-\cvdefPy{LoadImage(filename, iscolor=CV\_LOAD\_IMAGE\_COLOR)}
+\cvdefPy{LoadImage(filename, iscolor=CV\_LOAD\_IMAGE\_COLOR)->None}
 
 \begin{lstlisting}
 #define CV_LOAD_IMAGE_COLOR       1
@@ -444,7 +444,7 @@ The function \texttt{cvRetrieveFrame} returns the pointer to the image grabbed w
 Sets video capturing properties.
 
 \cvdefC{int cvSetCaptureProperty( \par CvCapture* capture, \par int property\_id, \par double value );}
-\cvdefPy{SetCaptureProperty(capture, property\_id,double)}
+\cvdefPy{SetCaptureProperty(capture, property\_id,double)->None}
 
 \begin{description}
 \cvarg{capture}{video capturing structure.}
index e4f347a9ced43deddeb621aac9e56fd53e0a241d..2fd362d1ef58375fbe0aac791f5f05415411142b 100644 (file)
@@ -94,7 +94,8 @@ Calculates the homography matrix for an oblong planar object (e.g. arm).
 
 \cvdefC{
 void cvCalcImageHomography( \par float* line,\par CvPoint3D32f* center,\par float* intrinsic,\par float* homography );
-}\cvdefPy{CalcImageHomography(line,points)-> intrinsic,homography}
+}
+\cvdefPy{CalcImageHomography(line,points)-> (intrinsic,homography)}
 
 \begin{description}
 \cvarg{line}{the main object axis direction (vector (dx,dy,dz))}
@@ -110,7 +111,7 @@ in the OpenCV Guide 3D Reconstruction Chapter).
 
 \fi
 
-\cvFunc{CalibrateCamera2}{calibrateCamera}
+\cvfunc{CalibrateCamera2}{calibrateCamera}
 Finds the camera intrinsic and extrinsic parameters from several views of a calibration pattern.
 
 \cvdefC{double cvCalibrateCamera2( \par const CvMat* objectPoints,\par const CvMat* imagePoints,\par const CvMat* pointCounts,\par CvSize imageSize,\par CvMat* cameraMatrix,\par CvMat* distCoeffs,\par CvMat* rvecs=NULL,\par CvMat* tvecs=NULL,\par int flags=0 );}
@@ -247,7 +248,7 @@ The functions are used inside \cvCppCross{stereoCalibrate} but can also be used
 
 \fi
 
-\cvFunc{ComputeCorrespondEpilines}{computeCorrespondEpilines}
+\cvfunc{ComputeCorrespondEpilines}{computeCorrespondEpilines}
 For points in one image of a stereo pair, computes the corresponding epilines in the other image.
 
 \cvdefC{void cvComputeCorrespondEpilines( \par const CvMat* points,\par int whichImage,\par const CvMat* F, \par CvMat* lines);}
@@ -279,7 +280,7 @@ and, vice versa, when \texttt{whichImage=2}, $l^{(1)}_i$ is computed from $p^{(2
 Line coefficients are defined up to a scale. They are normalized, such that $a_i^2+b_i^2=1$.
 
 
-\cvFunc{ConvertPointsHomogeneous}{convertPointsHomogeneous}
+\cvfunc{ConvertPointsHomogeneous}{convertPointsHomogeneous}
 Convert points to/from homogeneous coordinates.
 
 \cvdefC{void cvConvertPointsHomogeneous( \par const CvMat* src,\par CvMat* dst );}
@@ -352,7 +353,8 @@ Creates block matching stereo correspondence structure.
 CvStereoBMState* cvCreateStereoBMState( int preset=CV\_STEREO\_BM\_BASIC,
                                         int numberOfDisparities=0 );
 
-}\cvdefPy{CreateStereoBMState(preset=CV\_STEREO\_BM\_BASIC,numberOfDisparities=0)-> StereoBMState}
+}
+\cvdefPy{CreateStereoBMState(preset=CV\_STEREO\_BM\_BASIC,numberOfDisparities=0)-> StereoBMState}
 
 \begin{description}
 \cvarg{preset}{ID of one of the pre-defined parameter sets. Any of the parameters can be overridden after creating the structure.}
@@ -369,7 +371,8 @@ Creates the state of graph cut-based stereo correspondence algorithm.
 CvStereoGCState* cvCreateStereoGCState( int numberOfDisparities,
                                         int maxIters );
 
-}\cvdefPy{CreateStereoGCState(numberOfDispaities,maxIters)-> StereoGCState}
+}
+\cvdefPy{CreateStereoGCState(numberOfDispaities,maxIters)-> StereoGCState}
 
 \begin{description}
 \cvarg{numberOfDisparities}{The number of disparities. The disparity search range will be $\texttt{state->minDisparity} \le disparity < \texttt{state->minDisparity} + \texttt{state->numberOfDisparities}$}
@@ -441,7 +444,7 @@ The graph cuts stereo correspondence algorithm, described in \href{\#Kolmogrov03
 
 \fi
 
-\cvFunc{DecomposeProjectionMatrix}{decomposeProjectionMatrix}
+\cvfunc{DecomposeProjectionMatrix}{decomposeProjectionMatrix}
 Decomposes the projection matrix into a rotation matrix and a camera matrix.
 
 \cvdefC{
@@ -475,7 +478,7 @@ It optionally returns three rotation matrices, one for each axis, and the three
 
 The function is based on \cvCross{RQDecomp3x3}{RQDecomp3x3}.
 
-\cvFunc{DrawChessboardCorners}{drawChessboardCorners}
+\cvfunc{DrawChessboardCorners}{drawChessboardCorners}
 Renders the detected chessboard corners.
 
 \cvdefC{
@@ -494,7 +497,7 @@ void cvDrawChessboardCorners( \par CvArr* image,\par CvSize patternSize,\par CvP
 
 The function draws the individual chessboard corners detected as red circles if the board was not found or as colored corners connected with lines if the board was found.
 
-\cvFunc{FindChessboardCorners}{findChessboardCorners}
+\cvfunc{FindChessboardCorners}{findChessboardCorners}
 Finds the positions of the internal corners of the chessboard.
 
 \cvdefC{int cvFindChessboardCorners( \par const void* image,\par CvSize patternSize,\par CvPoint2D32f* corners,\par int* cornerCount=NULL,\par int flags=CV\_CALIB\_CB\_ADAPTIVE\_THRESH );}
@@ -531,7 +534,7 @@ the function \cvCross{FindCornerSubPix}{cornerSubPix}.
 
 \textbf{Note:} the function requires some white space (like a square-thick border, the wider the better) around the board to make the detection more robust in various environment (otherwise if there is no border and the background is dark, the outer black squares could not be segmented properly and so the square grouping and ordering algorithm will fail).
 
-\cvFunc{FindExtrinsicCameraParams2}{solvePnP}
+\cvfunc{FindExtrinsicCameraParams2}{solvePnP}
 Finds the object pose from the 3D-2D point correspondences
 
 \cvdefC{void cvFindExtrinsicCameraParams2( \par const CvMat* objectPoints,\par const CvMat* imagePoints,\par const CvMat* cameraMatrix,\par const CvMat* distCoeffs,\par CvMat* rvec,\par CvMat* tvec );}
@@ -554,13 +557,13 @@ Finds the object pose from the 3D-2D point correspondences
 The function estimates the object pose given a set of object points, their corresponding image projections, as well as the camera matrix and the distortion coefficients. This function finds such a pose that minimizes reprojection error, i.e. the sum of squared distances between the observed projections \texttt{imagePoints} and the projected (using \cvCross{ProjectPoints2}{projectPoints}) \texttt{objectPoints}.
 
 
-\cvFunc{FindFundamentalMat}{findFundamentalMat}
+\cvfunc{FindFundamentalMat}{findFundamentalMat}
 Calculates the fundamental matrix from the corresponding points in two images.
 
 \cvdefC{
 int cvFindFundamentalMat( \par const CvMat* points1,\par const CvMat* points2,\par CvMat* fundamentalMatrix,\par int    method=CV\_FM\_RANSAC,\par double param1=1.,\par double param2=0.99,\par CvMat* status=NULL);
 }
-\cvdefPy{FindFundamentalMat(points1, points2, fundamentalMatrix, method=CV\_FM\_RANSAC, param1=1., double param2=0.99, status = None) -> None}
+\cvdefPy{FindFundamentalMat(points1, points2, fundamentalMatrix, method=CV\_FM\_RANSAC, param1=1., param2=0.99, status = None) -> None}
 \cvdefCpp{Mat findFundamentalMat( const Mat\& points1, const Mat\& points2,\par
                         vector<uchar>\& status, int method=FM\_RANSAC,\par
                         double param1=3., double param2=0.99 );\newline
@@ -641,7 +644,7 @@ Mat fundamental_matrix =
 \end{lstlisting}
 \fi
 
-\cvFunc{FindHomography}{findHomography}
+\cvfunc{FindHomography}{findHomography}
 Finds the perspective transformation between two planes.
 
 \cvdefC{void cvFindHomography( \par const CvMat* srcPoints,\par const CvMat* dstPoints,\par CvMat* H \par
@@ -755,7 +758,8 @@ void cvFindStereoCorrespondenceGC( \par const CvArr* left, \par const CvArr* rig
                                    \par CvStereoGCState* state,
                                    \par int useDisparityGuess = CV\_DEFAULT(0) );
 
-}\cvdefPy{FindStereoCorrespondenceGC(\par left,\par right,\par dispLeft,\par dispRight,\par state,\par useDisparityGuess=CV\_DEFAULT(0))-> None}
+}
+\cvdefPy{FindStereoCorrespondenceGC( left, right, dispLeft, dispRight, state, useDisparityGuess=(0))-> None}
 
 \begin{description}
 \cvarg{left}{The left single-channel, 8-bit image.}
@@ -852,7 +856,7 @@ By default, the undistortion functions in OpenCV (see \texttt{initUndistortRecti
 
 \fi
 
-\cvFunc{GetOptimalNewCameraMatrix}{getOptimalNewCameraMatrix}
+\cvfunc{GetOptimalNewCameraMatrix}{getOptimalNewCameraMatrix}
 Returns the new camera matrix based on the free scaling parameter
 
 \cvdefC{void cvGetOptimalNewCameraMatrix(
@@ -861,7 +865,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, newImgSize=cvSize(0,0), validPixROI=0)}
+\cvdefPy{GetOptimalNewCameraMatrix(cameraMatrix, distCoeffs, imageSize, alpha, newImgSize=(0,0), validPixROI=0) -> None}
 \cvdefCpp{Mat getOptimalNewCameraMatrix(
     \par const Mat\& cameraMatrix, const Mat\& distCoeffs,
     \par Size imageSize, double alpha, Size newImgSize=Size(),
@@ -879,7 +883,7 @@ Returns the new camera matrix based on the free scaling parameter
 
 The function computes \cvCpp{and returns} the optimal new camera matrix based on the free scaling parameter. By varying  this parameter the user may retrieve only sensible pixels \texttt{alpha=0}, keep all the original image pixels if there is valuable information in the corners \texttt{alpha=1}, or get something in between. When \texttt{alpha>0}, the undistortion result will likely have some black pixels corresponding to "virtual" pixels outside of the captured distorted image. The original camera matrix, distortion coefficients, the computed new camera matrix and the \text{newImageSize} should be passed to \cvCross{InitUndistortRectifyMap}{initUndistortRectifyMap} to produce the maps for \cvCross{Remap}{remap}.
 
-\cvFunc{InitIntrinsicParams2D}{initCameraMatrix2D}
+\cvfunc{InitIntrinsicParams2D}{initCameraMatrix2D}
 Finds the initial camera matrix from the 3D-2D point correspondences
 
 \cvdefC{void cvInitIntrinsicParams2D(\par const CvMat* objectPoints,
@@ -887,7 +891,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{InitCameraMatrix2D( 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.);}
@@ -910,7 +914,7 @@ The function estimates and returns the initial camera matrix for camera calibrat
 Currently, the function only supports planar calibration patterns, i.e. patterns where each object point has z-coordinate =0.
 
 \ifCPy
-\cvFunc{InitUndistortMap}
+\cvfunc{InitUndistortMap}
 Computes an undistortion map.
 
 \cvdefC{void cvInitUndistortMap( \par const CvMat* cameraMatrix,\par const CvMat* distCoeffs,\par CvArr* map1,\par CvArr* map2 );}
@@ -927,7 +931,7 @@ The function is a simplified variant of \cvCross{InitUndistortRectifyMap}{initUn
 
 \fi
 
-\cvFunc{InitUndistortRectifyMap}{initUndistortRectifyMap}
+\cvfunc{InitUndistortRectifyMap}{initUndistortRectifyMap}
 Computes the undistortion and rectification transformation map.
 
 \cvdefC{void cvInitUndistortRectifyMap( \par const CvMat* cameraMatrix,
@@ -1003,7 +1007,8 @@ Implements the POSIT algorithm.
 
 \cvdefC{
 void cvPOSIT( \par CvPOSITObject* posit\_object,\par CvPoint2D32f* imagePoints,\par double focal\_length,\par CvTermCriteria criteria,\par CvMatr32f rotationMatrix,\par CvVect32f translation\_vector );
-}\cvdefPy{POSIT(posit\_object,imagePoints,focal\_length,criteria)-> rotationMatrix,translation\_vector}
+}
+\cvdefPy{POSIT(posit\_object,imagePoints,focal\_length,criteria)-> (rotationMatrix,translation\_vector)}
 
 \begin{description}
 \cvarg{posit\_object}{Pointer to the object structure}
@@ -1020,7 +1025,7 @@ Difference norm between two projections is the maximal distance between correspo
 
 \fi
 
-\cvFunc{ProjectPoints2}{projectPoints}
+\cvfunc{ProjectPoints2}{projectPoints}
 Project 3D points on to an image plane.
 
 \cvdefC{void cvProjectPoints2( \par const CvMat* objectPoints,\par const CvMat* rvec,\par const CvMat* tvec,\par const CvMat* cameraMatrix,\par const CvMat* distCoeffs,\par CvMat* imagePoints,\par CvMat* dpdrot=NULL,\par CvMat* dpdt=NULL,\par CvMat* dpdf=NULL,\par CvMat* dpdc=NULL,\par CvMat* dpddist=NULL );}
@@ -1070,7 +1075,7 @@ current intrinsic and extrinsic parameters.
 Note, that by setting \texttt{rvec=tvec=(0,0,0)}, or by setting \texttt{cameraMatrix} to 3x3 identity matrix, or by passing zero distortion coefficients, you can get various useful partial cases of the function, i.e. you can compute the distorted coordinates for a sparse set of points, or apply a perspective transformation (and also compute the derivatives) in the ideal zero-distortion setup etc.
 
 
-\cvFunc{ReprojectImageTo3D}{reprojectImageTo3D}
+\cvfunc{ReprojectImageTo3D}{reprojectImageTo3D}
 Reprojects disparity image to 3D space.
 
 \cvdefC{void cvReprojectImageTo3D( const CvArr* disparityImage,\par
@@ -1100,7 +1105,7 @@ The function transforms 1-channel disparity map to 3-channel image representing
 The matrix \texttt{Q} can be arbitrary $4 \times 4$ matrix, e.g. the one computed by \cvCross{StereoRectify}{stereoRectify}. To reproject a sparse set of points {(x,y,d),...} to 3D space, use \cvCross{PerspectiveTransform}{perspectiveTransform}.
 
 
-\cvFunc{RQDecomp3x3}{RQDecomp3x3}
+\cvfunc{RQDecomp3x3}{RQDecomp3x3}
 Computes the 'RQ' decomposition of 3x3 matrices.
 
 \cvdefC{
@@ -1170,7 +1175,7 @@ The function releases the stereo correspondence structure and all the associated
 
 \fi
 
-\cvFunc{Rodrigues2}{Rodrigues}
+\cvfunc{Rodrigues2}{Rodrigues}
 Converts a rotation matrix to a rotation vector or vice versa.
 
 \cvdefC{int cvRodrigues2( \par const CvMat* src,\par CvMat* dst,\par CvMat* jacobian=0 );}
@@ -1248,7 +1253,7 @@ class StereoBM
 
 \fi
 
-\cvFunc{StereoCalibrate}{stereoCalibrate}
+\cvfunc{StereoCalibrate}{stereoCalibrate}
 Calibrates stereo camera.
 
 \cvdefC{double cvStereoCalibrate( \par const CvMat* objectPoints, \par const CvMat* imagePoints1,
@@ -1261,7 +1266,7 @@ Calibrates stereo camera.
                                \par CV\_TERMCRIT\_ITER+CV\_TERMCRIT\_EPS,30,1e-6),
                         \par int flags=CV\_CALIB\_FIX\_INTRINSIC );}
 
-\cvdefPy{StereoCalibrate(\par objectPoints,\par imagePoints1,\par imagePoints2,\par pointCounts,\par cameraMatrix1,\par distCoeffs1,\par cameraMatrix2,\par distCoeffs2,\par imageSize,\par R,\par T,\par E=NULL,\par F=NULL,\par term\_crit=cvTermCriteria(CV\_TERMCRIT\_ITER+CV\_TERMCRIT\_EPS,30,1e-6),\par flags=CV\_CALIB\_FIX\_INTRINSIC)-> None}
+\cvdefPy{StereoCalibrate( objectPoints, imagePoints1, imagePoints2, pointCounts, cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, imageSize, R, T, E=NULL, F=NULL, term\_crit=(CV\_TERMCRIT\_ITER+CV\_TERMCRIT\_EPS,30,1e-6), flags=CV\_CALIB\_FIX\_INTRINSIC)-> None}
 
 \cvdefCpp{double stereoCalibrate( const vector<vector<Point3f> >\& objectPoints,\par
                       const vector<vector<Point2f> >\& imagePoints1,\par
@@ -1336,7 +1341,7 @@ Similarly to \cvCross{CalibrateCamera2}{calibrateCamera}, the function minimizes
 The function returns the final value of the re-projection error.
 \fi
 
-\cvFunc{StereoRectify}{stereoRectify}
+\cvfunc{StereoRectify}{stereoRectify}
 Computes rectification transforms for each head of a calibrated stereo camera.
 
 \cvdefC{void cvStereoRectify( \par const CvMat* cameraMatrix1, const CvMat* cameraMatrix2,
@@ -1346,7 +1351,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(\par cameraMatrix1,\par cameraMatrix2,\par distCoeffs1,\par distCoeffs2,\par imageSize,\par R,\par T,\par R1,\par R2,\par P1,\par P2,\par Q=NULL,\par flags=CV\_CALIB\_ZERO\_DISPARITY,\par 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))-> None}
 
 \cvdefCpp{void stereoRectify( const Mat\& cameraMatrix1, const Mat\& distCoeffs1,\par
                     const Mat\& cameraMatrix2, const Mat\& distCoeffs2,\par
@@ -1428,7 +1433,7 @@ Below is the screenshot from \texttt{stereo\_calib.cpp} sample. Some red horizon
 \includegraphics[width=0.8\textwidth]{pics/stereo_undistort.jpg}
 
 
-\cvFunc{StereoRectifyUncalibrated}{stereoRectifyUncalibrated}
+\cvfunc{StereoRectifyUncalibrated}{stereoRectifyUncalibrated}
 Computes rectification transform for uncalibrated stereo camera.
 
 \cvdefC{void cvStereoRectifyUncalibrated( \par const CvMat* points1, \par const CvMat* points2,
@@ -1455,7 +1460,7 @@ The function computes the rectification transformations without knowing intrinsi
 Note that while the algorithm does not need to know the intrinsic parameters of the cameras, it heavily depends on the epipolar geometry. Therefore, if the camera lenses have significant distortion, it would better be corrected before computing the fundamental matrix and calling this function. For example, distortion coefficients can be estimated for each head of stereo camera separately by using \cvCross{CalibrateCamera2}{calibrateCamera} and then the images can be corrected using \cvCross{Undistort2}{undistort}, or just the point coordinates can be corrected with \cvCross{UndistortPoints}{undistortPoints}.
 
 
-\cvFunc{Undistort2}{undistort}
+\cvfunc{Undistort2}{undistort}
 Transforms an image to compensate for lens distortion.
 
 \cvdefC{void cvUndistort2( \par const CvArr* src,\par CvArr* dst,\par const CvMat* cameraMatrix,
@@ -1484,7 +1489,7 @@ The camera matrix and the distortion parameters can be determined using
 \cvCross{CalibrateCamera2}{calibrateCamera}. If the resolution of images is different from the used at the calibration stage, $f_x, f_y, c_x$ and $c_y$ need to be scaled accordingly, while the distortion coefficients remain the same.
 
 
-\cvFunc{UndistortPoints}{undistortPoints}
+\cvfunc{UndistortPoints}{undistortPoints}
 Computes the ideal point coordinates from the observed point coordinates.
 
 \cvdefC{void cvUndistortPoints( \par const CvMat* src, \par CvMat* dst,
index 7885ddb49e8bcbb4000a2500299c0a5bde262c98..d1c1aa38a1252686bf50e083ec9477d4bd05ddbb 100644 (file)
@@ -108,7 +108,8 @@ Extracts Speeded Up Robust Features from an image.
 
 \cvdefC{
 void cvExtractSURF( \par const CvArr* image,\par const CvArr* mask,\par CvSeq** keypoints,\par CvSeq** descriptors,\par CvMemStorage* storage,\par CvSURFParams params );
-}\cvdefPy{ExtractSURF(image,mask,storage,params)-> keypoints,descriptors}
+}
+\cvdefPy{ExtractSURF(image,mask,storage,params)-> (keypoints,descriptors)}
 
 \begin{description}
 \cvarg{image}{The input 8-bit grayscale image}
index 3cf0aa27e64a205067fe7a93625b14b5f2311568..673137a82acb6f88b6882c869fd81d008660913e 100644 (file)
@@ -62,7 +62,7 @@ The function calculates the back projection by comparing histograms of the sourc
 
 Each new image is measured and then converted into an \texttt{image} image array over a chosen ROI. Histograms are taken from this \texttt{image} image in an area covered by a "patch" with an anchor at center as shown in the picture below. The histogram is normalized using the parameter \texttt{norm\_factor} so that it may be compared with \texttt{hist}. The calculated histogram is compared to the model histogram; \texttt{hist} uses The function \texttt{cvCompareHist} with the comparison method=\texttt{method}). The resulting output is placed at the location corresponding to the patch anchor in the probability image \texttt{dst}. This process is repeated as the patch is slid over the ROI. Iterative histogram update by subtracting trailing pixels covered by the patch and adding newly covered pixels to the histogram can save a lot of operations, though it is not implemented yet.
 
-\cvfunc{Back Project Calculation by Patches}
+Back Project Calculation by Patches
 
 \includegraphics[width=0.5\textwidth]{pics/backprojectpatch.png}
 
@@ -71,7 +71,8 @@ Calculates the histogram of image(s).
 
 \cvdefC{
 void cvCalcHist( \par IplImage** image,\par CvHistogram* hist,\par int accumulate=0,\par const CvArr* mask=NULL );
-}\cvdefPy{CalcHist(image,hist,ccumulate=0,mask=NULL)-> None}
+}
+\cvdefPy{CalcHist(image,hist,accumulate=0,mask=NULL)-> None}
 
 \begin{description}
 \cvarg{image}{Source images (though you may pass CvMat** as well)}
@@ -300,6 +301,7 @@ via the function \cvCPyCross{SetHistBinRanges}. Though \cvCPyCross{CalcHist}
 and \cvCPyCross{CalcBackProject} may process 8-bit images without setting
 bin ranges, they assume thy are equally spaced in 0 to 255 bins.
 
+\ifC % {
 \cvCPyFunc{GetHistValue*D}
 Returns a pointer to the histogram bin.
 
@@ -321,7 +323,7 @@ Returns a pointer to the histogram bin.
 \end{description}
 
 The macros \texttt{GetHistValue} return a pointer to the specified bin of the 1D, 2D, 3D or N-D histogram. In the case of a sparse histogram the function creates a new bin and sets it to 0, unless it exists already.
-
+\fi % }
 
 \cvCPyFunc{GetMinMaxHistValue}
 Finds the minimum and maximum histogram bins.
@@ -329,7 +331,8 @@ Finds the minimum and maximum histogram bins.
 \cvdefC{
 void cvGetMinMaxHistValue( \par const CvHistogram* hist,\par float* min\_value,\par float* max\_value,\par int* min\_idx=NULL,\par int* max\_idx=NULL );
 
-}\cvdefPy{GetMinMaxHistValue(hist)-> min\_val,max\_val,min\_loc,max\_loc}
+}
+\cvdefPy{GetMinMaxHistValue(hist)-> (min\_val,max\_val,min\_loc,max\_loc)}
 
 \begin{description}
 \cvarg{hist}{Histogram}
@@ -438,7 +441,8 @@ Thresholds the histogram.
 
 \cvdefC{
 void cvThreshHist( CvHistogram* hist, double threshold );
-}\cvdefPy{ThreshHist(hist,threshold)-> None}
+}
+\cvdefPy{ThreshHist(hist,threshold)-> None}
 
 \begin{description}
 \cvarg{hist}{Pointer to the histogram}
index 02d05629a12e54ddeb93b56fa2489296872be2d2..b08d1df741fcce9776fc970f0edb594972b0c6f7 100644 (file)
@@ -16,7 +16,7 @@ void cvCopyMakeBorder(
 \par CvPoint offset,
 \par int bordertype,
 \par CvScalar value=cvScalarAll(0) );}
-\cvdefPy{CopyMakeBorder(src,dst,offset,bordrtype,value=cvScalarAll(0))-> None}
+\cvdefPy{CopyMakeBorder(src,dst,offset,bordrtype,value=(0,0,0,0))-> None}
 
 \begin{description}
 \cvarg{src}{The source image}
@@ -38,7 +38,7 @@ Creates a structuring element.
 
 \cvdefC{IplConvKernel* cvCreateStructuringElementEx(\par int cols,
  \par int rows, \par int anchorX, \par int anchorY, \par int shape, \par int* values=NULL );}
-\cvdefPy{CreateStructuringElementEx(cols,rows,anchorX,anchorY,shape,values={NULL,0})-> kernel}
+\cvdefPy{CreateStructuringElementEx(cols,rows,anchorX,anchorY,shape,values=None)-> kernel}
 
 \begin{description}
 \cvarg{cols}{Number of columns in the structuring element}
index 59456cff04eae7bfe261b6116dc683d7fe1de1fa..092582809beecb0bee30e39b920d3bb7e5311231 100644 (file)
@@ -304,7 +304,8 @@ Calculates the distance to the closest zero pixel for all non-zero pixels of the
 
 \cvdefC{
 void cvDistTransform( \par const CvArr* src,\par CvArr* dst,\par int distance\_type=CV\_DIST\_L2,\par int mask\_size=3,\par const float* mask=NULL,\par CvArr* labels=NULL );
-}\cvdefPy{DistTransform(src,dst,distance\_type=CV\_DIST\_L2,mask\_size=3,mask={NULL,0},labels=NULL)-> None}
+}
+\cvdefPy{DistTransform(src,dst,distance\_type=CV\_DIST\_L2,mask\_size=3,mask=None,labels=NULL)-> None}
 
 \begin{description}
 \cvarg{src}{8-bit, single-channel (binary) source image}
@@ -391,7 +392,8 @@ void cvFloodFill(\par CvArr* image,\par CvPoint seed\_point,\par CvScalar new\_v
                   CvScalar lo\_diff=cvScalarAll(0),\par CvScalar up\_diff=cvScalarAll(0),\par
                   CvConnectedComp* comp=NULL,\par int flags=4,\par CvArr* mask=NULL );
 
-}\cvdefPy{FloodFill(image,seed\_point,new\_val,lo\_diff=cvScalarAll(0),up\_diff=cvScalarAll(0),flags=4,mask=NULL)-> comp}
+}
+\cvdefPy{FloodFill(image,seed\_point,new\_val,lo\_diff=(0,0,0,0),up\_diff=(0,0,0,0),flags=4,mask=NULL)-> comp}
 
 \ifC
 \begin{lstlisting}
@@ -524,8 +526,7 @@ void cvPyrMeanShiftFiltering( \par const CvArr* src, \par CvArr* dst,
      \par double sp, \par double sr, \par int max\_level=1,
      \par CvTermCriteria termcrit=\par cvTermCriteria(CV\_TERMCRIT\_ITER+CV\_TERMCRIT\_EPS,5,1));
 
-}\cvdefPy{PyrMeanShiftFiltering(src,dst,sp,sr,max\_level=1,
-       termcrit=\par (CV\_TERMCRIT\_ITER+CV\_TERMCRIT\_EPS,5,1))-> None}
+}\cvdefPy{PyrMeanShiftFiltering(src,dst,sp,sr,max\_level=1,termcrit=(CV\_TERMCRIT\_ITER+CV\_TERMCRIT\_EPS,5,1))-> None}
 
 \begin{description}
 \cvarg{src}{The source 8-bit, 3-channel image.}
index ccae351f1ad4bdcb9b8c5b1a37f587363c28ed8a..8a1e7a959703d439b04d3cb4e38691556201c1ec 100644 (file)
@@ -293,7 +293,7 @@ void cvRemap(
 \par const CvArr* mapy,
 \par int flags=CV\_INTER\_LINEAR+CV\_WARP\_FILL\_OUTLIERS,
 \par CvScalar fillval=cvScalarAll(0) );}
-\cvdefPy{Remap(src,dst,mapx,mapy,flags=CV\_INNER\_LINEAR+CV\_WARP\_FILL\_OUTLIERS,fillval=cvScalarAll0))-> None}
+\cvdefPy{Remap(src,dst,mapx,mapy,flags=CV\_INNER\_LINEAR+CV\_WARP\_FILL\_OUTLIERS,fillval=(0,0,0,0))-> None}
 
 \begin{description}
 \cvarg{src}{Source image}
@@ -352,7 +352,7 @@ void cvWarpAffine(
 \par int flags=CV\_INTER\_LINEAR+CV\_WARP\_FILL\_OUTLIERS,
 \par CvScalar fillval=cvScalarAll(0) );
 }
-\cvdefPy{WarpAffine(src,dst,mapMatrix,flags=CV\_INTER\_LINEAR+CV\_WARP\_FILL\_OUTLIERS,fillval=cvScalarAll(0))-> None}
+\cvdefPy{WarpAffine(src,dst,mapMatrix,flags=CV\_INTER\_LINEAR+CV\_WARP\_FILL\_OUTLIERS,fillval=(0,0,0,0))-> None}
 
 \begin{description}
 \cvarg{src}{Source image}
@@ -413,9 +413,8 @@ void cvWarpPerspective(
 \par const CvMat* mapMatrix,
 \par int flags=CV\_INTER\_LINEAR+CV\_WARP\_FILL\_OUTLIERS,
 \par CvScalar fillval=cvScalarAll(0) );
-}\cvdefPy{WarpPerspective(src,dst,mapMatrix,flags=CV\_I
-NNER\_LINEAR+CV\_WARP\_FILL\_OUTLIERS,fillval=cvScalarAll(0
-))-> None}
+}
+\cvdefPy{WarpPerspective(src,dst,mapMatrix,flags=CV\_INNER\_LINEAR+CV\_WARP\_FILL\_OUTLIERS,fillval=(0,0,0,0))-> None}
 
 \begin{description}
 \cvarg{src}{Source image}
index 4a88a46149a22d4229e1793108e8d172b509719c..53cf81fb3cd81eac72caa1714e78aeebd74a302c 100644 (file)
@@ -142,8 +142,9 @@ Calculates the optical flow for a sparse feature set using the iterative Lucas-K
 
 \cvdefC{
 void cvCalcOpticalFlowPyrLK( \par const CvArr* prev,\par const CvArr* curr,\par CvArr* prevPyr,\par CvArr* currPyr,\par const CvPoint2D32f* prevFeatures,\par CvPoint2D32f* currFeatures,\par int count,\par CvSize winSize,\par int level,\par char* status,\par float* track\_error,\par CvTermCriteria criteria,\par int flags );
-}\cvdefPy{
-CalcOpticalFlowPyrLK(  prev, curr, prevPyr, currPyr, prevFeatures, CvSize winSize, int level, criteria, flags, guesses = None) -> (currFeatures, status, track\_error)
+}
+\cvdefPy{
+CalcOpticalFlowPyrLK(  prev, curr, prevPyr, currPyr, prevFeatures, winSize, level, criteria, flags, guesses = None) -> (currFeatures, status, track\_error)
 }
 
 \begin{description}
@@ -538,7 +539,7 @@ Estimates the subsequent model state.
 const CvMat* cvKalmanPredict( \par CvKalman* kalman, \par const CvMat* control=NULL );
 }
 \cvdefPy{
-cvKalmanPredict(kalman, control=None) -> cvmat
+KalmanPredict(kalman, control=None) -> cvmat
 }
 \begin{lstlisting}
 #define cvKalmanUpdateByTime cvKalmanPredict
@@ -601,7 +602,8 @@ Adds the product of two input images to the accumulator.
 
 \cvdefC{
 void cvMultiplyAcc( \par const CvArr* image1,\par const CvArr* image2,\par CvArr* acc,\par const CvArr* mask=NULL );
-}\cvdefPy{MulitplyAcc(image1,image2,acc,mask=NULL)-> None}
+}
+\cvdefPy{MultiplyAcc(image1,image2,acc,mask=NULL)-> None}
 
 \begin{description}
 \cvarg{image1}{First input image, 1- or 3-channel, 8-bit or 32-bit floating point (each channel of multi-channel image is processed independently)}
@@ -630,11 +632,11 @@ The function releases the structure \cvCPyCross{CvConDensation}) and frees all m
 
 \fi % }
 
+\ifC % {
+
 \cvCPyFunc{ReleaseKalman}
 Deallocates the Kalman filter structure.
 
-\ifC % {
-
 \cvdefC{
 void cvReleaseKalman( \par CvKalman** kalman );
 }
@@ -652,7 +654,8 @@ Updates the running average.
 
 \cvdefC{
 void cvRunningAvg( \par const CvArr* image,\par CvArr* acc,\par double alpha,\par const CvArr* mask=NULL );
-}\cvdefPy{RunningAvg(image,acc,alpha,mask=NULL)-> None}
+}
+\cvdefPy{RunningAvg(image,acc,alpha,mask=NULL)-> None}
 
 \begin{description}
 \cvarg{image}{Input image, 1- or 3-channel, 8-bit or 32-bit floating point (each channel of multi-channel image is processed independently)}
index fb9ed4c38013615ddc505b7c7544d9336838d9cb..2bfd20bba575421e905d54bd7909e8a33dba52c9 100644 (file)
@@ -93,16 +93,17 @@ typedef struct CvSubdiv2DPoint
 CvSubdiv2DPoint;
 \end{lstlisting}
 
-\begin{description}
-\cvarg{id}{This integer can be used to index auxillary data associated with each vertex of the planar subdivision }
-\end{description}
+\begin{itemize}
+\item[id] This integer can be used to index auxillary data associated with each vertex of the planar subdivision
+\end{itemize}
 
 \cvCPyFunc{CalcSubdivVoronoi2D}
 Calculates the coordinates of Voronoi diagram cells.
 
 \cvdefC{
 void cvCalcSubdivVoronoi2D( \par CvSubdiv2D* subdiv );
-}\cvdefPy{CalcSubdivVoronoi2D(subdiv)-> None}
+}
+\cvdefPy{CalcSubdivVoronoi2D(subdiv)-> None}
 
 \begin{description}
 \cvarg{subdiv}{Delaunay subdivision, in which all the points are already added}
@@ -172,7 +173,8 @@ Returns the edge destination.
 
 \cvdefC{
 CvSubdiv2DPoint* cvSubdiv2DEdgeDst( \par CvSubdiv2DEdge edge );
-}\cvdefPy{Subdiv2DEdgeDist(edge)-> point}
+}
+\cvdefPy{Subdiv2DEdgeDst(edge)-> point}
 
 \begin{description}
 \cvarg{edge}{Subdivision edge (not a quad-edge)}
@@ -301,4 +303,4 @@ CvSubdiv2DPoint*  cvSubdivDelaunay2DInsert( \par CvSubdiv2D* subdiv,\par CvPoint
 
 The function inserts a single point into a subdivision and modifies the subdivision topology appropriately. If a point with the same coordinates exists already, no new point is added. The function returns a pointer to the allocated point. No virtual point coordinates are calculated at this stage.
 
-\fi
\ No newline at end of file
+\fi
index e4e39cb4bd4c3cd017e2313f14990cbd9e82a07d..3ca2a84707eab1412f828b77aee0a44bb287687a 100644 (file)
@@ -25,8 +25,9 @@ Approximates polygonal curve(s) with the specified precision.
 
 \cvdefC{
 CvSeq* cvApproxPoly( \par const void* src\_seq,\par int header\_size,\par CvMemStorage* storage,\par int method,\par double parameter,\par int parameter2=0 );
-}\cvdefPy{
-ApproxPoly(src\_seq, storage, method, parameter=0, parameter2=0)
+}
+\cvdefPy{
+ApproxPoly(src\_seq, storage, method, parameter=0, parameter2=0) -> sequence
 }
 
 \begin{description}
@@ -213,7 +214,8 @@ Calculates the area of a whole contour or a contour section.
 
 \cvdefC{
 double cvContourArea( \par const CvArr* contour, \par CvSlice slice=CV\_WHOLE\_SEQ );
-}\cvdefPy{ContourAres(contour,slice=CV\_WHOLE\_SEQ)-> double}
+}
+\cvdefPy{ContourArea(contour,slice=CV\_WHOLE\_SEQ)-> double}
 
 \begin{description}
 \cvarg{contour}{Contour (sequence or array of vertices)}
@@ -375,7 +377,8 @@ Creates a hierarchical representation of a contour.
 
 \cvdefC{
 CvContourTree* cvCreateContourTree( \par const CvSeq* contour,\par CvMemStorage* storage,\par double threshold );
-}\cvdefPy{CreateCountourTree(contour,storage,threshold)-> contour\_tree}
+}
+\cvdefPy{CreateContourTree(contour,storage,threshold)-> contour\_tree}
 
 \begin{description}
 \cvarg{contour}{Input contour}
@@ -465,12 +468,13 @@ The function locates and retrieves the next contour in the image and returns a p
 
 \fi % }
 
-\cvCPyFunc{FitEllipse}
+\cvCPyFunc{FitEllipse2}
 Fits an ellipse around a set of 2D points.
 
 \cvdefC{
 CvBox2D cvFitEllipse2( \par const CvArr* points );
-}\cvdefPy{FitEllipse2(points)-> Box2D}
+}
+\cvdefPy{FitEllipse2(points)-> Box2D}
 
 \begin{description}
 \cvarg{points}{Sequence or array of points}
@@ -558,7 +562,7 @@ x_c=\frac{M_{10}}{M_{00}}, y_c=\frac{M_{01}}{M_{00}}
 Calculates the seven Hu invariants.
 
 \cvdefC{void cvGetHuMoments( const CvMoments* moments,CvHuMoments* hu );}
-\cvdefPy{cvGetHuMoments(moments) -> hu}
+\cvdefPy{GetHuMoments(moments) -> hu}
 
 \begin{description}
 \cvarg{moments}{The input moments, computed with \cvCPyCross{Moments}}
@@ -696,7 +700,7 @@ CvBox2D  cvMinAreaRect2( \par const CvArr* points,\par CvMemStorage* storage=NUL
 
 The function finds a circumscribed rectangle of the minimal area for a 2D point set by building a convex hull for the set and applying the rotating calipers technique to the hull.
 
-\cvfunc{Picture. Minimal-area bounding rectangle for contour}
+Picture. Minimal-area bounding rectangle for contour
 
 \includegraphics[width=0.5\textwidth]{pics/minareabox.png}
 
@@ -705,7 +709,8 @@ Finds the circumscribed circle of minimal area for a given 2D point set.
 
 \cvdefC{
 int cvMinEnclosingCircle( \par const CvArr* points,\par CvPoint2D32f* center,\par float* radius );
-}\cvdefPy{MinEnclosingCircle(points)-> int,center,radius}
+}
+\cvdefPy{MinEnclosingCircle(points)-> (int,center,radius)}
 
 \begin{description}
 \cvarg{points}{Sequence or array of 2D points}
index 95a274286ad943f8234aa218830ef4ee2648aaa4..e777b2a679ca1a7a8cd619487d438eed2b494ccf 100644 (file)
@@ -207,7 +207,7 @@ If the array is \texttt{IplImage} and COI is set, the function processes the sel
 Calculates average (mean) of array elements.
 
 \cvdefC{void cvAvgSdv(const CvArr* arr, CvScalar* mean, CvScalar* stdDev, const CvArr* mask=NULL);}
-\cvdefPy{AvgSdv(arr,mask=NULL)-> mean, stdDev}
+\cvdefPy{AvgSdv(arr,mask=NULL)-> (mean, stdDev)}
 
 \begin{description}
 \cvarg{arr}{The array}
@@ -318,7 +318,7 @@ Calculates the cubic root
 \end{description}
 
 
-The function calculates the cubic root of the argument, and normally it is faster than \texttt{pow(value,1./3)}. In addition, negative arguments are handled properly. Special values ($ \pm \infty $, NaN) are not handled.
+The function calculates the cubic root of the argument, and normally it is faster than \texttt{pow(value,1./3)}. In addition, negative arguments are handled properly. Special values ($\pm \infty $, NaN) are not handled.
 
 \cvCPyFunc{ClearND}
 Clears a specific array element.
@@ -550,7 +550,7 @@ In the case of \texttt{IplImage} both ROI and COI are supported.
 Allocates array data
 
 \cvdefC{void cvCreateData(CvArr* arr);}
-\cvdefPy{CreateData(arr)}
+\cvdefPy{CreateData(arr) -> None}
 
 \begin{description}
 \cvarg{arr}{Array header}
@@ -643,7 +643,7 @@ The function allocates a new matrix header and returns a pointer to it. The matr
 Creates the header and allocates the data for a multi-dimensional dense array.
 
 \cvdefC{CvMatND* cvCreateMatND(\par int dims,\par const int* sizes,\par int type);}
-\cvdefPy{CreateMatND(dims, type)}
+\cvdefPy{CreateMatND(dims, type) -> None}
 
 \begin{description}
 \ifPy
@@ -666,7 +666,7 @@ cvCreateData(mat);
 Creates a new matrix header but does not allocate the matrix data.
 
 \cvdefC{CvMatND* cvCreateMatNDHeader(\par int dims,\par const int* sizes,\par int type);}
-\cvdefPy{CreateMatNDHeader(dims, type)}
+\cvdefPy{CreateMatNDHeader(dims, type) -> None}
 
 \begin{description}
 \ifPy
@@ -1190,6 +1190,7 @@ Return a specific array element.  The length of array indices must be the same a
 
 \fi % }
 
+\ifC % {
 \cvCPyFunc{GetCol(s)}
 Returns array column or column span.
 
@@ -1212,6 +1213,37 @@ The functions \texttt{GetCol} and \texttt{GetCols} return the header, correspond
 cvGetCol(arr, submat, col); // ~ cvGetCols(arr, submat, col, col + 1);
 \end{lstlisting}
 
+\else % }{
+
+\cvCPyFunc{GetCol}
+Returns array column.
+
+\cvdefPy{GetCol(arr,col)-> submat}
+
+\begin{description}
+\cvarg{arr}{Input array}
+\cvarg{col}{Zero-based index of the selected column}
+\cvarg{submat}{resulting single-column array}
+\end{description}
+
+The function \texttt{GetCol} returns a single column from the input array.
+
+\cvCPyFunc{GetCols}
+Returns array column span.
+
+\cvdefPy{GetCols(arr,startCol,endCol)-> submat}
+
+\begin{description}
+\cvarg{arr}{Input array}
+\cvarg{startCol}{Zero-based index of the starting column (inclusive) of the span}
+\cvarg{endCol}{Zero-based index of the ending column (exclusive) of the span}
+\cvarg{submat}{resulting multi-column array}
+\end{description}
+
+The function \texttt{GetCols} returns a column span from the input array.
+
+\fi % }
+
 \cvCPyFunc{GetDiag}
 Returns one of array diagonals.
 
@@ -1487,6 +1519,7 @@ In the case of a sparse array the functions return 0 if the requested node does
 
 \fi
 
+\ifC %{
 \cvCPyFunc{GetRow(s)}
 Returns array row or row span.
 
@@ -1510,6 +1543,36 @@ The functions return the header, corresponding to a specified row/row span of th
 cvGetRow(arr, submat, row ) ~ cvGetRows(arr, submat, row, row + 1, 1);
 \end{lstlisting}
 
+\else % }{
+
+\cvCPyFunc{GetRow}
+Returns array row.
+
+\cvdefPy{GetRow(arr,row)-> submat}
+
+\begin{description}
+\cvarg{arr}{Input array}
+\cvarg{row}{Zero-based index of the selected row}
+\cvarg{submat}{resulting single-row array}
+\end{description}
+
+The function \texttt{GetRow} returns a single row from the input array.
+
+\cvCPyFunc{GetRows}
+Returns array row span.
+
+\cvdefPy{GetRows(arr,startRow,endRow)-> 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{submat}{resulting multi-row array}
+\end{description}
+
+The function \texttt{GetRows} returns a row span from the input array.
+
+\fi % }
 
 \cvCPyFunc{GetSize}
 Returns size of matrix or image ROI.
@@ -1720,7 +1783,7 @@ Calculates the inverse square root.
 \end{description}
 
 
-The function calculates the inverse square root of the argument, and normally it is faster than \texttt{1./sqrt(value)}. If the argument is zero or negative, the result is not determined. Special values ($ \pm \infty $ , NaN) are not handled.
+The function calculates the inverse square root of the argument, and normally it is faster than \texttt{1./sqrt(value)}. If the argument is zero or negative, the result is not determined. Special values ($\pm \infty $ , NaN) are not handled.
 
 \cvCPyFunc{Invert}
 Finds the inverse or pseudo-inverse of a matrix.
@@ -1759,7 +1822,7 @@ Determines if the argument is Infinity.
 \cvarg{value}{The input floating-point value}
 \end{description}
 
-The function returns 1 if the argument is $ \pm \infty $ (as defined by IEEE754 standard), 0 otherwise.
+The function returns 1 if the argument is $\pm \infty $ (as defined by IEEE754 standard), 0 otherwise.
 
 \cvCPyFunc{IsNaN}
 Determines if the argument is Not A Number.
@@ -1954,7 +2017,7 @@ Finds global minimum and maximum in array or subarray.
 
 \cvdefC{void cvMinMaxLoc(const CvArr* arr, double* minVal, double* maxVal,
                   CvPoint* minLoc=NULL, CvPoint* maxLoc=NULL, const CvArr* mask=NULL);}
-\cvdefPy{MinMaxLoc(arr,mask=NULL)-> minVal,maxVal,minLoc,maxLoc}
+\cvdefPy{MinMaxLoc(arr,mask=NULL)-> (minVal,maxVal,minLoc,maxLoc)}
 
 \begin{description}
 \cvarg{arr}{The source array, single-channel or multi-channel with COI set}
@@ -2085,7 +2148,7 @@ For types that have limited range this operation is saturating.
 Performs per-element multiplication of two Fourier spectrums.
 
 \cvdefC{void cvMulSpectrums(\par const CvArr* src1,\par const CvArr* src2,\par CvArr* dst,\par int flags);}
-\cvdefPy{MulSpectrums(src1,src2,dst,flags)-> None)}
+\cvdefPy{MulSpectrums(src1,src2,dst,flags)-> None}
 
 \begin{description}
 \cvarg{src1}{The first source array}
@@ -2136,7 +2199,7 @@ otherwise.
 Calculates absolute array norm, absolute difference norm, or relative difference norm.
 
 \cvdefC{double cvNorm(const CvArr* arr1, const CvArr* arr2=NULL, int normType=CV\_L2, const CvArr* mask=NULL);}
-\cvdefPy{Norm(arr1,arr2,normType+CV\_L2,mask=NULL)-> double}
+\cvdefPy{Norm(arr1,arr2,normType=CV\_L2,mask=NULL)-> double}
 
 \begin{description}
 \cvarg{arr1}{The first source image}
@@ -2751,11 +2814,8 @@ row = (CvMat*)cvReshapeND(mat, &row_header, 0, 1, 0);
 \fi
 
 \ifC
-\subsection{cvRound, cvFloor, cvCeil}\label{cvRound}
-\fi
-\ifPy
-\subsection{cv.Round, cv.Floor, cv.Ceil}\label{cv.Round}
-\fi
+\cvfunc{cvRound, cvFloor, cvCeil}\label{cvRound}
+
 Converts a floating-point number to an integer.
 
 \cvdefC{
@@ -2777,18 +2837,64 @@ larger than the argument. \texttt{Ceil} returns the minimum integer
 value that is not smaller than the argument. On some architectures the
 functions work much faster than the standard cast
 operations in C. If the absolute value of the argument is greater than
-$2^{31}$, the result is not determined. Special values ($ \pm \infty$ , NaN)
+$2^{31}$, the result is not determined. Special values ($\pm \infty$ , NaN)
+are not handled.
+
+\else
+
+\cvfunc{Round}
+
+Converts a floating-point number to the nearest integer value.
+
+\cvdefPy{Round(value) -> int}
+
+\begin{description}
+\cvarg{value}{The input floating-point value}
+\end{description}
+
+On some architectures this function is much faster than the standard cast
+operations. If the absolute value of the argument is greater than
+$2^{31}$, the result is not determined. Special values ($\pm \infty$ , NaN)
+are not handled.
+
+\cvfunc{Floor}
+
+Converts a floating-point number to the nearest integer value that is not larger than the argument.
+
+\cvdefPy{Floor(value) -> int}
+
+\begin{description}
+\cvarg{value}{The input floating-point value}
+\end{description}
+
+On some architectures this function is much faster than the standard cast
+operations. If the absolute value of the argument is greater than
+$2^{31}$, the result is not determined. Special values ($\pm \infty$ , NaN)
 are not handled.
 
+\cvfunc{Ceil}
+
+Converts a floating-point number to the nearest integer value that is not smaller than the argument.
+
+\cvdefPy{Ceil(value) -> int}
+
+\begin{description}
+\cvarg{value}{The input floating-point value}
+\end{description}
+
+On some architectures this function is much faster than the standard cast
+operations. If the absolute value of the argument is greater than
+$2^{31}$, the result is not determined. Special values ($\pm \infty$ , NaN)
+are not handled.
+
+\fi
+
 
 \cvCPyFunc{ScaleAdd}
 Calculates the sum of a scaled array and another array.
 
 \cvdefC{void cvScaleAdd(const CvArr* src1, CvScalar scale, const CvArr* src2, CvArr* dst);}
 \cvdefPy{ScaleAdd(src1,sclae,src2,dst)-> None}
-\begin{lstlisting}
-#define cvMulAddS cvScaleAdd
-\end{lstlisting}
 
 \begin{description}
 \cvarg{src1}{The first source array}
@@ -2797,6 +2903,10 @@ Calculates the sum of a scaled array and another array.
 \cvarg{dst}{The destination array}
 \end{description}
 
+\begin{lstlisting}
+#define cvMulAddS cvScaleAdd
+\end{lstlisting}
+
 The function calculates the sum of a scaled array and another array:
 
 \[
@@ -2861,7 +2971,7 @@ Set a specific array element.
 \cvarg{value}{The value to assign to the element}
 \end{description}
 
-Sets a specific array element.  Array must have dimension 3.
+Sets a specific array element.  Array must have dimension 1.
 
 \cvCPyFunc{Set2D}
 Set a specific array element.
@@ -2924,7 +3034,7 @@ The function assigns user data to the array header. Header should be initialized
 Initializes a scaled identity matrix.
 
 \cvdefC{void cvSetIdentity(CvArr* mat, CvScalar value=cvRealScalar(1));}
-\cvdefPy{SetIdentity(mat,value=cvRealScalar(1))-> None}
+\cvdefPy{SetIdentity(mat,value=1)-> None}
 
 \begin{description}
 \cvarg{arr}{The matrix to initialize (not necesserily square)}
@@ -2970,6 +3080,7 @@ If the original image ROI was \texttt{NULL} and the \texttt{rect} is not the who
 
 Most OpenCV functions support the use of ROI and treat the image rectangle as a separate image. For example, all of the pixel coordinates are counted from the top-left (or bottom-left) corner of the ROI, not the original image.
 
+\if % {
 \cvCPyFunc{SetReal?D}
 Change a specific array element.
 
@@ -2997,6 +3108,64 @@ are a bit slower.
 
 In the case of a sparse array the functions create the node if it does not yet exist.
 
+\else % }{
+
+\cvCPyFunc{SetReal1D}
+Set a specific array element.
+
+\cvdefPy{ SetReal1D(arr, idx, value) -> None }
+
+\begin{description}
+\cvarg{arr}{Input array}
+\cvarg{idx}{Zero-based element index}
+\cvarg{value}{The value to assign to the element}
+\end{description}
+
+Sets a specific array element.  Array must have dimension 1.
+
+\cvCPyFunc{SetReal2D}
+Set a specific array element.
+
+\cvdefPy{ SetReal2D(arr, idx0, idx1, value) -> None }
+
+\begin{description}
+\cvarg{arr}{Input array}
+\cvarg{idx0}{Zero-based element row index}
+\cvarg{idx1}{Zero-based element column index}
+\cvarg{value}{The value to assign to the element}
+\end{description}
+
+Sets a specific array element.  Array must have dimension 2.
+
+\cvCPyFunc{SetReal3D}
+Set a specific array element.
+
+\cvdefPy{ SetReal3D(arr, idx0, idx1, idx2, value) -> None }
+
+\begin{description}
+\cvarg{arr}{Input array}
+\cvarg{idx0}{Zero-based element index}
+\cvarg{idx1}{Zero-based element index}
+\cvarg{idx2}{Zero-based element index}
+\cvarg{value}{The value to assign to the element}
+\end{description}
+
+Sets a specific array element.  Array must have dimension 3.
+
+\cvCPyFunc{SetRealND}
+Set a specific array element.
+
+\cvdefPy{ SetRealND(arr, indices, value) -> None }
+
+\begin{description}
+\cvarg{arr}{Input array}
+\cvarg{indices}{List of zero-based element indices}
+\cvarg{value}{The value to assign to the element}
+\end{description}
+
+Sets a specific array element.  The length of array indices must be the same as the dimension of the array.
+\fi % }
+
 \cvCPyFunc{SetZero}
 Clears the array.
 
@@ -3239,7 +3408,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,flags=0)-> (W,U,V)}
 
 \begin{description}
 \cvarg{A}{Source $\texttt{M} \times \texttt{N}$ matrix}
@@ -3782,7 +3951,7 @@ bool checkRange(const MatND\& src, bool quiet=true, int* pos=0,\par
 \end{description}
 
 The functions \texttt{checkRange} check that every array element is
-neither NaN nor $ \pm \infty $. When \texttt{minVal < -DBL\_MAX} and \texttt{maxVal < DBL\_MAX}, then the functions also check that
+neither NaN nor $\pm \infty $. When \texttt{minVal < -DBL\_MAX} and \texttt{maxVal < DBL\_MAX}, then the functions also check that
 each value is between \texttt{minVal} and \texttt{maxVal}. in the case of multi-channel arrays each channel is processed independently.
 If some values are out of range, position of the first outlier is stored in \texttt{pos} (when $\texttt{pos}\ne0$), and then the functions either return false (when \texttt{quiet=true}) or throw an exception.
 
index a73422360bd5062099615034b9cbf73e44ce86a3..0e4fb3f1471ff5fd36a2a8f29f3a78c5c73c6005 100644 (file)
@@ -64,7 +64,7 @@ Draws contour outlines or interiors in an image.
 \cvdefC{
 void cvDrawContours( \par CvArr *img,\par CvSeq* contour,\par CvScalar external\_color,\par CvScalar hole\_color,\par int max\_level,\par int thickness=1,\par int lineType=8 );
 }
-\cvdefPy{DrawContours(img,contour,external\_color,hole\_color,max\_level,thickness=1,lineType=8,offset=(0,0)-> None}
+\cvdefPy{DrawContours(img,contour,external\_color,hole\_color,max\_level,thickness=1,lineType=8,offset=(0,0))-> None}
 
 \begin{description}
 \cvarg{img}{Image where the contours are to be drawn. As with any other drawing function, the contours are clipped with the ROI.}
@@ -229,7 +229,7 @@ Retrieves the width and height of a text string.
 
 \cvdefC{
 void cvGetTextSize( \par const char* textString,\par const CvFont* font,\par CvSize* textSize,\par int* baseline );}
-\cvdefPy{GetTextSize(textString,font)-> textSize,baseline}
+\cvdefPy{GetTextSize(textString,font)-> (textSize,baseline)}
 
 \begin{description}
 \cvarg{font}{Pointer to the font structure}
@@ -277,7 +277,7 @@ Initializes the line iterator.
 \cvdefC{
 int cvInitLineIterator( \par const CvArr* image,\par CvPoint pt1,\par CvPoint pt2,\par CvLineIterator* line\_iterator,\par int connectivity=8,\par int left\_to\_right=0 );
 }
-\cvdefPy{InitLineIterator(image, pt1, pt2, connectivity=8, left\_to\_right=0)}
+\cvdefPy{InitLineIterator(image, pt1, pt2, connectivity=8, left\_to\_right=0) -> None}
 
 \begin{description}
 \cvarg{image}{Image to sample the line from}
@@ -770,4 +770,4 @@ The function \texttt{putText} draws a text string in the image.
 Symbols that can not be rendered using the specified font are
 replaced question marks. See \cvCppCross{getTextSize} for a text rendering code example.
 
-\fi
\ No newline at end of file
+\fi
index 113c4691df9974ac135cc0ff0422e6f5f5aa4320..30031baf7810000cff7b997b3c346632b57d5388 100644 (file)
@@ -82,7 +82,7 @@ class SphinxWriter:
             self.write(' ')
 
     def doplain(self, s):
-        if (len(s) > 1) and (s[0] == '$' and s[-1] == '$'):
+        if (len(s) > 1) and (s[0] == '$' and s[-1] == '$') and self.state != 'math':
             s = ":math:`%s`" % s[1:-1]
         elif self.state != 'math':
             s.replace('\\_', '_')
@@ -158,6 +158,9 @@ class SphinxWriter:
     def cmd_cvCPyCross(self, c):
         self.write(":ref:`%s`" % str(c.params[0]))
 
+    def cmd_cvfunc(self, c):
+        self.cmd_cvCPyFunc(c)
+
     def cmd_cvCPyFunc(self, c):
         self.indent = 0
         nm = self.render(c.params[0].str)
@@ -182,6 +185,22 @@ class SphinxWriter:
         self.state = None
         self.function_props['defpy'] = s
 
+        pp.ParserElement.setDefaultWhitespaceChars(" \n\t")
+        ident = pp.Word(pp.alphanums + "_.+-")
+        ident_or_tuple = ident | ('(' + ident + pp.ZeroOrMore(',' + ident) + ')')
+        initializer = ident_or_tuple
+        arg = ident + pp.Optional('=' + initializer)
+        decl = ident + '(' + pp.Optional(arg + pp.ZeroOrMore(',' + arg)) + ')' + pp.Literal("->") + ident_or_tuple + pp.StringEnd()
+
+        try:
+            l = decl.parseString(s)
+            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']))
+        except pp.ParseException, pe:
+            self.report_error(c, str(pe))
+            print s
+            print pe
+
     def report_error(self, c, msg):
         print >>self.errors, "%s:%d: Error %s" % (c.filename, c.lineno, msg)
 
@@ -284,6 +303,7 @@ class SphinxWriter:
     def cmd_targetlang(self, c): pass
     def cmd_usepackage(self, c): pass
     def cmd_title(self, c): pass
+    def cmd_par(self, c): pass
 
     def cmd_href(self, c):
         self.write("`%s <%s>`_" % (str(c.params[1]), str(c.params[0])))