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

Function icvCalcDist2D

deps/opencv/modules/imgproc/src/linefit.cpp:219–239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217}
218
219static double
220icvCalcDist2D( CvPoint2D32f * points, int count, float *_line, float *dist )
221{
222 int j;
223 float px = _line[2], py = _line[3];
224 float nx = _line[1], ny = -_line[0];
225 double sum_dist = 0.;
226
227 for( j = 0; j < count; j++ )
228 {
229 float x, y;
230
231 x = points[j].x - px;
232 y = points[j].y - py;
233
234 dist[j] = (float) fabs( nx * x + ny * y );
235 sum_dist += dist[j];
236 }
237
238 return sum_dist;
239}
240
241static double
242icvCalcDist3D( CvPoint3D32f * points, int count, float *_line, float *dist )

Callers 1

icvFitLine2DFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected