MCPcopy Create free account
hub / github.com/creatale/node-dv / approxPolyDP

Method approxPolyDP

deps/opencv/modules/imgproc/src/contours.cpp:1871–1885  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1869
1870
1871void cv::approxPolyDP( InputArray _curve, OutputArray _approxCurve,
1872 double epsilon, bool closed )
1873{
1874 Mat curve = _curve.getMat();
1875 int npoints = curve.checkVector(2), depth = curve.depth();
1876 CV_Assert( npoints >= 0 && (depth == CV_32S || depth == CV_32F));
1877 CvMat _ccurve = curve;
1878 MemStorage storage(cvCreateMemStorage());
1879 CvSeq* result = cvApproxPoly(&_ccurve, sizeof(CvContour), storage, CV_POLY_APPROX_DP, epsilon, closed);
1880 if( result->total > 0 )
1881 {
1882 _approxCurve.create(result->total, 1, CV_MAKETYPE(curve.depth(), 2), -1, true);
1883 cvCvtSeqToArray(result, _approxCurve.getMat().data );
1884 }
1885}
1886
1887
1888double cv::arcLength( InputArray _curve, bool closed )

Callers

nothing calls this directly

Calls 6

cvApproxPolyFunction · 0.85
cvCvtSeqToArrayFunction · 0.85
checkVectorMethod · 0.80
getMatMethod · 0.45
depthMethod · 0.45
createMethod · 0.45

Tested by

no test coverage detected