Ask Your Question
1

Render Line/Curve around edge skeleton

asked 2012-07-09 00:19:02 -0500

Gradient gravatar image

updated 2018-11-12 11:01:18 -0500

Hello - After lot of funny processing, I am able to get edges. Here's one example in the screen shot - (http://www.messmyphoto.com/images/edges.jpg). Yellow line shown in the screenshot is set of connected pixels that can be traced as lines.

Looking for a high level guidance on how to render "perfect" lines/curves such that the skeleton of edges is preserved? Eclipse or bezier curve won't help because of the weird shapes.

Any ideas using Open CV?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2012-07-09 06:15:07 -0500

Michael Burdinov gravatar image

Can you please make other definition of what is "perfect" curves, because I am not sure I understand it correctly? Skeletonization of objects is a morphological operation that is unrelated to Bezier curves.

If you want thinner edges you may use Canny edge detection instead of your own. Its last stage is non-maximal suppression that results in one pixel wide edges. Canny's documentation

edit flag offensive delete link more

Comments

"Perfect" Curves - I want to use image gradient edges(which you currently see) guiding stroke rendering. Instead of pixels connected together, I want smooth cartoonish lines but without loosing the features. If I am using gradient direction to render strokes of smooth lines, then I am hardly able to go on for 4 to 5 pixels and then it doesn't give that continuity effect.. Is there any other method that could help?

Gradient gravatar imageGradient ( 2012-07-09 09:48:52 -0500 )edit

I guess your problem is extraction of longer lines from those gradients. One way to do that is by extracting polygons from those edges, and than applying some polygon approximation on them. You can do both by using findContours() function on your image of edges. Last parameter of this function is the approximation method that may be applied to found contours. Or you can find those contours by some other means and than apply approxPolyDP() function on them.

Michael Burdinov gravatar imageMichael Burdinov ( 2012-07-09 16:34:12 -0500 )edit
Login/Signup to Answer

Question Tools

Stats

Asked: 2012-07-09 00:19:02 -0500

Seen: 1,015 times

Last updated: Jul 09 '12