Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

Smooth or blur image edges using opencv

$
0
0

@Omer_Aslam wrote:

I want to feathere smooth or blur image edges using opencv.

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

please tell me how can i achieve desired result

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles