4

Is it possible to refine or blur just the edges in an image with the white background ? I was thinking to get an edge mask of the image ( i already got it). After that use that mask to apply blur or smoothing function on the original image. So that only the edges will be blurred or refined. But i don't know how to achieve this.

Thanks

user2404353
  • 43
  • 1
  • 1
  • 3
  • You are on the right track. You should have three images: SOURCE, EDGES(SOURCE) and BLURED(SOURCE). Then you need to blend SOURCE and BLURED(SOURCE) with a per pixel weight based on the edges. Like BLEND(SOURCE,BLURED(SOURCE),EDGES(SOURCE)). I don't know OpenCV, so no real answer. But maybe this helps. There are also better techniques to use the edges as actual factors in you blur convolution filter, but the first method is much easier. – starmole Jun 18 '13 at 05:46

1 Answers1

5

If you have an edge mask of the image, do that:

  1. Dilate(edgemask)
  2. Copy(source: original, destination: blurred)
  3. Smooth(blurred)
  4. Copy(source: blurred, destination: original, mask: edgemask)

And your "original" image will be blurred.

Boyko Perfanov
  • 3,007
  • 18
  • 34
  • hello, thanks alot for your reply... this is my input image (http://oi43.tinypic.com/dg2z5u.jpg).... and i got this edge mask (http://oi41.tinypic.com/5768i.jpg).... dilate function is returning me a blank white image... :( – user2404353 Jun 19 '13 at 04:25
  • you need to invert the mask, white on black. – Boyko Perfanov Jun 19 '13 at 04:31
  • @BoykoPerfanov Hi I need help for one my question here http://stackoverflow.com/questions/21795643/image-edge-smoothing-with-opencv – iphonic Feb 15 '14 at 09:38
  • @user2404353 image link has been broken – EAS Apr 02 '22 at 12:30