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

Method fitLine

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

Source from the content-addressed store, hash-verified

2028
2029
2030void 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
2052double cv::pointPolygonTest( InputArray _contour,

Callers

nothing calls this directly

Calls 8

cvFitLineFunction · 0.85
checkVectorMethod · 0.80
getMatMethod · 0.45
depthMethod · 0.45
reshapeMethod · 0.45
channelsMethod · 0.45
createMethod · 0.45
isContinuousMethod · 0.45

Tested by

no test coverage detected