Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

the drawing of line is not correct. Please read the docu

Result of line is: "Output line parameters. In case of 2D fitting, it should be a vector of 4 elements (like Vec4f) - (vx, vy, x0, y0), where (vx, vy) is a normalized vector collinear to the line and (x0, y0) is a point on the line"

therefore, draw the line using:

int length = 10;
line( src, Point(v[2],v[3]), Point(v[2]+v[0]*length,v[3]+v[1]*length, Scalar( 0, 0, 255 ), 3, 4 );