javascript - Create shapes from Canny Edge Detection in Canvas -
does have idea on how can create shapes canny edge detection in canvas?
i assume here have canny edge detection implemented based on way question formulated -
you can use approach such this (written in java should easy enough translate javascript) and/or perhaps limited use of line-fitting approaches (statistical).
the essence have find out pixels connected , create polygon objects/arrays yourselves based on result of edge detection.
once have connected pixels can use point reduction algorithms such ramer–douglas–peucker algorithm (javascript implementation here) avoid polygons contain every single point of similar sloped lines , forth.
you run variety of challenges though such short segmented lines due noise in original image or "weak lines", clusters of "lines" makes hard find out how connect them polygons.
Comments
Post a Comment