Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

Smooth or blur image edges using opencv

$
0
0
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 ![image description](/upfiles/14805775415447323.png) i am using this image as input ![image description](/upfiles/14805775882884882.png)

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>