opencv - Get edge co-ordinates after edge detection (Canny) -


i have been working opencv short time, , have performed canny edge detection on image, , performed dilation after further separate object (in case square) background.

my problem, identify graspable regions in 2d using algorithm requires me handle co-ordinates of points in edges. there way can use opencv co-ordinates of corners can find equation of lines forming edge of square? know size of square. problem involves 2d co-ordinate geometry, , hence need co-ordinates.

i can provide image after edge detection , dilation if need be. appreciated lot.

just offering second method - not guaranteed work.

  • step 1: extract connected component , contours. can applied after canny edge detection step.
  • step 2: if contours approximation of square, can use bounding box directly.

the reason disclaimer works on clean results, without broken edges or gaps in canny edges, etc. if need more robust way of finding rectangles, hough transform necessary.


Comments