Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

how to find rectangles in image

hello, I need find the rectangle in the follow image: image description

i try to use Canny to find the edge, here is the result: image description

we can clearly see the rectange, my meth is: 1) find the top line: from up to down, get the first 255 point in edge image to make a point set, and to use RANSAC line fit methed to fit the line, if the line fabs(min(dx, dy)/max(dx, dy))<0.3, i sure find a horizon line or vertcal line, if the line is not horizon or vertcal, i think of it noise, i draw the noise line with dark line in edge, so the the noise is erased, and next, i try the same methed untill to find a horizon line. 2)to find other line, i try similer method. 3)finaly, i find the rectanle: image description but, i not satisfy my method, do you have other idear to solve this problem.

how to find rectangles in image

hello, I need find the rectangle in the follow image: image description

i try to use Canny to find the edge, here is the result: image description

we can clearly see the rectange, my meth is: 1) find the top line: from up to down, get the first 255 point in edge image to make a point set, and to use RANSAC line fit methed to fit the line, if the line fabs(min(dx, dy)/max(dx, dy))<0.3, i sure find a horizon line or vertcal line, if the line is not horizon or vertcal, i think of it noise, i draw the noise line with dark line in edge, so the the noise is erased, and next, i try the same methed untill to find a horizon line. 2)to find other line, i try similer method. 3)finaly, i find the rectanle: image description but, i not satisfy my method, do you have other idear to solve this problem.problem. here is the src image: C:\fakepath\src.jpg