| 2028 | |
| 2029 | |
| 2030 | void cv::fitLine( InputArray _points, OutputArray _line, int distType, |
| 2031 | double param, double reps, double aeps ) |
| 2032 | { |
| 2033 | Mat points = _points.getMat(); |
| 2034 | |
| 2035 | bool is3d = points.checkVector(3) >= 0; |
| 2036 | bool is2d = points.checkVector(2) >= 0; |
| 2037 | |
| 2038 | CV_Assert( (is2d || is3d) && (points.depth() == CV_32F || points.depth() == CV_32S) ); |
| 2039 | CvMat _cpoints = points.reshape(2 + (int)is3d); |
| 2040 | float line[6]; |
| 2041 | cvFitLine(&_cpoints, distType, param, reps, aeps, &line[0]); |
| 2042 | |
| 2043 | int out_size = (is2d)?( (is3d)? (points.channels() * points.rows * 2) : 4 ): 6; |
| 2044 | |
| 2045 | _line.create(out_size, 1, CV_32F, -1, true); |
| 2046 | Mat l = _line.getMat(); |
| 2047 | CV_Assert( l.isContinuous() ); |
| 2048 | memcpy( l.data, line, out_size * sizeof(line[0]) ); |
| 2049 | } |
| 2050 | |
| 2051 | |
| 2052 | double cv::pointPolygonTest( InputArray _contour, |
nothing calls this directly
no test coverage detected