drawing - OPENCV - Pixel count -
i load image in opencv. draw line point(x1,y1) point(x2,y2). how count pixels on line?
try use
int cvinitlineiterator(const cvarr* image, cvpoint pt1, cvpoint pt2, cvlineiterator* line_iterator, int connectivity=8, int left_to_right=0)
you can find description here
"the function initializes line iterator , returns number of pixels between 2 end points. both points must inside image. after iterator has been initialized, points on raster line connects 2 ending points may retrieved successive calls of cv_next_line_point point. points on line calculated 1 one using 4-connected or 8-connected bresenham algorithm."
Comments
Post a Comment