Ask Your Question
2

Getting a smooth outline for a picture

asked 2012-11-05 00:20:58 -0600

vickoza gravatar image

updated 2012-11-05 20:41:24 -0600

I want to use OpenCV to convert a raster image to a vector based image my first step is to create a smooth outline of the objects in the image. To do this I use Cammy to find the edges and use FindContour to get the outline but the data I get from FindContours is jagged and rough. Also I am finding the FindContour is giving my broken and double contours I want to merge these contours. I thank the problem is with the setting I want to used the data from FindContours to smooth the image data rather then has a pixalated image. I want to a polyline or a spline curve

Thanks again in advance

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted
4

answered 2012-11-05 03:56:07 -0600

Ben gravatar image

You can use approxPolyDP() to simplify the contours returned from findContours().

edit flag offensive delete link more
0

answered 2013-03-14 04:09:03 -0600

disha gravatar image

You should first apply watershed segmentation on the image, nextly apply smoothing(median) preferably so as to clear the salt and pepper noise on the binary image obtained and lastly take the contours of the image. Hope this works.

edit flag offensive delete link more
0

answered 2012-11-07 21:01:21 -0600

you can use cvPyrSegmentation or cvPyrMeanShiftFiltering to vectorize the raster image

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2012-11-05 00:20:58 -0600

Seen: 7,760 times

Last updated: Mar 14 '13