views:

224

answers:

2

I'm using OpenCV to fit a line from a set of points using cvFitLine()

cvFitLine() returns a normalized vector that is co-linear to the line and a point on the line. See details here

Using this information how can I get the equation of a line so that I can draw the line?

A: 
brainjam
A: 

Just draw a big line instead of solving for the boundaries. eg:

cv.Line(img, (x0-m*vx[0], y0-m*vy[0]), (x0+m*vx[0], y0+m*vy[0]), (0,0,0))

will do it for example.. for m large enough :)

karpathy