| 1869 | |
| 1870 | |
| 1871 | void 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 | |
| 1888 | double cv::arcLength( InputArray _curve, bool closed ) |
nothing calls this directly
no test coverage detected