Ask Your Question

Shao Ming's profile - activity

2013-08-29 22:23:28 -0500 asked a question how FillEdgeCollection( in cvDrawContours ) works

Hi, everyone I have just read the codes about cvDrawContours. And OpenCV documents say that cvDrawContours words based on Bresenham algorithm. I read the paper about Bresenham algorithm, but still cannot understand what OpenCV does with that algorithm. cvDrawContours mainly include two functions which named CollectPolyEdges and FillEdgeCollection. The former one is just collect edges based on some "key-points" achieved from contours. So FillEdgeCollection is used to fill these collections. But how it works? the type vector<polyedge>& edges only include four members:y0,y1,x,dx.
y0 is seems always less than y1, and dx is slope of the line connecting two points.But what are those sentences mean( in FillEdgeCollection ): keep_prelast->x += keep_prelast->dx; prelast->x += prelast->dx; Somebody help me! thx!