0

I want to smooth or blur image edges using opencv. i follow some links on stackoverflow but did not get accurate result.

This is what i tried

int lowThreshold = 100;
int ratio = 3;
int kernelSize = 3;

Mat srcGray, cannyEdges, blurred;
cvtColor(input, srcGray, CV_BGR2GRAY);
blur(srcGray, cannyEdges, Size(3, 3));
Canny(cannyEdges, cannyEdges, lowThreshold, lowThreshold * ratio, kernelSize);

int dilation_size = 5;
Mat element = getStructuringElement(MORPH_CROSS,
                                    Size(2 * dilation_size + 1, 2 * dilation_size + 1),
                                    Point(dilation_size, dilation_size));

dilate(cannyEdges, cannyEdges, element);
input.copyTo(blurred);
blur(blurred, blurred, Size(3, 3));
blurred.copyTo(output, cannyEdges);

This is the image of my input, my output and desired result See this

i am using this image as input

Input Image

Bharat
  • 2,441
  • 3
  • 24
  • 36
Omer
  • 650
  • 5
  • 15
  • I already follow these links [link](http://stackoverflow.com/questions/21795643/image-edge-smoothing-with-opencv), [link](http://stackoverflow.com/questions/17161088/how-to-refine-or-blur-or-smooth-just-the-edges) – Omer Nov 30 '16 at 12:56
  • plz give some answer – Omer Dec 06 '16 at 12:54

0 Answers0