From 6ca618277c8ec110eb2a28f00cc3fb7329b1d00b Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Mon, 28 May 2012 20:11:38 +0000 Subject: [PATCH] More fixes for documentation. --- doc/check_docs2.py | 56 ++++-- modules/core/doc/basic_structures.rst | 10 - modules/core/doc/drawing_functions.rst | 82 ++++++++ modules/core/include/opencv2/core/core.hpp | 7 + modules/core/src/drawing.cpp | 208 +++++++++++++++----- .../common_interfaces_of_descriptor_extractors.rst | 19 -- .../doc/common_interfaces_of_feature_detectors.rst | 16 -- .../camera_calibration_and_3d_reconstruction.rst | 2 +- .../gpu/doc/feature_detection_and_description.rst | 8 +- modules/gpu/doc/image_filtering.rst | 2 +- modules/gpu/doc/image_processing.rst | 6 +- modules/gpu/doc/initalization_and_information.rst | 7 +- modules/gpu/doc/object_detection.rst | 2 +- modules/gpu/doc/operations_on_matrices.rst | 2 +- modules/gpu/doc/video.rst | 2 +- modules/gpu/include/opencv2/gpu/gpu.hpp | 2 +- modules/highgui/doc/qt_new_functions.rst | 18 +- modules/imgproc/doc/histograms.rst | 87 --------- .../structural_analysis_and_shape_descriptors.rst | 81 -------- .../imgproc/include/opencv2/imgproc/imgproc.hpp | 7 - modules/imgproc/src/contours.cpp | 214 +++++---------------- modules/legacy/doc/expectation_maximization.rst | 16 -- .../doc/feature_detection_and_description.rst | 62 +++--- modules/legacy/doc/histograms.rst | 95 +++++++++ modules/legacy/doc/legacy.rst | 1 + modules/legacy/doc/planar_subdivisions.rst | 38 ++-- modules/ml/doc/expectation_maximization.rst | 2 +- modules/objdetect/doc/cascade_classification.rst | 2 +- modules/objdetect/doc/latent_svm.rst | 2 +- .../include/opencv2/objdetect/objdetect.hpp | 4 +- modules/python/src2/hdr_parser.py | 4 +- modules/stitching/doc/autocalib.rst | 6 +- modules/stitching/doc/matching.rst | 4 +- modules/stitching/doc/motion_estimation.rst | 30 +-- modules/stitching/doc/warpers.rst | 2 +- 35 files changed, 532 insertions(+), 574 deletions(-) create mode 100644 modules/legacy/doc/histograms.rst diff --git a/doc/check_docs2.py b/doc/check_docs2.py index 1ee2dd1..2d7fe68 100644 --- a/doc/check_docs2.py +++ b/doc/check_docs2.py @@ -30,22 +30,31 @@ doc_signatures_whitelist = [ # templates "Matx", "Vec", "SparseMat_", "Scalar_", "Mat_", "Ptr", "Size_", "Point_", "Rect_", "Point3_", "DataType", "detail::RotationWarperBase", "flann::Index_", "CalonderDescriptorExtractor", +"gpu::DevMem2D_", "gpu::PtrStep_", "gpu::PtrElemStep_", # black boxes "CvArr", "CvFileStorage", -# the following classes reside in core but documented in gpu. It's no good -"gpu::DevMem2D_", "gpu::PtrStep_", "gpu::PtrElemStep_", -# these are even non-template -"gpu::DeviceInfo", "gpu::GpuMat", "gpu::TargetArchs", "gpu::FeatureSet"] +] defines = ["cvGraphEdgeIdx", "cvFree", "CV_Assert", "cvSqrt", "cvGetGraphVtx", "cvGraphVtxIdx", +"cvCaptureFromFile", "cvCaptureFromCAM", "cvCalcBackProjectPatch", "cvCalcBackProject", +"cvGetHistValue_1D", "cvGetHistValue_2D", "cvGetHistValue_3D", "cvGetHistValue_nD", +"cvQueryHistValue_1D", "cvQueryHistValue_2D", "cvQueryHistValue_3D", "cvQueryHistValue_nD", # not a real function but behaves as function -"Mat.size" +"Mat::size", +# ugly "virtual" functions from ml module +"CvStatModel::train", "CvStatModel::predict", +# TODO: +"cvExtractSURF" ] synonims = { "StarDetector" : ["StarFeatureDetector"], "MSER" : ["MserFeatureDetector"], - "GFTTDetector" : ["GoodFeaturesToTrackDetector"] + "GFTTDetector" : ["GoodFeaturesToTrackDetector"], + "cvCaptureFromFile" : ["cvCreateFileCapture"], + "cvCaptureFromCAM" : ["cvCreateCameraCapture"], + "cvCalcArrBackProjectPatch" : ["cvCalcBackProjectPatch"], + "cvCalcArrBackProject" : ["cvCalcBackProject"], } if do_python_crosscheck: @@ -80,10 +89,9 @@ def compareSignatures(f, s): # return type stype = (s[1] or "void") ftype = f[1] - if stype.startswith("cv::"): - stype = stype[4:] - if ftype and ftype.startswith("cv::"): - ftype = ftype[4:] + stype = re.sub(r"\b(cv|std)::", "", stype) + if ftype: + ftype = re.sub(r"\b(cv|std)::", "", ftype) if ftype and ftype != stype: return False, "return type mismatch" if ("\C" in f[2]) ^ ("\C" in s[2]): @@ -168,6 +176,10 @@ def process_module(module, path): hdrlist = glob.glob(os.path.join(path, "include", "opencv2", module, "*.h*")) hdrlist.extend(glob.glob(os.path.join(path, "include", "opencv2", module, "detail", "*.h*"))) + if module == "gpu": + hdrlist.append(os.path.join(path, "..", "core", "include", "opencv2", "core", "devmem2d.hpp")) + hdrlist.append(os.path.join(path, "..", "core", "include", "opencv2", "core", "gpumat.hpp")) + decls = [] for hname in hdrlist: if not "ts_gtest.h" in hname: @@ -196,8 +208,6 @@ def process_module(module, path): namespaces.append(namespace) else: funcs.append(decl) - # if "RNG" in decl[0]: - # print decl clsnamespaces = [] # process classes @@ -385,21 +395,19 @@ def process_module(module, path): logerror(ERROR_005_MISSINGPYFUNC, "could not load documented member of " + parent + " class: cv2." + pname, doc) else: logerror(ERROR_005_MISSINGPYFUNC, "could not load documented function cv2." + pname, doc) + signature.append(DOCUMENTED_MARKER) # stop subsequent errors continue docstrings = [docprefix + s.replace("([, ", "([") for s in docstr.split(" or ")] if not signature[1] in docstrings: pydocs = "\npydoc: ".join(docstrings) logerror(ERROR_007_INVALIDPYDOC, "documentation differs from pydoc\npydoc: " + pydocs + "\ncvdoc: " + signature[1], doc) - else: - signature.append(DOCUMENTED_MARKER) + signature.append(DOCUMENTED_MARKER) # verify C/C++ signatures for name, doc in rst.iteritems(): decls = doc.get("decls") if not decls: continue - # if "RNG" in name: - # print name, decls for signature in decls: if signature[0] == "C" or signature[0] == "C++": if "template" in (signature[2][1] or ""): @@ -431,6 +439,7 @@ def process_module(module, path): if signature[-1] != DOCUMENTED_MARKER: candidates = "\n\t".join([formatSignature(f[3]) for f in fd]) logerror(ERROR_009_OVERLOADNOTFOUND, signature[0] + " function " + signature[2][0].replace(".","::") + " is documented but misses in headers (" + error + ").\nDocumented as:\n\t" + signature[1] + "\nCandidates are:\n\t" + candidates, doc) + signature.append(DOCUMENTED_MARKER) # to stop subsequent error on this function # verify that all signatures was found in the library headers for name, doc in rst.iteritems(): @@ -443,11 +452,18 @@ def process_module(module, path): for d in doc.get("decls", []): if d[-1] != DOCUMENTED_MARKER: if d[0] == "C" or d[0] =="C++" or (do_python_crosscheck and d[0].startswith("Python")): - if d[0][0] == 'C' and d[2][0][3:] in defines: - #TODO: need to find a way to verify #define's + if d[0][0] == 'C': + sname = d[2][0][3:].replace(".", "::") + if sname in defines: + #TODO: need to find a way to verify #define's + continue + else: + sname = d[1][:d[1].find("(")] + prefixes = [x for x in doc_signatures_whitelist if sname.startswith(x)] + if prefixes: + # TODO: member of template class continue - logerror(ERROR_011_UNKNOWNFUNC, d[0] + " function is documented but is not found in OpenCV headers. It is documented as:\n\t" + d[1], doc) - #print d[2][0][3:] + logerror(ERROR_011_UNKNOWNFUNC, d[0] + " function " + sname + " is documented but is not found in OpenCV headers. It is documented as:\n\t" + d[1], doc) # end of process_module if __name__ == "__main__": diff --git a/modules/core/doc/basic_structures.rst b/modules/core/doc/basic_structures.rst index a56e281..344f5ed 100644 --- a/modules/core/doc/basic_structures.rst +++ b/modules/core/doc/basic_structures.rst @@ -889,16 +889,6 @@ Provides matrix assignment operators. These are available assignment operators. Since they all are very different, make sure to read the operator parameters description. - -Mat::operator MatExpr -------------------------- -Provides a ``Mat`` -to- ``MatExpr`` cast operator. - -.. ocv:function:: Mat::operator MatExpr_() const - -The cast operator should not be called explicitly. It is used internally by the -:ref:`MatrixExpressions` engine. - Mat::row ------------ Creates a matrix header for the specified matrix row. diff --git a/modules/core/doc/drawing_functions.rst b/modules/core/doc/drawing_functions.rst index 22d01da..06c6fb5 100644 --- a/modules/core/doc/drawing_functions.rst +++ b/modules/core/doc/drawing_functions.rst @@ -473,6 +473,88 @@ Draws several polygonal curves. The function ``polylines`` draws one or more polygonal curves. +drawContours +---------------- +Draws contours outlines or filled contours. + +.. ocv:function:: void drawContours( InputOutputArray image, InputArrayOfArrays contours, int contourIdx, const Scalar& color, int thickness=1, int lineType=8, InputArray hierarchy=noArray(), int maxLevel=INT_MAX, Point offset=Point() ) + +.. ocv:pyfunction:: cv2.drawContours(image, contours, contourIdx, color[, thickness[, lineType[, hierarchy[, maxLevel[, offset]]]]]) -> None + +.. ocv:cfunction:: void cvDrawContours( CvArr * img, CvSeq* contour, CvScalar external_color, CvScalar hole_color, int max_level, int thickness=1, int line_type=8, CvPoint offset=cvPoint(0,0) ) + +.. ocv:pyoldfunction:: cv.DrawContours(img, contour, external_color, hole_color, max_level, thickness=1, lineType=8, offset=(0, 0))-> None + + :param image: Destination image. + + :param contours: All the input contours. Each contour is stored as a point vector. + + :param contourIdx: Parameter indicating a contour to draw. If it is negative, all the contours are drawn. + + :param color: Color of the contours. + + :param thickness: Thickness of lines the contours are drawn with. If it is negative (for example, ``thickness=CV_FILLED`` ), the contour interiors are + drawn. + + :param lineType: Line connectivity. See :ocv:func:`line` for details. + + :param hierarchy: Optional information about hierarchy. It is only needed if you want to draw only some of the contours (see ``maxLevel`` ). + + :param maxLevel: Maximal level for drawn contours. If it is 0, only + the specified contour is drawn. If it is 1, the function draws the contour(s) and all the nested contours. If it is 2, the function draws the contours, all the nested contours, all the nested-to-nested contours, and so on. This parameter is only taken into account when there is ``hierarchy`` available. + + :param offset: Optional contour shift parameter. Shift all the drawn contours by the specified :math:`\texttt{offset}=(dx,dy)` . + + :param contour: Pointer to the first contour. + + :param externalColor: Color of external contours. + + :param holeColor: Color of internal contours (holes). + +The function draws contour outlines in the image if +:math:`\texttt{thickness} \ge 0` or fills the area bounded by the contours if +:math:`\texttt{thickness}<0` . The example below shows how to retrieve connected components from the binary image and label them: :: + + #include "cv.h" + #include "highgui.h" + + using namespace cv; + + int main( int argc, char** argv ) + { + Mat src; + // the first command-line parameter must be a filename of the binary + // (black-n-white) image + if( argc != 2 || !(src=imread(argv[1], 0)).data) + return -1; + + Mat dst = Mat::zeros(src.rows, src.cols, CV_8UC3); + + src = src > 1; + namedWindow( "Source", 1 ); + imshow( "Source", src ); + + vector > contours; + vector hierarchy; + + findContours( src, contours, hierarchy, + CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE ); + + // iterate through all the top-level contours, + // draw each connected component with its own random color + int idx = 0; + for( ; idx >= 0; idx = hierarchy[idx][0] ) + { + Scalar color( rand()&255, rand()&255, rand()&255 ); + drawContours( dst, contours, idx, color, CV_FILLED, 8, hierarchy ); + } + + namedWindow( "Components", 1 ); + imshow( "Components", dst ); + waitKey(0); + } + + putText ----------- diff --git a/modules/core/include/opencv2/core/core.hpp b/modules/core/include/opencv2/core/core.hpp index c8c3284..e544258 100644 --- a/modules/core/include/opencv2/core/core.hpp +++ b/modules/core/include/opencv2/core/core.hpp @@ -2538,6 +2538,13 @@ CV_EXPORTS_W void polylines(InputOutputArray img, InputArrayOfArrays pts, bool isClosed, const Scalar& color, int thickness=1, int lineType=8, int shift=0 ); +//! draws contours in the image +CV_EXPORTS_W void drawContours( InputOutputArray image, InputArrayOfArrays contours, + int contourIdx, const Scalar& color, + int thickness=1, int lineType=8, + InputArray hierarchy=noArray(), + int maxLevel=INT_MAX, Point offset=Point() ); + //! clips the line segment by the rectangle Rect(0, 0, imgSize.width, imgSize.height) CV_EXPORTS bool clipLine(Size imgSize, CV_IN_OUT Point& pt1, CV_IN_OUT Point& pt2); diff --git a/modules/core/src/drawing.cpp b/modules/core/src/drawing.cpp index 9016d0f..b1b87ad 100644 --- a/modules/core/src/drawing.cpp +++ b/modules/core/src/drawing.cpp @@ -140,11 +140,11 @@ bool clipLine( Rect img_rect, Point& pt1, Point& pt2 ) pt1 -= tl; pt2 -= tl; bool inside = clipLine(img_rect.size(), pt1, pt2); pt1 += tl; pt2 += tl; - + return inside; } -/* +/* Initializes line iterator. Returns number of points on the line or negative number if error. */ @@ -195,7 +195,7 @@ LineIterator::LineIterator(const Mat& img, Point pt1, Point pt2, step = (step ^ s) - s; s = dy > dx ? -1 : 0; - + /* conditional swaps */ dx ^= dy & s; dy ^= dx & s; @@ -208,7 +208,7 @@ LineIterator::LineIterator(const Mat& img, Point pt1, Point pt2, if( connectivity == 8 ) { assert( dx >= 0 && dy >= 0 ); - + err = dx - (dy + dy); plusDelta = dx + dx; minusDelta = -(dy + dy); @@ -219,7 +219,7 @@ LineIterator::LineIterator(const Mat& img, Point pt1, Point pt2, else /* connectivity == 4 */ { assert( dx >= 0 && dy >= 0 ); - + err = 0; plusDelta = (dx + dx) + (dy + dy); minusDelta = -(dy + dy); @@ -227,7 +227,7 @@ LineIterator::LineIterator(const Mat& img, Point pt1, Point pt2, minusStep = bt_pix; count = dx + dy + 1; } - + this->ptr0 = img.data; this->step = (int)img.step; this->elemSize = bt_pix0; @@ -621,10 +621,10 @@ Line2( Mat& img, Point pt1, Point pt2, const void* color ) tptr[1] = (uchar)cg; \ tptr[2] = (uchar)cr; \ } - + ICV_PUT_POINT((pt2.x + (XY_ONE >> 1)) >> XY_SHIFT, - (pt2.y + (XY_ONE >> 1)) >> XY_SHIFT); - + (pt2.y + (XY_ONE >> 1)) >> XY_SHIFT); + if( ax > ay ) { pt1.x >>= XY_SHIFT; @@ -640,7 +640,7 @@ Line2( Mat& img, Point pt1, Point pt2, const void* color ) else { pt1.y >>= XY_SHIFT; - + while( ecount >= 0 ) { ICV_PUT_POINT(pt1.x >> XY_SHIFT, pt1.y); @@ -664,8 +664,8 @@ Line2( Mat& img, Point pt1, Point pt2, const void* color ) } ICV_PUT_POINT((pt2.x + (XY_ONE >> 1)) >> XY_SHIFT, - (pt2.y + (XY_ONE >> 1)) >> XY_SHIFT); - + (pt2.y + (XY_ONE >> 1)) >> XY_SHIFT); + if( ax > ay ) { pt1.x >>= XY_SHIFT; @@ -681,7 +681,7 @@ Line2( Mat& img, Point pt1, Point pt2, const void* color ) else { pt1.y >>= XY_SHIFT; - + while( ecount >= 0 ) { ICV_PUT_POINT(pt1.x >> XY_SHIFT, pt1.y); @@ -690,7 +690,7 @@ Line2( Mat& img, Point pt1, Point pt2, const void* color ) ecount--; } } - + #undef ICV_PUT_POINT } else @@ -706,12 +706,12 @@ Line2( Mat& img, Point pt1, Point pt2, const void* color ) } ICV_PUT_POINT((pt2.x + (XY_ONE >> 1)) >> XY_SHIFT, - (pt2.y + (XY_ONE >> 1)) >> XY_SHIFT); - + (pt2.y + (XY_ONE >> 1)) >> XY_SHIFT); + if( ax > ay ) { pt1.x >>= XY_SHIFT; - + while( ecount >= 0 ) { ICV_PUT_POINT(pt1.x, pt1.y >> XY_SHIFT); @@ -723,7 +723,7 @@ Line2( Mat& img, Point pt1, Point pt2, const void* color ) else { pt1.y >>= XY_SHIFT; - + while( ecount >= 0 ) { ICV_PUT_POINT(pt1.x >> XY_SHIFT, pt1.y); @@ -732,7 +732,7 @@ Line2( Mat& img, Point pt1, Point pt2, const void* color ) ecount--; } } - + #undef ICV_PUT_POINT } } @@ -830,7 +830,7 @@ sincos( int angle, float& cosval, float& sinval ) cosval = SinTable[450 - angle]; } -/* +/* constructs polygon that represents elliptic arc. */ void ellipse2Poly( Point center, Size axes, int angle, @@ -880,7 +880,7 @@ void ellipse2Poly( Point center, Size axes, int angle, angle = arc_end; if( angle < 0 ) angle += 360; - + x = size_a * SinTable[450-angle]; y = size_b * SinTable[angle]; Point pt; @@ -922,7 +922,7 @@ EllipseEx( Mat& img, Point center, Size axes, /****************************************************************************************\ -* Polygons filling * +* Polygons filling * \****************************************************************************************/ /* helper macros: filling horizontal row */ @@ -1010,7 +1010,7 @@ FillConvexPoly( Mat& img, const Point* v, int npts, const void* color, int line_ LineAA( img, p0, p, color ); p0 = p; } - + xmin = (xmin + delta) >> shift; xmax = (xmax + delta) >> shift; ymin = (ymin + delta) >> shift; @@ -1118,7 +1118,7 @@ CollectPolyEdges( Mat& img, const Point* v, int count, vector& edges, { Point t0, t1; PolyEdge edge; - + pt1 = v[i]; pt1.x = (pt1.x + offset.x) << (XY_SHIFT - shift); pt1.y = (pt1.y + delta) >> shift; @@ -1337,7 +1337,7 @@ Circle( Mat& img, Point center, int radius, const void* color, int fill ) { uchar *tptr0 = ptr + y11 * step; uchar *tptr1 = ptr + y12 * step; - + if( !fill ) { ICV_PUT_POINT( tptr0, x11 ); @@ -1374,7 +1374,7 @@ Circle( Mat& img, Point center, int radius, const void* color, int fill ) x11 = std::max( x11, 0 ); x12 = MIN( x12, size.width - 1 ); } - + if( (unsigned)y11 < (unsigned)size.height ) { uchar *tptr = ptr + y11 * step; @@ -1523,7 +1523,7 @@ ThickLine( Mat& img, Point p0, Point p1, const void* color, Point center; center.x = (p0.x + (XY_ONE>>1)) >> XY_SHIFT; center.y = (p0.y + (XY_ONE>>1)) >> XY_SHIFT; - Circle( img, center, (thickness + (XY_ONE>>1)) >> XY_SHIFT, color, 1 ); + Circle( img, center, (thickness + (XY_ONE>>1)) >> XY_SHIFT, color, 1 ); } else { @@ -1544,7 +1544,7 @@ PolyLine( Mat& img, const Point* v, int count, bool is_closed, { if( !v || count <= 0 ) return; - + int i = is_closed ? count - 1 : 0; int flags = 2 + !is_closed; Point p0; @@ -1575,7 +1575,7 @@ void line( Mat& img, Point pt1, Point pt2, const Scalar& color, double buf[4]; scalarToRawData( color, buf, img.type(), 0 ); - ThickLine( img, pt1, pt2, buf, thickness, line_type, 3, shift ); + ThickLine( img, pt1, pt2, buf, thickness, line_type, 3, shift ); } void rectangle( Mat& img, Point pt1, Point pt2, @@ -1606,7 +1606,7 @@ void rectangle( Mat& img, Point pt1, Point pt2, FillConvexPoly( img, pt, 4, buf, lineType, shift ); } - + void rectangle( Mat& img, Rect rec, const Scalar& color, int thickness, int lineType, int shift ) @@ -1617,7 +1617,7 @@ void rectangle( Mat& img, Rect rec, color, thickness, lineType, shift ); } - + void circle( Mat& img, Point center, int radius, const Scalar& color, int thickness, int line_type, int shift ) { @@ -1667,25 +1667,25 @@ void ellipse( Mat& img, Point center, Size axes, EllipseEx( img, center, axes, _angle, _start_angle, _end_angle, buf, thickness, line_type ); } - + void ellipse(Mat& img, const RotatedRect& box, const Scalar& color, int thickness, int lineType) { if( lineType == CV_AA && img.depth() != CV_8U ) lineType = 8; - + CV_Assert( box.size.width >= 0 && box.size.height >= 0 && thickness <= 255 ); - + double buf[4]; scalarToRawData(color, buf, img.type(), 0); - + int _angle = cvRound(box.angle); Point center(cvRound(box.center.x*(1 << XY_SHIFT)), cvRound(box.center.y*(1 << XY_SHIFT))); Size axes(cvRound(box.size.width*(1 << (XY_SHIFT - 1))), cvRound(box.size.height*(1 << (XY_SHIFT - 1)))); - EllipseEx( img, center, axes, _angle, 0, 360, buf, thickness, lineType ); + EllipseEx( img, center, axes, _angle, 0, 360, buf, thickness, lineType ); } void fillConvexPoly( Mat& img, const Point* pts, int npts, @@ -1875,12 +1875,12 @@ static const int HersheyScriptComplex[] = { 2662, 2663, 2664, 2665, 2666, 2667, 2668, 2669, 2670, 2671, 2672, 2673, 2674, 2675, 2676, 2225, 2229, 2226, 2246 }; - + static const int* getFontData(int fontFace) { bool isItalic = (fontFace & FONT_ITALIC) != 0; const int* ascii = 0; - + switch( fontFace & 15 ) { case FONT_HERSHEY_SIMPLEX: @@ -1912,15 +1912,15 @@ static const int* getFontData(int fontFace) } return ascii; } - - + + void putText( Mat& img, const string& text, Point org, int fontFace, double fontScale, Scalar color, int thickness, int line_type, bool bottomLeftOrigin ) { const int* ascii = getFontData(fontFace); - + double buf[4]; scalarToRawData(color, buf, img.type(), 0); @@ -1959,7 +1959,7 @@ void putText( Mat& img, const string& text, Point org, if( *ptr == ' ' || !*ptr ) { if( pts.size() > 1 ) - PolyLine( img, &pts[0], (int)pts.size(), false, buf, thickness, line_type, XY_SHIFT ); + PolyLine( img, &pts[0], (int)pts.size(), false, buf, thickness, line_type, XY_SHIFT ); if( !*ptr++ ) break; pts.resize(0); @@ -2030,7 +2030,7 @@ void cv::fillPoly(InputOutputArray _img, InputArrayOfArrays pts, AutoBuffer _npts(ncontours); Point** ptsptr = _ptsptr; int* npts = _npts; - + for( i = 0; i < ncontours; i++ ) { Mat p = pts.getMat(i); @@ -2056,7 +2056,7 @@ void cv::polylines(InputOutputArray _img, InputArrayOfArrays pts, AutoBuffer _npts(ncontours); Point** ptsptr = _ptsptr; int* npts = _npts; - + for( i = 0; i < ncontours; i++ ) { Mat p = pts.getMat(manyContours ? i : -1); @@ -2069,6 +2069,116 @@ void cv::polylines(InputOutputArray _img, InputArrayOfArrays pts, polylines(img, (const Point**)ptsptr, npts, (int)ncontours, isClosed, color, thickness, lineType, shift); } +namespace +{ +using namespace cv; + +static void addChildContour(InputArrayOfArrays contours, + size_t ncontours, + const Vec4i* hierarchy, + int i, vector& seq, + vector& block) +{ + for( ; i >= 0; i = hierarchy[i][0] ) + { + Mat ci = contours.getMat(i); + cvMakeSeqHeaderForArray(CV_SEQ_POLYGON, sizeof(CvSeq), sizeof(Point), + !ci.empty() ? (void*)ci.data : 0, (int)ci.total(), + &seq[i], &block[i] ); + + int h_next = hierarchy[i][0], h_prev = hierarchy[i][1], + v_next = hierarchy[i][2], v_prev = hierarchy[i][3]; + seq[i].h_next = (size_t)h_next < ncontours ? &seq[h_next] : 0; + seq[i].h_prev = (size_t)h_prev < ncontours ? &seq[h_prev] : 0; + seq[i].v_next = (size_t)v_next < ncontours ? &seq[v_next] : 0; + seq[i].v_prev = (size_t)v_prev < ncontours ? &seq[v_prev] : 0; + + if( v_next >= 0 ) + addChildContour(contours, ncontours, hierarchy, v_next, seq, block); + } +} +} + +void cv::drawContours( InputOutputArray _image, InputArrayOfArrays _contours, + int contourIdx, const Scalar& color, int thickness, + int lineType, InputArray _hierarchy, + int maxLevel, Point offset ) +{ + Mat image = _image.getMat(), hierarchy = _hierarchy.getMat(); + CvMat _cimage = image; + + size_t ncontours = _contours.total(); + size_t i = 0, first = 0, last = ncontours; + vector seq; + vector block; + + if( !last ) + return; + + seq.resize(last); + block.resize(last); + + for( i = first; i < last; i++ ) + seq[i].first = 0; + + if( contourIdx >= 0 ) + { + CV_Assert( 0 <= contourIdx && contourIdx < (int)last ); + first = contourIdx; + last = contourIdx + 1; + } + + for( i = first; i < last; i++ ) + { + Mat ci = _contours.getMat((int)i); + if( ci.empty() ) + continue; + int npoints = ci.checkVector(2, CV_32S); + CV_Assert( npoints > 0 ); + cvMakeSeqHeaderForArray( CV_SEQ_POLYGON, sizeof(CvSeq), sizeof(Point), + ci.data, npoints, &seq[i], &block[i] ); + } + + if( hierarchy.empty() || maxLevel == 0 ) + for( i = first; i < last; i++ ) + { + seq[i].h_next = i < last-1 ? &seq[i+1] : 0; + seq[i].h_prev = i > first ? &seq[i-1] : 0; + } + else + { + size_t count = last - first; + CV_Assert(hierarchy.total() == ncontours && hierarchy.type() == CV_32SC4 ); + const Vec4i* h = hierarchy.ptr(); + + if( count == ncontours ) + { + for( i = first; i < last; i++ ) + { + int h_next = h[i][0], h_prev = h[i][1], + v_next = h[i][2], v_prev = h[i][3]; + seq[i].h_next = (size_t)h_next < count ? &seq[h_next] : 0; + seq[i].h_prev = (size_t)h_prev < count ? &seq[h_prev] : 0; + seq[i].v_next = (size_t)v_next < count ? &seq[v_next] : 0; + seq[i].v_prev = (size_t)v_prev < count ? &seq[v_prev] : 0; + } + } + else + { + int child = h[first][2]; + if( child >= 0 ) + { + addChildContour(_contours, ncontours, h, child, seq, block); + seq[first].v_next = &seq[child]; + } + } + } + + cvDrawContours( &_cimage, &seq[first], color, color, contourIdx >= 0 ? + -maxLevel : maxLevel, thickness, lineType, offset ); +} + + static const int CodeDeltas[8][2] = { {1, 0}, {1, -1}, {0, -1}, {-1, -1}, {-1, 0}, {-1, 1}, {0, 1}, {1, 1} }; @@ -2078,7 +2188,7 @@ static const int CodeDeltas[8][2] = CV_IMPL void cvDrawContours( void* _img, CvSeq* contour, - CvScalar _externalColor, CvScalar _holeColor, + CvScalar _externalColor, CvScalar _holeColor, int maxLevel, int thickness, int line_type, CvPoint _offset ) { @@ -2104,7 +2214,7 @@ cvDrawContours( void* _img, CvSeq* contour, maxLevel = MAX(maxLevel, INT_MIN+2); maxLevel = MIN(maxLevel, INT_MAX-1); - + if( maxLevel < 0 ) { h_next = contour->h_next; @@ -2148,7 +2258,7 @@ cvDrawContours( void* _img, CvSeq* contour, pts.push_back(pt); prev_pt = pt; } - + pt.x += CodeDeltas[(int)code][0]; pt.y += CodeDeltas[(int)code][1]; } @@ -2166,7 +2276,7 @@ cvDrawContours( void* _img, CvSeq* contour, CV_Assert( elem_type == CV_32SC2 ); cv::Point pt1, pt2; int shift = 0; - + count -= !CV_IS_SEQ_CLOSED(contour); CV_READ_SEQ_ELEM( pt1, reader ); pt1 += offset; @@ -2218,7 +2328,7 @@ CV_IMPL CvScalar cvColorToScalar( double packed_color, int type ) { CvScalar scalar; - + if( CV_MAT_DEPTH( type ) == CV_8U ) { int icolor = cvRound( packed_color ); diff --git a/modules/features2d/doc/common_interfaces_of_descriptor_extractors.rst b/modules/features2d/doc/common_interfaces_of_descriptor_extractors.rst index 8f624ae..6c50049 100644 --- a/modules/features2d/doc/common_interfaces_of_descriptor_extractors.rst +++ b/modules/features2d/doc/common_interfaces_of_descriptor_extractors.rst @@ -65,25 +65,6 @@ Computes the descriptors for a set of keypoints detected in an image (first vari :param descriptors: Computed descriptors. In the second variant of the method ``descriptors[i]`` are descriptors computed for a ``keypoints[i]`. Row ``j`` is the ``keypoints`` (or ``keypoints[i]``) is the descriptor for keypoint ``j``-th keypoint. -DescriptorExtractor::read ------------------------------ -Reads the object of a descriptor extractor from a file node. - -.. ocv:function:: void DescriptorExtractor::read( const FileNode& fn ) - - :param fn: File node from which the detector is read. - - - -DescriptorExtractor::write ------------------------------- -Writes the object of a descriptor extractor to a file storage. - -.. ocv:function:: void DescriptorExtractor::write( FileStorage& fs ) const - - :param fs: File storage where the detector is written. - - DescriptorExtractor::create ------------------------------- diff --git a/modules/features2d/doc/common_interfaces_of_feature_detectors.rst b/modules/features2d/doc/common_interfaces_of_feature_detectors.rst index b2dd055..0556ccb 100644 --- a/modules/features2d/doc/common_interfaces_of_feature_detectors.rst +++ b/modules/features2d/doc/common_interfaces_of_feature_detectors.rst @@ -112,22 +112,6 @@ Detects keypoints in an image (first variant) or image set (second variant). :param masks: Masks for each input image specifying where to look for keypoints (optional). ``masks[i]`` is a mask for ``images[i]``. -FeatureDetector::read -------------------------- -Reads a feature detector object from a file node. - -.. ocv:function:: void FeatureDetector::read( const FileNode& fn ) - - :param fn: File node from which the detector is read. - -FeatureDetector::write --------------------------- -Writes a feature detector object to a file storage. - -.. ocv:function:: void FeatureDetector::write( FileStorage& fs ) const - - :param fs: File storage where the detector is written. - FeatureDetector::create --------------------------- Creates a feature detector by its name. diff --git a/modules/gpu/doc/camera_calibration_and_3d_reconstruction.rst b/modules/gpu/doc/camera_calibration_and_3d_reconstruction.rst index e95b453..537aa6f 100644 --- a/modules/gpu/doc/camera_calibration_and_3d_reconstruction.rst +++ b/modules/gpu/doc/camera_calibration_and_3d_reconstruction.rst @@ -289,7 +289,7 @@ Enables the :ocv:class:`gpu::StereoConstantSpaceBP` constructors. .. ocv:function:: gpu::StereoConstantSpaceBP::StereoConstantSpaceBP(int ndisp = DEFAULT_NDISP, int iters = DEFAULT_ITERS, int levels = DEFAULT_LEVELS, int nr_plane = DEFAULT_NR_PLANE, int msg_type = CV_32F) -.. ocv:function:: StereoConstantSpaceBP::StereoConstantSpaceBP(int ndisp, int iters, int levels, int nr_plane, float max_data_term, float data_weight, float max_disc_term, float disc_single_jump, int min_disp_th = 0, int msg_type = CV_32F) +.. ocv:function:: gpu::StereoConstantSpaceBP::StereoConstantSpaceBP(int ndisp, int iters, int levels, int nr_plane, float max_data_term, float data_weight, float max_disc_term, float disc_single_jump, int min_disp_th = 0, int msg_type = CV_32F) :param ndisp: Number of disparities. diff --git a/modules/gpu/doc/feature_detection_and_description.rst b/modules/gpu/doc/feature_detection_and_description.rst index f6e526e..4129ba8 100644 --- a/modules/gpu/doc/feature_detection_and_description.rst +++ b/modules/gpu/doc/feature_detection_and_description.rst @@ -346,19 +346,19 @@ Detects keypoints and computes descriptors for them. -gpu::ORB_GPU::downloadKeypoints +gpu::ORB_GPU::downloadKeyPoints ------------------------------------- Download keypoints from GPU to CPU memory. -.. ocv:function:: void gpu::ORB_GPU::downloadKeypoints(const GpuMat& d_keypoints, std::vector& keypoints) +.. ocv:function:: void gpu::ORB_GPU::downloadKeyPoints( GpuMat& d_keypoints, std::vector& keypoints ) -gpu::ORB_GPU::convertKeypoints +gpu::ORB_GPU::convertKeyPoints ------------------------------------- Converts keypoints from GPU representation to vector of ``KeyPoint``. -.. ocv:function:: void gpu::ORB_GPU::convertKeypoints(const Mat& h_keypoints, std::vector& keypoints) +.. ocv:function:: void gpu::ORB_GPU::convertKeyPoints( Mat& d_keypoints, std::vector& keypoints ) diff --git a/modules/gpu/doc/image_filtering.rst b/modules/gpu/doc/image_filtering.rst index a32a6f7..2e522a8 100644 --- a/modules/gpu/doc/image_filtering.rst +++ b/modules/gpu/doc/image_filtering.rst @@ -195,7 +195,7 @@ Creates a normalized 2D box filter. .. ocv:function:: Ptr gpu::createBoxFilter_GPU(int srcType, int dstType, const Size& ksize, const Point& anchor = Point(-1,-1)) -.. ocv:function:: Ptr getBoxFilter_GPU(int srcType, int dstType, const Size& ksize, Point anchor = Point(-1, -1)) +.. ocv:function:: Ptr gpu::getBoxFilter_GPU(int srcType, int dstType, const Size& ksize, Point anchor = Point(-1, -1)) :param srcType: Input image type supporting ``CV_8UC1`` and ``CV_8UC4`` . diff --git a/modules/gpu/doc/image_processing.rst b/modules/gpu/doc/image_processing.rst index 765bd20..dfe17a8 100644 --- a/modules/gpu/doc/image_processing.rst +++ b/modules/gpu/doc/image_processing.rst @@ -261,7 +261,7 @@ You can use field `user_block_size` to set specific block size for :ocv:func:`gp gpu::ConvolveBuf::create ------------------------ -.. ocv:function:: ConvolveBuf::create(Size image_size, Size templ_size) +.. ocv:function:: gpu::ConvolveBuf::create(Size image_size, Size templ_size) Constructs a buffer for :ocv:func:`gpu::convolve` function with respective arguments. @@ -499,7 +499,7 @@ gpu::buildWarpAffineMaps ------------------------ Builds transformation maps for affine transformation. -.. ocv:function:: void buildWarpAffineMaps(const Mat& M, bool inverse, Size dsize, GpuMat& xmap, GpuMat& ymap, Stream& stream = Stream::Null()) +.. ocv:function:: void gpu::buildWarpAffineMaps(const Mat& M, bool inverse, Size dsize, GpuMat& xmap, GpuMat& ymap, Stream& stream = Stream::Null()) :param M: *2x3* transformation matrix. @@ -543,7 +543,7 @@ gpu::buildWarpPerspectiveMaps ----------------------------- Builds transformation maps for perspective transformation. -.. ocv:function:: void buildWarpAffineMaps(const Mat& M, bool inverse, Size dsize, GpuMat& xmap, GpuMat& ymap, Stream& stream = Stream::Null()) +.. ocv:function:: void gpu::buildWarpAffineMaps(const Mat& M, bool inverse, Size dsize, GpuMat& xmap, GpuMat& ymap, Stream& stream = Stream::Null()) :param M: *3x3* transformation matrix. diff --git a/modules/gpu/doc/initalization_and_information.rst b/modules/gpu/doc/initalization_and_information.rst index a3f7304..c281185 100644 --- a/modules/gpu/doc/initalization_and_information.rst +++ b/modules/gpu/doc/initalization_and_information.rst @@ -47,7 +47,6 @@ Any subsequent API call to this device will reinitialize the device. gpu::FeatureSet --------------- -.. ocv:class:: gpu::FeatureSet Class providing GPU computing features. :: @@ -74,7 +73,7 @@ Class providing a set of static methods to check what NVIDIA* card architecture The following method checks whether the module was built with the support of the given feature: - .. ocv:function:: static bool gpu::TargetArchs::builtWith(FeatureSet feature) + .. ocv:function:: static bool gpu::TargetArchs::builtWith( FeatureSet feature_set ) :param feature: Feature to be checked. See :ocv:class:`gpu::FeatureSet`. @@ -150,7 +149,7 @@ gpu::DeviceInfo::name ------------------------- Returns the device name. -.. ocv:function:: string gpu::DeviceInfo::name() +.. ocv:function:: string gpu::DeviceInfo::name() const @@ -198,7 +197,7 @@ gpu::DeviceInfo::supports ----------------------------- Provides information on GPU feature support. -.. ocv:function:: bool gpu::DeviceInfo::supports(FeatureSet feature) +.. ocv:function:: bool gpu::DeviceInfo::supports( FeatureSet feature_set ) const :param feature: Feature to be checked. See :ocv:class:`gpu::FeatureSet`. diff --git a/modules/gpu/doc/object_detection.rst b/modules/gpu/doc/object_detection.rst index 9d38939..1f522f3 100644 --- a/modules/gpu/doc/object_detection.rst +++ b/modules/gpu/doc/object_detection.rst @@ -235,7 +235,7 @@ gpu::CascadeClassifier_GPU::CascadeClassifier_GPU ----------------------------------------------------- Loads the classifier from a file. -.. ocv:function:: gpu::CascadeClassifier_GPU(const string& filename) +.. ocv:function:: gpu::CascadeClassifier_GPU::CascadeClassifier_GPU(const string& filename) :param filename: Name of the file from which the classifier is loaded. Only the old ``haar`` classifier (trained by the ``haar`` training application) and NVIDIA's ``nvbin`` are supported. diff --git a/modules/gpu/doc/operations_on_matrices.rst b/modules/gpu/doc/operations_on_matrices.rst index b7d6431..19ec350 100644 --- a/modules/gpu/doc/operations_on_matrices.rst +++ b/modules/gpu/doc/operations_on_matrices.rst @@ -9,7 +9,7 @@ gpu::gemm ------------------ Performs generalized matrix multiplication. -.. ocv:function:: void gemm(const GpuMat& src1, const GpuMat& src2, double alpha, const GpuMat& src3, double beta, GpuMat& dst, int flags = 0, Stream& stream = Stream::Null()) +.. ocv:function:: void gpu::gemm(const GpuMat& src1, const GpuMat& src2, double alpha, const GpuMat& src3, double beta, GpuMat& dst, int flags = 0, Stream& stream = Stream::Null()) :param src1: First multiplied input matrix that should have ``CV_32FC1`` , ``CV_64FC1`` , ``CV_32FC2`` , or ``CV_64FC2`` type. diff --git a/modules/gpu/doc/video.rst b/modules/gpu/doc/video.rst index e5c1c63..9bde6bc 100644 --- a/modules/gpu/doc/video.rst +++ b/modules/gpu/doc/video.rst @@ -475,7 +475,7 @@ gpu::VideoWriter_GPU::EncoderCallBack::acquireBitStream ------------------------------------------------------- Callback function to signal the start of bitstream that is to be encoded. -.. ocv:function:: virtual unsigned char* gpu::VideoWriter_GPU::EncoderCallBack::acquireBitStream(int* bufferSize) = 0 +.. ocv:function:: virtual uchar* gpu::VideoWriter_GPU::EncoderCallBack::acquireBitStream(int* bufferSize) = 0 Callback must allocate buffer for CUDA encoder and return pointer to it and it's size. diff --git a/modules/gpu/include/opencv2/gpu/gpu.hpp b/modules/gpu/include/opencv2/gpu/gpu.hpp index 5996d6c..aebe6d4 100644 --- a/modules/gpu/include/opencv2/gpu/gpu.hpp +++ b/modules/gpu/include/opencv2/gpu/gpu.hpp @@ -1978,7 +1978,7 @@ public: // callback function to signal the start of bitstream that is to be encoded // must return pointer to buffer - virtual unsigned char* acquireBitStream(int* bufferSize) = 0; + virtual uchar* acquireBitStream(int* bufferSize) = 0; // callback function to signal that the encoded bitstream is ready to be written to file virtual void releaseBitStream(unsigned char* data, int size) = 0; diff --git a/modules/highgui/doc/qt_new_functions.rst b/modules/highgui/doc/qt_new_functions.rst index 929f320..e84e3ef 100644 --- a/modules/highgui/doc/qt_new_functions.rst +++ b/modules/highgui/doc/qt_new_functions.rst @@ -226,27 +226,21 @@ The function ``displayOverlay`` displays useful information/tips on top of the w *delayms* . This information is displayed on the window statusbar (the window must be created with the ``CV_GUI_EXPANDED`` flags). -createOpenGLCallback +setOpenGlDrawCallback ------------------------ -Creates a callback function called to draw OpenGL on top the image display by ``windowname``. +Sets a callback function to be called to draw on top of displayed image. -.. ocv:function:: void createOpenGLCallback( const string& window_name, OpenGLCallback callbackOpenGL, void* userdata =NULL, double angle=-1, double zmin=-1, double zmax=-1) +.. ocv:function:: void setOpenGlDrawCallback( const string& winname, OpenGlDrawCallback onOpenGlDraw, void* userdata=0 ) -.. ocv:cfunction:: void cvCreateOpenGLCallback( const char* windowName, CvOpenGLCallback callbackOpenGL, void* userdata=NULL, double angle=-1, double zmin=-1, double zmax=-1 ) +.. ocv:cfunction:: void cvSetOpenGlDrawCallback( const char* window_name, CvOpenGlDrawCallback callback, void* userdata=NULL ) :param window_name: Name of the window. - :param callbackOpenGL: Pointer to the function to be called every frame. This function should be prototyped as ``void Foo(*void);`` . + :param callbackOpenGL: Pointer to the function to be called every frame. This function should be prototyped as ``void Foo(void*)`` . :param userdata: Pointer passed to the callback function. *(Optional)* - :param angle: Parameter specifying the field of a view angle, in degrees, in the y direction. Default value is 45 degrees. *(Optional)* - - :param zmin: Parameter specifying the distance from the viewer to the near clipping plane (always positive). Default value is 0.01. *(Optional)* - - :param zmax: Parameter specifying the distance from the viewer to the far clipping plane (always positive). Default value is 1000. *(Optional)* - -The function ``createOpenGLCallback`` can be used to draw 3D data on the window. See the example of callback use below: :: +The function ``setOpenGlDrawCallback`` can be used to draw 3D data on the window. See the example of callback function below: :: void on_opengl(void* param) { diff --git a/modules/imgproc/doc/histograms.rst b/modules/imgproc/doc/histograms.rst index 6c19bed..f20bfd0 100644 --- a/modules/imgproc/doc/histograms.rst +++ b/modules/imgproc/doc/histograms.rst @@ -406,44 +406,6 @@ Creates a histogram. The function creates a histogram of the specified size and returns a pointer to the created histogram. If the array ``ranges`` is 0, the histogram bin ranges must be specified later via the function :ocv:cfunc:`SetHistBinRanges`. Though :ocv:cfunc:`CalcHist` and :ocv:cfunc:`CalcBackProject` may process 8-bit images without setting bin ranges, they assume they are equally spaced in 0 to 255 bins. -GetHistValue\_?D ----------------- -Returns a pointer to the histogram bin. - -.. ocv:cfunction:: float cvGetHistValue_1D(CvHistogram hist, int idx0) - -.. ocv:cfunction:: float cvGetHistValue_2D(CvHistogram hist, int idx0, int idx1) - -.. ocv:cfunction:: float cvGetHistValue_3D(CvHistogram hist, int idx0, int idx1, int idx2) - -.. ocv:cfunction:: float cvGetHistValue_nD(CvHistogram hist, int idx) - - :param hist: Histogram. - - :param idx0: 0-th index. - - :param idx1: 1-st index. - - :param idx2: 2-nd index. - - :param idx: Array of indices. - -:: - - #define cvGetHistValue_1D( hist, idx0 ) - ((float*)(cvPtr1D( (hist)->bins, (idx0), 0 )) - #define cvGetHistValue_2D( hist, idx0, idx1 ) - ((float*)(cvPtr2D( (hist)->bins, (idx0), (idx1), 0 ))) - #define cvGetHistValue_3D( hist, idx0, idx1, idx2 ) - ((float*)(cvPtr3D( (hist)->bins, (idx0), (idx1), (idx2), 0 ))) - #define cvGetHistValue_nD( hist, idx ) - ((float*)(cvPtrND( (hist)->bins, (idx), 0 ))) - -.. - -The macros ``GetHistValue`` return a pointer to the specified bin of the 1D, 2D, 3D, or N-D histogram. In case of a sparse histogram, the function creates a new bin and sets it to 0, unless it exists already. - - GetMinMaxHistValue ------------------ Finds the minimum and maximum histogram bins. @@ -499,32 +461,6 @@ Normalizes the histogram. The function normalizes the histogram bins by scaling them so that the sum of the bins becomes equal to ``factor``. -QueryHistValue*D ----------------- -Queries the value of the histogram bin. - -.. ocv:cfunction:: float QueryHistValue_1D(CvHistogram hist, int idx0) -.. ocv:cfunction:: float QueryHistValue_2D(CvHistogram hist, int idx0, int idx1) -.. ocv:cfunction:: float QueryHistValue_3D(CvHistogram hist, int idx0, int idx1, int idx2) -.. ocv:cfunction:: float QueryHistValue_nD(CvHistogram hist, const int* idx) - -.. ocv:pyoldfunction:: cv.QueryHistValue_1D(hist, idx0) -> float -.. ocv:pyoldfunction:: cv.QueryHistValue_2D(hist, idx0, idx1) -> float -.. ocv:pyoldfunction:: cv.QueryHistValue_3D(hist, idx0, idx1, idx2) -> float -.. ocv:pyoldfunction:: cv.QueryHistValue_nD(hist, idx) -> float - - :param hist: Histogram. - - :param idx0: 0-th index. - - :param idx1: 1-st index. - - :param idx2: 2-nd index. - - :param idx: Array of indices. - -The macros return the value of the specified bin of the 1D, 2D, 3D, or N-D histogram. In case of a sparse histogram, the function returns 0. If the bin is not present in the histogram, no new bin is created. - ReleaseHist ----------- Releases the histogram. @@ -565,27 +501,4 @@ Thresholds the histogram. The function clears histogram bins that are below the specified threshold. -CalcPGH -------- -Calculates a pair-wise geometrical histogram for a contour. - -.. ocv:cfunction:: void cvCalcPGH( const CvSeq* contour, CvHistogram* hist ) - - :param contour: Input contour. Currently, only integer point coordinates are allowed. - - :param hist: Calculated histogram. It must be two-dimensional. - -The function calculates a 2D pair-wise geometrical histogram (PGH), described in [Iivarinen97]_ for the contour. The algorithm considers every pair of contour -edges. The angle between the edges and the minimum/maximum distances -are determined for every pair. To do this, each of the edges in turn -is taken as the base, while the function loops through all the other -edges. When the base edge and any other edge are considered, the minimum -and maximum distances from the points on the non-base edge and line of -the base edge are selected. The angle between the edges defines the row -of the histogram in which all the bins that correspond to the distance -between the calculated minimum and maximum distances are incremented -(that is, the histogram is transposed relatively to the definition in the original paper). The histogram can be used for contour matching. - .. [RubnerSept98] Y. Rubner. C. Tomasi, L.J. Guibas. *The Earth Mover’s Distance as a Metric for Image Retrieval*. Technical Report STAN-CS-TN-98-86, Department of Computer Science, Stanford University, September 1998. - -.. [Iivarinen97] Jukka Iivarinen, Markus Peura, Jaakko Srel, and Ari Visa. *Comparison of Combined Shape Descriptors for Irregular Objects*, 8th British Machine Vision Conference, BMVC'97. http://www.cis.hut.fi/research/IA/paper/publications/bmvc97/bmvc97.html diff --git a/modules/imgproc/doc/structural_analysis_and_shape_descriptors.rst b/modules/imgproc/doc/structural_analysis_and_shape_descriptors.rst index fbb7343..6ef45c1 100644 --- a/modules/imgproc/doc/structural_analysis_and_shape_descriptors.rst +++ b/modules/imgproc/doc/structural_analysis_and_shape_descriptors.rst @@ -166,87 +166,6 @@ The function retrieves contours from the binary image using the algorithm .. note:: If you use the new Python interface then the ``CV_`` prefix has to be omitted in contour retrieval mode and contour approximation method parameters (for example, use ``cv2.RETR_LIST`` and ``cv2.CHAIN_APPROX_NONE`` parameters). If you use the old Python interface then these parameters have the ``CV_`` prefix (for example, use ``cv.CV_RETR_LIST`` and ``cv.CV_CHAIN_APPROX_NONE``). -drawContours ----------------- -Draws contours outlines or filled contours. - -.. ocv:function:: void drawContours( InputOutputArray image, InputArrayOfArrays contours, int contourIdx, const Scalar& color, int thickness=1, int lineType=8, InputArray hierarchy=noArray(), int maxLevel=INT_MAX, Point offset=Point() ) - -.. ocv:pyfunction:: cv2.drawContours(image, contours, contourIdx, color[, thickness[, lineType[, hierarchy[, maxLevel[, offset]]]]]) -> None - -.. ocv:cfunction:: void cvDrawContours( CvArr *img, CvSeq* contour, CvScalar externalColor, CvScalar holeColor, int maxLevel, int thickness=1, int lineType=8 ) -.. ocv:pyoldfunction:: cv.DrawContours(img, contour, external_color, hole_color, max_level, thickness=1, lineType=8, offset=(0, 0))-> None - - :param image: Destination image. - - :param contours: All the input contours. Each contour is stored as a point vector. - - :param contourIdx: Parameter indicating a contour to draw. If it is negative, all the contours are drawn. - - :param color: Color of the contours. - - :param thickness: Thickness of lines the contours are drawn with. If it is negative (for example, ``thickness=CV_FILLED`` ), the contour interiors are - drawn. - - :param lineType: Line connectivity. See :ocv:func:`line` for details. - - :param hierarchy: Optional information about hierarchy. It is only needed if you want to draw only some of the contours (see ``maxLevel`` ). - - :param maxLevel: Maximal level for drawn contours. If it is 0, only - the specified contour is drawn. If it is 1, the function draws the contour(s) and all the nested contours. If it is 2, the function draws the contours, all the nested contours, all the nested-to-nested contours, and so on. This parameter is only taken into account when there is ``hierarchy`` available. - - :param offset: Optional contour shift parameter. Shift all the drawn contours by the specified :math:`\texttt{offset}=(dx,dy)` . - - :param contour: Pointer to the first contour. - - :param externalColor: Color of external contours. - - :param holeColor: Color of internal contours (holes). - -The function draws contour outlines in the image if -:math:`\texttt{thickness} \ge 0` or fills the area bounded by the contours if -:math:`\texttt{thickness}<0` . The example below shows how to retrieve connected components from the binary image and label them: :: - - #include "cv.h" - #include "highgui.h" - - using namespace cv; - - int main( int argc, char** argv ) - { - Mat src; - // the first command-line parameter must be a filename of the binary - // (black-n-white) image - if( argc != 2 || !(src=imread(argv[1], 0)).data) - return -1; - - Mat dst = Mat::zeros(src.rows, src.cols, CV_8UC3); - - src = src > 1; - namedWindow( "Source", 1 ); - imshow( "Source", src ); - - vector > contours; - vector hierarchy; - - findContours( src, contours, hierarchy, - CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE ); - - // iterate through all the top-level contours, - // draw each connected component with its own random color - int idx = 0; - for( ; idx >= 0; idx = hierarchy[idx][0] ) - { - Scalar color( rand()&255, rand()&255, rand()&255 ); - drawContours( dst, contours, idx, color, CV_FILLED, 8, hierarchy ); - } - - namedWindow( "Components", 1 ); - imshow( "Components", dst ); - waitKey(0); - } - - approxPolyDP ---------------- diff --git a/modules/imgproc/include/opencv2/imgproc/imgproc.hpp b/modules/imgproc/include/opencv2/imgproc/imgproc.hpp index 56605c7..68eba83 100644 --- a/modules/imgproc/include/opencv2/imgproc/imgproc.hpp +++ b/modules/imgproc/include/opencv2/imgproc/imgproc.hpp @@ -1078,13 +1078,6 @@ CV_EXPORTS_W void findContours( InputOutputArray image, OutputArrayOfArrays cont CV_EXPORTS void findContours( InputOutputArray image, OutputArrayOfArrays contours, int mode, int method, Point offset=Point()); -//! draws contours in the image -CV_EXPORTS_W void drawContours( InputOutputArray image, InputArrayOfArrays contours, - int contourIdx, const Scalar& color, - int thickness=1, int lineType=8, - InputArray hierarchy=noArray(), - int maxLevel=INT_MAX, Point offset=Point() ); - //! approximates contour or a curve using Douglas-Peucker algorithm CV_EXPORTS_W void approxPolyDP( InputArray curve, OutputArray approxCurve, diff --git a/modules/imgproc/src/contours.cpp b/modules/imgproc/src/contours.cpp index e8015d3..c290385 100644 --- a/modules/imgproc/src/contours.cpp +++ b/modules/imgproc/src/contours.cpp @@ -159,7 +159,7 @@ typedef struct _CvContourScanner external contours and holes), 3 - full hierarchy; 4 - connected components of a multi-level image - */ + */ int subst_flag; int seq_type1; /* type of fetched contours */ int header_size1; /* hdr size of fetched contours */ @@ -190,7 +190,7 @@ cvStartFindContours( void* _img, CvMemStorage* storage, if( CV_MAT_TYPE(mat->type) == CV_32SC1 && mode == CV_RETR_CCOMP ) mode = CV_RETR_FLOODFILL; - + if( !((CV_IS_MASK_ARR( mat ) && mode < CV_RETR_FLOODFILL) || (CV_MAT_TYPE(mat->type) == CV_32SC1 && mode == CV_RETR_FLOODFILL)) ) CV_Error( CV_StsUnsupportedFormat, "[Start]FindContours support only 8uC1 and 32sC1 images" ); @@ -207,7 +207,7 @@ cvStartFindContours( void* _img, CvMemStorage* storage, CvContourScanner scanner = (CvContourScanner)cvAlloc( sizeof( *scanner )); memset( scanner, 0, sizeof(*scanner) ); - + scanner->storage1 = scanner->storage2 = storage; scanner->img0 = (schar *) img; scanner->img = (schar *) (img + step); @@ -805,13 +805,13 @@ icvTraceContour_32s( int *ptr, int step, int *stop_ptr, int is_hole ) const int new_flag = (int)((unsigned)INT_MIN >> 1); const int value_mask = ~(right_flag | new_flag); const int ccomp_val = *i0 & value_mask; - + /* initialize local state */ CV_INIT_3X3_DELTAS( deltas, step, 1 ); memcpy( deltas + 8, deltas, 8 * sizeof( deltas[0] )); - + s_end = s = is_hole ? 0 : 4; - + do { s = (s - 1) & 7; @@ -820,9 +820,9 @@ icvTraceContour_32s( int *ptr, int step, int *stop_ptr, int is_hole ) break; } while( s != s_end ); - + i3 = i0; - + /* check single pixel domain */ if( s != s_end ) { @@ -830,17 +830,17 @@ icvTraceContour_32s( int *ptr, int step, int *stop_ptr, int is_hole ) for( ;; ) { s_end = s; - + for( ;; ) { i4 = i3 + deltas[++s]; if( (*i4 & value_mask) == ccomp_val ) break; } - + if( i3 == stop_ptr || (i4 == i0 && i3 == i1) ) break; - + i3 = i4; s = (s + 4) & 7; } /* end of border following loop */ @@ -869,24 +869,24 @@ icvFetchContourEx_32s( int* ptr, const int ccomp_val = *i0 & value_mask; const int nbd0 = ccomp_val | new_flag; const int nbd1 = nbd0 | right_flag; - + assert( (unsigned) _method <= CV_CHAIN_APPROX_SIMPLE ); - + /* initialize local state */ CV_INIT_3X3_DELTAS( deltas, step, 1 ); memcpy( deltas + 8, deltas, 8 * sizeof( deltas[0] )); - + /* initialize writer */ cvStartAppendToSeq( contour, &writer ); - + if( method < 0 ) ((CvChain *)contour)->origin = pt; - + rect.x = rect.width = pt.x; rect.y = rect.height = pt.y; - + s_end = s = CV_IS_SEQ_HOLE( contour ) ? 0 : 4; - + do { s = (s - 1) & 7; @@ -895,7 +895,7 @@ icvFetchContourEx_32s( int* ptr, break; } while( s != s_end ); - + if( s == s_end ) /* single pixel domain */ { *i0 = nbd1; @@ -908,12 +908,12 @@ icvFetchContourEx_32s( int* ptr, { i3 = i0; prev_s = s ^ 4; - + /* follow border */ for( ;; ) { s_end = s; - + for( ;; ) { i4 = i3 + deltas[++s]; @@ -921,7 +921,7 @@ icvFetchContourEx_32s( int* ptr, break; } s &= 7; - + /* check "right" bound */ if( (unsigned) (s - 1) < (unsigned) s_end ) { @@ -931,7 +931,7 @@ icvFetchContourEx_32s( int* ptr, { *i3 = nbd0; } - + if( method < 0 ) { schar _s = (schar) s; @@ -941,7 +941,7 @@ icvFetchContourEx_32s( int* ptr, { CV_WRITE_SEQ_ELEM( pt, writer ); } - + if( s != prev_s ) { /* update bounds */ @@ -949,37 +949,37 @@ icvFetchContourEx_32s( int* ptr, rect.x = pt.x; else if( pt.x > rect.width ) rect.width = pt.x; - + if( pt.y < rect.y ) rect.y = pt.y; else if( pt.y > rect.height ) rect.height = pt.y; } - + prev_s = s; pt.x += icvCodeDeltas[s].x; pt.y += icvCodeDeltas[s].y; - + if( i4 == i0 && i3 == i1 ) break; - + i3 = i4; s = (s + 4) & 7; } /* end of border following loop */ } - + rect.width -= rect.x - 1; rect.height -= rect.y - 1; - + cvEndWriteSeq( &writer ); - + if( _method != CV_CHAIN_CODE ) ((CvContour*)contour)->rect = rect; - + assert( (writer.seq->total == 0 && writer.seq->first == 0) || writer.seq->total > writer.seq->first->count || (writer.seq->first->prev == writer.seq->first && writer.seq->first->next == writer.seq->first) ); - + if( _rect ) *_rect = rect; } @@ -1005,7 +1005,7 @@ cvFindNextContour( CvContourScanner scanner ) int nbd = scanner->nbd; int prev = img[x - 1]; int new_mask = -2; - + if( mode == CV_RETR_FLOODFILL ) { prev = ((int*)img)[x - 1]; @@ -1017,13 +1017,13 @@ cvFindNextContour( CvContourScanner scanner ) int* img0_i = 0; int* img_i = 0; int p = 0; - + if( mode == CV_RETR_FLOODFILL ) { img0_i = (int*)img0; img_i = (int*)img; } - + for( ; x < width; x++ ) { if( img_i ) @@ -1036,10 +1036,10 @@ cvFindNextContour( CvContourScanner scanner ) for( ; x < width && (p = img[x]) == prev; x++ ) ; } - + if( x >= width ) break; - + { _CvContourInfo *par_info = 0; _CvContourInfo *l_cinfo = 0; @@ -1053,7 +1053,7 @@ cvFindNextContour( CvContourScanner scanner ) { /* check hole */ if( (!img_i && (p != 0 || prev < 1)) || - (img_i && ((prev & new_mask) != 0 || (p & new_mask) != 0))) + (img_i && ((prev & new_mask) != 0 || (p & new_mask) != 0))) goto resume_scan; if( prev & new_mask ) @@ -1219,7 +1219,7 @@ cvFindNextContour( CvContourScanner scanner ) return l_cinfo->contour; resume_scan: - + prev = p; /* update lnbd */ if( prev & -2 ) @@ -1663,7 +1663,7 @@ cvFindContours( void* img, CvMemStorage* storage, if( !firstContour ) CV_Error( CV_StsNullPtr, "NULL double CvSeq pointer" ); - + *firstContour = 0; if( method == CV_LINK_RUNS ) @@ -1733,7 +1733,7 @@ void cv::findContours( InputOutputArray _image, OutputArrayOfArrays _contours, { _hierarchy.create(1, total, CV_32SC4, -1, true); Vec4i* hierarchy = _hierarchy.getMat().ptr(); - + it = all_contours.begin(); for( i = 0; i < total; i++, ++it ) { @@ -1753,116 +1753,6 @@ void cv::findContours( InputOutputArray _image, OutputArrayOfArrays _contours, findContours(_image, _contours, noArray(), mode, method, offset); } -namespace cv -{ - -static void addChildContour(InputArrayOfArrays contours, - size_t ncontours, - const Vec4i* hierarchy, - int i, vector& seq, - vector& block) -{ - for( ; i >= 0; i = hierarchy[i][0] ) - { - Mat ci = contours.getMat(i); - cvMakeSeqHeaderForArray(CV_SEQ_POLYGON, sizeof(CvSeq), sizeof(Point), - !ci.empty() ? (void*)ci.data : 0, (int)ci.total(), - &seq[i], &block[i] ); - - int h_next = hierarchy[i][0], h_prev = hierarchy[i][1], - v_next = hierarchy[i][2], v_prev = hierarchy[i][3]; - seq[i].h_next = (size_t)h_next < ncontours ? &seq[h_next] : 0; - seq[i].h_prev = (size_t)h_prev < ncontours ? &seq[h_prev] : 0; - seq[i].v_next = (size_t)v_next < ncontours ? &seq[v_next] : 0; - seq[i].v_prev = (size_t)v_prev < ncontours ? &seq[v_prev] : 0; - - if( v_next >= 0 ) - addChildContour(contours, ncontours, hierarchy, v_next, seq, block); - } -} - -} - -void cv::drawContours( InputOutputArray _image, InputArrayOfArrays _contours, - int contourIdx, const Scalar& color, int thickness, - int lineType, InputArray _hierarchy, - int maxLevel, Point offset ) -{ - Mat image = _image.getMat(), hierarchy = _hierarchy.getMat(); - CvMat _cimage = image; - - size_t ncontours = _contours.total(); - size_t i = 0, first = 0, last = ncontours; - vector seq; - vector block; - - if( !last ) - return; - - seq.resize(last); - block.resize(last); - - for( i = first; i < last; i++ ) - seq[i].first = 0; - - if( contourIdx >= 0 ) - { - CV_Assert( 0 <= contourIdx && contourIdx < (int)last ); - first = contourIdx; - last = contourIdx + 1; - } - - for( i = first; i < last; i++ ) - { - Mat ci = _contours.getMat((int)i); - if( ci.empty() ) - continue; - int npoints = ci.checkVector(2, CV_32S); - CV_Assert( npoints > 0 ); - cvMakeSeqHeaderForArray( CV_SEQ_POLYGON, sizeof(CvSeq), sizeof(Point), - ci.data, npoints, &seq[i], &block[i] ); - } - - if( hierarchy.empty() || maxLevel == 0 ) - for( i = first; i < last; i++ ) - { - seq[i].h_next = i < last-1 ? &seq[i+1] : 0; - seq[i].h_prev = i > first ? &seq[i-1] : 0; - } - else - { - size_t count = last - first; - CV_Assert(hierarchy.total() == ncontours && hierarchy.type() == CV_32SC4 ); - const Vec4i* h = hierarchy.ptr(); - - if( count == ncontours ) - { - for( i = first; i < last; i++ ) - { - int h_next = h[i][0], h_prev = h[i][1], - v_next = h[i][2], v_prev = h[i][3]; - seq[i].h_next = (size_t)h_next < count ? &seq[h_next] : 0; - seq[i].h_prev = (size_t)h_prev < count ? &seq[h_prev] : 0; - seq[i].v_next = (size_t)v_next < count ? &seq[v_next] : 0; - seq[i].v_prev = (size_t)v_prev < count ? &seq[v_prev] : 0; - } - } - else - { - int child = h[first][2]; - if( child >= 0 ) - { - addChildContour(_contours, ncontours, h, child, seq, block); - seq[first].v_next = &seq[child]; - } - } - } - - cvDrawContours( &_cimage, &seq[first], color, color, contourIdx >= 0 ? - -maxLevel : maxLevel, thickness, lineType, offset ); -} - - void cv::approxPolyDP( InputArray _curve, OutputArray _approxCurve, double epsilon, bool closed ) { @@ -1934,7 +1824,7 @@ double cv::matchShapes( InputArray _contour1, CV_Assert(contour1.checkVector(2) >= 0 && contour2.checkVector(2) >= 0 && (contour1.depth() == CV_32F || contour1.depth() == CV_32S) && contour1.depth() == contour2.depth()); - + CvMat c1 = Mat(contour1), c2 = Mat(contour2); return cvMatchShapes(&c1, &c2, method, parameter); } @@ -1945,13 +1835,13 @@ void cv::convexHull( InputArray _points, OutputArray _hull, bool clockwise, bool Mat points = _points.getMat(); int nelems = points.checkVector(2), depth = points.depth(); CV_Assert(nelems >= 0 && (depth == CV_32F || depth == CV_32S)); - + if( nelems == 0 ) { _hull.release(); return; } - + returnPoints = !_hull.fixedType() ? returnPoints : _hull.type() != CV_32S; Mat hull(nelems, 1, returnPoints ? CV_MAKETYPE(depth, 2) : CV_32S); CvMat _cpoints = points, _chull = hull; @@ -1970,23 +1860,23 @@ void cv::convexityDefects( InputArray _points, InputArray _hull, OutputArray _de Mat hull = _hull.getMat(); CV_Assert( hull.checkVector(1, CV_32S) > 2 ); Ptr storage = cvCreateMemStorage(); - + CvMat c_points = points, c_hull = hull; CvSeq* seq = cvConvexityDefects(&c_points, &c_hull, storage); int i, n = seq->total; - + if( n == 0 ) { _defects.release(); return; } - + _defects.create(n, 1, CV_32SC4); Mat defects = _defects.getMat(); - + SeqIterator it = Seq(seq).begin(); CvPoint* ptorg = (CvPoint*)points.data; - + for( i = 0; i < n; i++, ++it ) { CvConvexityDefect& d = *it; @@ -2034,9 +1924,9 @@ void cv::fitLine( InputArray _points, OutputArray _line, int distType, CvMat _cpoints = points.reshape(2 + (int)is3d); float line[6]; cvFitLine(&_cpoints, distType, param, reps, aeps, &line[0]); - + int out_size = (is2d)?( (is3d)? (points.channels() * points.rows * 2) : 4 ): 6; - + _line.create(out_size, 1, CV_32F, -1, true); Mat l = _line.getMat(); CV_Assert( l.isContinuous() ); diff --git a/modules/legacy/doc/expectation_maximization.rst b/modules/legacy/doc/expectation_maximization.rst index 38b4461..4884232 100644 --- a/modules/legacy/doc/expectation_maximization.rst +++ b/modules/legacy/doc/expectation_maximization.rst @@ -75,8 +75,6 @@ Estimates the Gaussian mixture parameters from a sample set. .. ocv:function:: bool CvEM::train( const CvMat* samples, const CvMat* sampleIdx=0, CvEMParams params=CvEMParams(), CvMat* labels=0 ) -.. ocv:pyfunction:: cv2.EM.train(samples[, sampleIdx[, params]]) -> retval, labels - :param samples: Samples from which the Gaussian mixture model will be estimated. :param sample_idx: Mask of samples to use. All samples are used by default. @@ -107,8 +105,6 @@ Returns a mixture component index of a sample. .. ocv:function:: float CvEM::predict( const CvMat* sample, CvMat* probs ) const -.. ocv:pyfunction:: cv2.EM.predict(sample) -> retval, probs - :param sample: A sample for classification. :param probs: If it is not null then the method will write posterior probabilities of each component given the sample data to this parameter. @@ -122,8 +118,6 @@ Returns the number of mixture components :math:`M` in the Gaussian mixture model .. ocv:function:: int CvEM::get_nclusters() const -.. ocv:pyfunction:: cv2.EM.getNClusters() -> retval - CvEM::getMeans ------------------ @@ -133,8 +127,6 @@ Returns mixture means :math:`a_k`. .. ocv:function:: const CvMat* CvEM::get_means() const -.. ocv:pyfunction:: cv2.EM.getMeans() -> means - CvEM::getCovs ------------- @@ -144,8 +136,6 @@ Returns mixture covariance matrices :math:`S_k`. .. ocv:function:: const CvMat** CvEM::get_covs() const -.. ocv:pyfunction:: cv2.EM.getCovs([covs]) -> covs - CvEM::getWeights ---------------- @@ -155,8 +145,6 @@ Returns mixture weights :math:`\pi_k`. .. ocv:function:: const CvMat* CvEM::get_weights() const -.. ocv:pyfunction:: cv2.EM.getWeights() -> weights - CvEM::getProbs -------------- @@ -166,8 +154,6 @@ Returns vectors of probabilities for each training sample. .. ocv:function:: const CvMat* CvEM::get_probs() const -.. ocv:pyfunction:: cv2.EM.getProbs() -> probs - For each training sample :math:`i` (that have been passed to the constructor or to :ocv:func:`CvEM::train`) returns probabilities :math:`p_{i,k}` to belong to a mixture component :math:`k`. @@ -179,8 +165,6 @@ Returns logarithm of likelihood. .. ocv:function:: double CvEM::get_log_likelihood() const -.. ocv:pyfunction:: cv2.EM.getLikelihood() -> likelihood - CvEM::write ----------- diff --git a/modules/legacy/doc/feature_detection_and_description.rst b/modules/legacy/doc/feature_detection_and_description.rst index 16d3ad3..fbec994 100644 --- a/modules/legacy/doc/feature_detection_and_description.rst +++ b/modules/legacy/doc/feature_detection_and_description.rst @@ -81,22 +81,22 @@ RandomizedTree::train ------------------------- Trains a randomized tree using an input set of keypoints. -.. ocv:function:: void train(std::vector const& base_set, RNG& rng, PatchGenerator& make_patch, int depth, int views, size_t reduced_num_dim, int num_quant_bits) +.. ocv:function:: void RandomizedTree::train( vector const& base_set, RNG & rng, int depth, int views, size_t reduced_num_dim, int num_quant_bits ) -.. ocv:function:: void train(std::vector const& base_set, RNG& rng, PatchGenerator& make_patch, int depth, int views, size_t reduced_num_dim, int num_quant_bits) +.. ocv:function:: void RandomizedTree::train( vector const& base_set, RNG & rng, PatchGenerator & make_patch, int depth, int views, size_t reduced_num_dim, int num_quant_bits ) :param base_set: Vector of the ``BaseKeypoint`` type. It contains image keypoints used for training. - + :param rng: Random-number generator used for training. - + :param make_patch: Patch generator used for training. - + :param depth: Maximum tree depth. :param views: Number of random views of each keypoint neighborhood to generate. :param reduced_num_dim: Number of dimensions used in the compressed signature. - + :param num_quant_bits: Number of bits used for quantization. @@ -105,9 +105,9 @@ RandomizedTree::read ------------------------ Reads a pre-saved randomized tree from a file or stream. -.. ocv:function:: read(const char* file_name, int num_quant_bits) +.. ocv:function:: RandomizedTree::read(const char* file_name, int num_quant_bits) -.. ocv:function:: read(std::istream &is, int num_quant_bits) +.. ocv:function:: RandomizedTree::read(std::istream &is, int num_quant_bits) :param file_name: Name of the file that contains randomized tree data. @@ -121,9 +121,9 @@ RandomizedTree::write ------------------------- Writes the current randomized tree to a file or stream. -.. ocv:function:: void write(const char* file_name) const +.. ocv:function:: void RandomizedTree::write(const char* file_name) const -.. ocv:function:: void write(std::ostream &os) const +.. ocv:function:: void RandomizedTree::write(std::ostream &os) const :param file_name: Name of the file where randomized tree data is stored. @@ -133,7 +133,7 @@ Writes the current randomized tree to a file or stream. RandomizedTree::applyQuantization ------------------------------------- -.. ocv:function:: void applyQuantization(int num_quant_bits) +.. ocv:function:: void RandomizedTree::applyQuantization(int num_quant_bits) Applies quantization to the current randomized tree. @@ -240,26 +240,26 @@ RTreeClassifier::train -------------------------- Trains a randomized tree classifier using an input set of keypoints. -.. ocv:function:: void train(vector const& base_set, RNG& rng, int num_trees = RTreeClassifier::DEFAULT_TREES, int depth = DEFAULT_DEPTH, int views = DEFAULT_VIEWS, size_t reduced_num_dim = DEFAULT_REDUCED_NUM_DIM, int num_quant_bits = DEFAULT_NUM_QUANT_BITS, bool print_status = true) +.. ocv:function:: void RTreeClassifier::train( vector const& base_set, RNG & rng, int num_trees=RTreeClassifier::DEFAULT_TREES, int depth=RandomizedTree::DEFAULT_DEPTH, int views=RandomizedTree::DEFAULT_VIEWS, size_t reduced_num_dim=RandomizedTree::DEFAULT_REDUCED_NUM_DIM, int num_quant_bits=DEFAULT_NUM_QUANT_BITS ) -.. ocv:function:: void train(vector const& base_set, RNG& rng, PatchGenerator& make_patch, int num_trees = RTreeClassifier::DEFAULT_TREES, int depth = DEFAULT_DEPTH, int views = DEFAULT_VIEWS, size_t reduced_num_dim = DEFAULT_REDUCED_NUM_DIM, int num_quant_bits = DEFAULT_NUM_QUANT_BITS, bool print_status = true) +.. ocv:function:: void RTreeClassifier::train( vector const& base_set, RNG & rng, PatchGenerator & make_patch, int num_trees=RTreeClassifier::DEFAULT_TREES, int depth=RandomizedTree::DEFAULT_DEPTH, int views=RandomizedTree::DEFAULT_VIEWS, size_t reduced_num_dim=RandomizedTree::DEFAULT_REDUCED_NUM_DIM, int num_quant_bits=DEFAULT_NUM_QUANT_BITS ) :param base_set: Vector of the ``BaseKeypoint`` type. It contains image keypoints used for training. - + :param rng: Random-number generator used for training. - + :param make_patch: Patch generator used for training. - + :param num_trees: Number of randomized trees used in ``RTreeClassificator`` . - + :param depth: Maximum tree depth. :param views: Number of random views of each keypoint neighborhood to generate. :param reduced_num_dim: Number of dimensions used in the compressed signature. - + :param num_quant_bits: Number of bits used for quantization. - + :param print_status: Current status of training printed on the console. @@ -268,9 +268,9 @@ RTreeClassifier::getSignature --------------------------------- Returns a signature for an image patch. -.. ocv:function:: void getSignature(IplImage *patch, uchar *sig) +.. ocv:function:: void RTreeClassifier::getSignature(IplImage *patch, uchar *sig) -.. ocv:function:: void getSignature(IplImage *patch, float *sig) +.. ocv:function:: void RTreeClassifier::getSignature(IplImage *patch, float *sig) :param patch: Image patch to calculate the signature for. :param sig: Output signature (array dimension is ``reduced_num_dim)`` . @@ -278,15 +278,15 @@ Returns a signature for an image patch. RTreeClassifier::getSparseSignature ---------------------------------------- +--------------------------------------- Returns a sparse signature for an image patch -.. ocv:function:: void getSparseSignature(IplImage *patch, float *sig, float thresh) +.. ocv:function:: void RTreeClassifier::getSparseSignature(IplImage *patch, float *sig, float thresh) :param patch: Image patch to calculate the signature for. - + :param sig: Output signature (array dimension is ``reduced_num_dim)`` . - + :param thresh: Threshold used for compressing the signature. Returns a signature for an image patch similarly to ``getSignature`` but uses a threshold for removing all signature elements below the threshold so that the signature is compressed. @@ -296,7 +296,7 @@ RTreeClassifier::countNonZeroElements ----------------------------------------- Returns the number of non-zero elements in an input array. -.. ocv:function:: static int countNonZeroElements(float *vec, int n, double tol=1e-10) +.. ocv:function:: static int RTreeClassifier::countNonZeroElements(float *vec, int n, double tol=1e-10) :param vec: Input vector containing float elements. @@ -310,9 +310,9 @@ RTreeClassifier::read ------------------------- Reads a pre-saved ``RTreeClassifier`` from a file or stream. -.. ocv:function:: read(const char* file_name) +.. ocv:function:: void RTreeClassifier::read(const char* file_name) -.. ocv:function:: read(std::istream& is) +.. ocv:function:: void RTreeClassifier::read( std::istream & is ) :param file_name: Name of the file that contains randomized tree data. @@ -324,9 +324,9 @@ RTreeClassifier::write -------------------------- Writes the current ``RTreeClassifier`` to a file or stream. -.. ocv:function:: void write(const char* file_name) const +.. ocv:function:: void RTreeClassifier::write(const char* file_name) const -.. ocv:function:: void write(std::ostream &os) const +.. ocv:function:: void RTreeClassifier::write(std::ostream &os) const :param file_name: Name of the file where randomized tree data is stored. @@ -338,7 +338,7 @@ RTreeClassifier::setQuantization ------------------------------------ Applies quantization to the current randomized tree. -.. ocv:function:: void setQuantization(int num_quant_bits) +.. ocv:function:: void RTreeClassifier::setQuantization(int num_quant_bits) :param num_quant_bits: Number of bits used for quantization. diff --git a/modules/legacy/doc/histograms.rst b/modules/legacy/doc/histograms.rst new file mode 100644 index 0000000..0405bf2 --- /dev/null +++ b/modules/legacy/doc/histograms.rst @@ -0,0 +1,95 @@ +Histograms +========== + +.. highlight:: cpp + + + +CalcPGH +------- +Calculates a pair-wise geometrical histogram for a contour. + +.. ocv:cfunction:: void cvCalcPGH( const CvSeq* contour, CvHistogram* hist ) + + :param contour: Input contour. Currently, only integer point coordinates are allowed. + + :param hist: Calculated histogram. It must be two-dimensional. + +The function calculates a 2D pair-wise geometrical histogram (PGH), described in [Iivarinen97]_ for the contour. The algorithm considers every pair of contour +edges. The angle between the edges and the minimum/maximum distances +are determined for every pair. To do this, each of the edges in turn +is taken as the base, while the function loops through all the other +edges. When the base edge and any other edge are considered, the minimum +and maximum distances from the points on the non-base edge and line of +the base edge are selected. The angle between the edges defines the row +of the histogram in which all the bins that correspond to the distance +between the calculated minimum and maximum distances are incremented +(that is, the histogram is transposed relatively to the definition in the original paper). The histogram can be used for contour matching. + + +.. [Iivarinen97] Jukka Iivarinen, Markus Peura, Jaakko Srel, and Ari Visa. *Comparison of Combined Shape Descriptors for Irregular Objects*, 8th British Machine Vision Conference, BMVC'97. http://www.cis.hut.fi/research/IA/paper/publications/bmvc97/bmvc97.html + + +QueryHistValue*D +---------------- +Queries the value of the histogram bin. + +.. ocv:cfunction:: float cvQueryHistValue_1D(CvHistogram hist, int idx0) +.. ocv:cfunction:: float cvQueryHistValue_2D(CvHistogram hist, int idx0, int idx1) +.. ocv:cfunction:: float cvQueryHistValue_3D(CvHistogram hist, int idx0, int idx1, int idx2) +.. ocv:cfunction:: float cvQueryHistValue_nD(CvHistogram hist, const int* idx) + +.. ocv:pyoldfunction:: cv.QueryHistValue_1D(hist, idx0) -> float +.. ocv:pyoldfunction:: cv.QueryHistValue_2D(hist, idx0, idx1) -> float +.. ocv:pyoldfunction:: cv.QueryHistValue_3D(hist, idx0, idx1, idx2) -> float +.. ocv:pyoldfunction:: cv.QueryHistValue_nD(hist, idx) -> float + + :param hist: Histogram. + + :param idx0: 0-th index. + + :param idx1: 1-st index. + + :param idx2: 2-nd index. + + :param idx: Array of indices. + +The macros return the value of the specified bin of the 1D, 2D, 3D, or N-D histogram. In case of a sparse histogram, the function returns 0. If the bin is not present in the histogram, no new bin is created. + +GetHistValue\_?D +---------------- +Returns a pointer to the histogram bin. + +.. ocv:cfunction:: float cvGetHistValue_1D(CvHistogram hist, int idx0) + +.. ocv:cfunction:: float cvGetHistValue_2D(CvHistogram hist, int idx0, int idx1) + +.. ocv:cfunction:: float cvGetHistValue_3D(CvHistogram hist, int idx0, int idx1, int idx2) + +.. ocv:cfunction:: float cvGetHistValue_nD(CvHistogram hist, int idx) + + :param hist: Histogram. + + :param idx0: 0-th index. + + :param idx1: 1-st index. + + :param idx2: 2-nd index. + + :param idx: Array of indices. + +:: + + #define cvGetHistValue_1D( hist, idx0 ) + ((float*)(cvPtr1D( (hist)->bins, (idx0), 0 )) + #define cvGetHistValue_2D( hist, idx0, idx1 ) + ((float*)(cvPtr2D( (hist)->bins, (idx0), (idx1), 0 ))) + #define cvGetHistValue_3D( hist, idx0, idx1, idx2 ) + ((float*)(cvPtr3D( (hist)->bins, (idx0), (idx1), (idx2), 0 ))) + #define cvGetHistValue_nD( hist, idx ) + ((float*)(cvPtrND( (hist)->bins, (idx), 0 ))) + +.. + +The macros ``GetHistValue`` return a pointer to the specified bin of the 1D, 2D, 3D, or N-D histogram. In case of a sparse histogram, the function creates a new bin and sets it to 0, unless it exists already. + diff --git a/modules/legacy/doc/legacy.rst b/modules/legacy/doc/legacy.rst index e102ec6..bea8945 100644 --- a/modules/legacy/doc/legacy.rst +++ b/modules/legacy/doc/legacy.rst @@ -9,6 +9,7 @@ legacy. Deprecated stuff motion_analysis expectation_maximization + histograms planar_subdivisions feature_detection_and_description common_interfaces_of_descriptor_extractors diff --git a/modules/legacy/doc/planar_subdivisions.rst b/modules/legacy/doc/planar_subdivisions.rst index 7cd8ee8..f01e11a 100644 --- a/modules/legacy/doc/planar_subdivisions.rst +++ b/modules/legacy/doc/planar_subdivisions.rst @@ -19,7 +19,7 @@ Planar subdivision. CvSubdiv2DEdge recent_edge; \ CvPoint2D32f topleft; \ CvPoint2D32f bottomright; - + typedef struct CvSubdiv2D { CV_SUBDIV2D_FIELDS() @@ -64,13 +64,13 @@ Quad-edge of a planar subdivision. /* one of edges within quad-edge, lower 2 bits is index (0..3) and upper bits are quad-edge pointer */ typedef long CvSubdiv2DEdge; - + /* quad-edge structure fields */ #define CV_QUADEDGE2D_FIELDS() \ int flags; \ struct CvSubdiv2DPoint* pt[4]; \ CvSubdiv2DEdge next[4]; - + typedef struct CvQuadEdge2D { CV_QUADEDGE2D_FIELDS() @@ -97,9 +97,9 @@ Point of an original or dual subdivision. CvSubdiv2DEdge first; \ CvPoint2D32f pt; \ int id; - + #define CV_SUBDIV2D_VIRTUAL_POINT_FLAG (1 << 30) - + typedef struct CvSubdiv2DPoint { CV_SUBDIV2D_POINT_FIELDS() @@ -135,7 +135,7 @@ Removes all virtual points. :param subdiv: Delaunay subdivision. The function removes all of the virtual points. It -is called internally in +is called internally in :ocv:cfunc:`CalcSubdivVoronoi2D` if the subdivision was modified after the previous call to the function. @@ -145,7 +145,7 @@ CreateSubdivDelaunay2D Creates an empty Delaunay triangulation. .. ocv:cfunction:: CvSubdiv2D* cvCreateSubdivDelaunay2D( CvRect rect, CvMemStorage* storage ) -.. ocv:pyoldfunction:: cv.CreateSubdivDelaunay2D(rect, storage)-> emptyDelaunayTriangulation +.. ocv:pyoldfunction:: cv.CreateSubdivDelaunay2D(rect, storage) -> CvSubdiv2D :param rect: Rectangle that includes all of the 2D points that are to be added to the subdivision. @@ -157,7 +157,7 @@ subdivision where 2D points can be added using the function . All of the points to be added must be within the specified rectangle, otherwise a runtime error is raised. -Note that the triangulation is a single large triangle that covers the given rectangle. Hence the three vertices of this triangle are outside the rectangle +Note that the triangulation is a single large triangle that covers the given rectangle. Hence the three vertices of this triangle are outside the rectangle ``rect`` . @@ -192,7 +192,7 @@ Returns the edge destination. The function returns the edge destination. The returned pointer may be NULL if the edge is from a dual subdivision and the virtual point coordinates are not calculated yet. The virtual points -can be calculated using the function +can be calculated using the function :ocv:cfunc:`CalcSubdivVoronoi2D`. Subdiv2DGetEdge @@ -235,9 +235,9 @@ Returns next edge around the edge origin. :param edge: Subdivision edge (not a quad-edge). -The function returns the next edge around the edge origin: +The function returns the next edge around the edge origin: ``eOnext`` -on the picture above if +on the picture above if ``e`` is the input edge). @@ -259,33 +259,33 @@ Returns the location of a point within a Delaunay triangulation. The function locates the input point within the subdivision. There are five cases: * - The point falls into some facet. The function returns + The point falls into some facet. The function returns ``CV_PTLOC_INSIDE`` - and + and ``*edge`` will contain one of edges of the facet. * - The point falls onto the edge. The function returns + The point falls onto the edge. The function returns ``CV_PTLOC_ON_EDGE`` - and + and ``*edge`` will contain this edge. * - The point coincides with one of the subdivision vertices. The function returns + The point coincides with one of the subdivision vertices. The function returns ``CV_PTLOC_VERTEX`` - and + and ``*vertex`` will contain a pointer to the vertex. * - The point is outside the subdivision reference rectangle. The function returns + The point is outside the subdivision reference rectangle. The function returns ``CV_PTLOC_OUTSIDE_RECT`` and no pointers are filled. * - One of input arguments is invalid. A runtime error is raised or, if silent or "parent" error processing mode is selected, + One of input arguments is invalid. A runtime error is raised or, if silent or "parent" error processing mode is selected, ``CV_PTLOC_ERROR`` is returnd. diff --git a/modules/ml/doc/expectation_maximization.rst b/modules/ml/doc/expectation_maximization.rst index 216ff51..b79dea8 100644 --- a/modules/ml/doc/expectation_maximization.rst +++ b/modules/ml/doc/expectation_maximization.rst @@ -173,7 +173,7 @@ EM::predict ----------- Returns a likelihood logarithm value and an index of the most probable mixture component for the given sample. -.. ocv:function:: Vec2d predict(InputArray sample, OutputArray probs=noArray()) const +.. ocv:function:: Vec2d EM::predict(InputArray sample, OutputArray probs=noArray()) const .. ocv:pyfunction:: cv2.EM.predict(sample[, probs]) -> retval, probs diff --git a/modules/objdetect/doc/cascade_classification.rst b/modules/objdetect/doc/cascade_classification.rst index 5a02095..6b3a357 100644 --- a/modules/objdetect/doc/cascade_classification.rst +++ b/modules/objdetect/doc/cascade_classification.rst @@ -239,7 +239,7 @@ CascadeClassifier::runAt ---------------------------- Runs the detector at the specified point. -.. ocv:function:: int CascadeClassifier::runAt( Ptr& feval, Point pt ) +.. ocv:function:: int CascadeClassifier::runAt( Ptr& feval, Point pt, double& weight ) .. ocv:cfunction:: int cvRunHaarClassifierCascade( const CvHaarClassifierCascade* cascade, CvPoint pt, int start_stage=0 ) diff --git a/modules/objdetect/doc/latent_svm.rst b/modules/objdetect/doc/latent_svm.rst index 3eab55c..17dd388 100644 --- a/modules/objdetect/doc/latent_svm.rst +++ b/modules/objdetect/doc/latent_svm.rst @@ -256,7 +256,7 @@ LatentSvmDetector::getClassCount -------------------------------- Return a count of loaded models (classes). -.. ocv:function:: size_t getClassCount() const +.. ocv:function:: size_t LatentSvmDetector::getClassCount() const .. [Felzenszwalb2010] Felzenszwalb, P. F. and Girshick, R. B. and McAllester, D. and Ramanan, D. *Object Detection with Discriminatively Trained Part Based Models*. PAMI, vol. 32, no. 9, pp. 1627-1645, September 2010 diff --git a/modules/objdetect/include/opencv2/objdetect/objdetect.hpp b/modules/objdetect/include/opencv2/objdetect/objdetect.hpp index 1b87943..7568986 100644 --- a/modules/objdetect/include/opencv2/objdetect/objdetect.hpp +++ b/modules/objdetect/include/opencv2/objdetect/objdetect.hpp @@ -425,8 +425,8 @@ protected: template friend int predictCategoricalStump( CascadeClassifier& cascade, Ptr &featureEvaluator, double& weight); - bool setImage( Ptr&, const Mat& ); - virtual int runAt( Ptr&, Point, double& weight ); + bool setImage( Ptr& feval, const Mat& image); + virtual int runAt( Ptr& feval, Point pt, double& weight ); class Data { diff --git a/modules/python/src2/hdr_parser.py b/modules/python/src2/hdr_parser.py index b422c0c..5f91bb0 100755 --- a/modules/python/src2/hdr_parser.py +++ b/modules/python/src2/hdr_parser.py @@ -281,7 +281,7 @@ class CppHeaderParser(object): apos = fdecl.find("(") if fname.endswith("operator"): - fname += "()" + fname += " ()" apos = fdecl.find("(", apos+1) fname = "cv." + fname.replace("::", ".") @@ -600,7 +600,7 @@ class CppHeaderParser(object): break w = stmt[:colon_pos].strip() if w in ["public", "protected", "private"]: - if w == "public": + if w == "public" or (not self.wrap_mode and w == "protected"): stack_top[self.PUBLIC_SECTION] = True else: stack_top[self.PUBLIC_SECTION] = False diff --git a/modules/stitching/doc/autocalib.rst b/modules/stitching/doc/autocalib.rst index feeeea5..a9c0c35 100644 --- a/modules/stitching/doc/autocalib.rst +++ b/modules/stitching/doc/autocalib.rst @@ -7,13 +7,13 @@ detail::focalsFromHomography ---------------------------- Tries to estimate focal lengths from the given homography under the assumption that the camera undergoes rotations around its centre only. -.. ocv:function:: void focalsFromHomography(const Mat &H, double &f0, double &f1, bool &f0_ok, bool &f1_ok) +.. ocv:function:: void detail::focalsFromHomography(const Mat &H, double &f0, double &f1, bool &f0_ok, bool &f1_ok) :param H: Homography. :param f0: Estimated focal length along X axis. - :param f1: Estimated focal length along Y axis. + :param f1: Estimated focal length along Y axis. :param f0_ok: True, if f0 was estimated successfully, false otherwise. @@ -23,7 +23,7 @@ detail::estimateFocal --------------------- Estimates focal lengths for each given camera. -.. ocv:function:: void estimateFocal(const std::vector &features, const std::vector &pairwise_matches, std::vector &focals) +.. ocv:function:: void detail::estimateFocal(const std::vector &features, const std::vector &pairwise_matches, std::vector &focals) :param features: Features of images. diff --git a/modules/stitching/doc/matching.rst b/modules/stitching/doc/matching.rst index 99be6af..b39d62c 100644 --- a/modules/stitching/doc/matching.rst +++ b/modules/stitching/doc/matching.rst @@ -64,7 +64,7 @@ detail::FeaturesFinder::find This method must implement features finding logic in order to make the wrappers `detail::FeaturesFinder::operator()`_ work. -.. ocv:function:: void find(const Mat &image, ImageFeatures &features) +.. ocv:function:: void detail::FeaturesFinder::find(const Mat &image, ImageFeatures &features) :param image: Source image @@ -171,7 +171,7 @@ Performs images matching. :param matches_info: Found matches -.. ocv:function:: void detail::FeaturesMatcher::operator ()(const std::vector &features, std::vector &pairwise_matches, const Mat &mask) +.. ocv:function:: void detail::FeaturesMatcher::operator ()( const std::vector & features, std::vector & pairwise_matches, const Mat & mask=Mat() ) :param features: Features of the source images diff --git a/modules/stitching/doc/motion_estimation.rst b/modules/stitching/doc/motion_estimation.rst index a58230e..1591689 100644 --- a/modules/stitching/doc/motion_estimation.rst +++ b/modules/stitching/doc/motion_estimation.rst @@ -7,9 +7,9 @@ detail::Estimator ----------------- .. ocv:class:: detail::Estimator -Rotation estimator base class. It takes features of all images, pairwise matches between all images and estimates rotations of all cameras. +Rotation estimator base class. It takes features of all images, pairwise matches between all images and estimates rotations of all cameras. -.. note:: The coordinate system origin is implementation-dependent, but you can always normalize the rotations in respect to the first camera, for instance. +.. note:: The coordinate system origin is implementation-dependent, but you can always normalize the rotations in respect to the first camera, for instance. :: @@ -18,12 +18,12 @@ Rotation estimator base class. It takes features of all images, pairwise matches public: virtual ~Estimator() {} - void operator ()(const std::vector &features, const std::vector &pairwise_matches, + void operator ()(const std::vector &features, const std::vector &pairwise_matches, std::vector &cameras) { estimate(features, pairwise_matches, cameras); } protected: - virtual void estimate(const std::vector &features, const std::vector &pairwise_matches, + virtual void estimate(const std::vector &features, const std::vector &pairwise_matches, std::vector &cameras) = 0; }; @@ -79,10 +79,10 @@ Base class for all camera parameters refinement methods. :: { public: const Mat refinementMask() const { return refinement_mask_.clone(); } - void setRefinementMask(const Mat &mask) - { + void setRefinementMask(const Mat &mask) + { CV_Assert(mask.type() == CV_8U && mask.size() == Size(3, 3)); - refinement_mask_ = mask.clone(); + refinement_mask_ = mask.clone(); } double confThresh() const { return conf_thresh_; } @@ -92,17 +92,17 @@ Base class for all camera parameters refinement methods. :: void setTermCriteria(const CvTermCriteria& term_criteria) { term_criteria_ = term_criteria; } protected: - BundleAdjusterBase(int num_params_per_cam, int num_errs_per_measurement) - : num_params_per_cam_(num_params_per_cam), - num_errs_per_measurement_(num_errs_per_measurement) - { + BundleAdjusterBase(int num_params_per_cam, int num_errs_per_measurement) + : num_params_per_cam_(num_params_per_cam), + num_errs_per_measurement_(num_errs_per_measurement) + { setRefinementMask(Mat::ones(3, 3, CV_8U)); - setConfThresh(1.); + setConfThresh(1.); setTermCriteria(cvTermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 1000, DBL_EPSILON)); } // Runs bundle adjustment - virtual void estimate(const std::vector &features, + virtual void estimate(const std::vector &features, const std::vector &pairwise_matches, std::vector &cameras); @@ -146,7 +146,7 @@ Construct a bundle adjuster base instance. .. ocv:function:: detail::BundleAdjusterBase::BundleAdjusterBase(int num_params_per_cam, int num_errs_per_measurement) :param num_params_per_cam: Number of parameters per camera - + :param num_errs_per_measurement: Number of error terms (components) per match detail::BundleAdjusterBase::setUpInitialCameraParams @@ -234,7 +234,7 @@ detail::waveCorrect ------------------- Tries to make panorama more horizontal (or vertical). -.. ocv:function:: void waveCorrect(std::vector &rmats, WaveCorrectKind kind) +.. ocv:function:: void detail::waveCorrect(std::vector &rmats, WaveCorrectKind kind) :param rmats: Camera rotation matrices. diff --git a/modules/stitching/doc/warpers.rst b/modules/stitching/doc/warpers.rst index 410a4ad..31fa7cb 100644 --- a/modules/stitching/doc/warpers.rst +++ b/modules/stitching/doc/warpers.rst @@ -66,7 +66,7 @@ detail::RotationWarper::warp Projects the image. -.. ocv:function:: Point detal::RotationWarper::warp(const Mat &src, const Mat &K, const Mat &R, int interp_mode, int border_mode, Mat &dst) +.. ocv:function:: Point detail::RotationWarper::warp(const Mat &src, const Mat &K, const Mat &R, int interp_mode, int border_mode, Mat &dst) :param src: Source image -- 2.7.4