2

I need to perform image smoothing. I've searched the web but I didn't find anything - every thing I tried doesn't preform like I want.

for example: enter image description here enter image description here

as you see there are bumps or something like stairs, so what should I do so the lines will be straight?

thanks....

Chris A.
  • 6,817
  • 2
  • 25
  • 43
Ofir A.
  • 3,112
  • 11
  • 57
  • 83
  • 1
    You may want to take a look at [SO: Image smoothing](http://stackoverflow.com/q/6085796/277290) – YetAnotherUser Jun 09 '11 at 16:18
  • You probably want to use morphological operators for this - try doing an `erode` followed by a `dilate`. – Paul R Jun 09 '11 at 16:28
  • Google spacial anti-aliasing filter – Phonon Jun 09 '11 at 16:29
  • A couple questions: Is your final output image resolution higher than the resolution of the stairs, or the same resolution? Is your output binary or grayscale? The answer to these questions changes the answer slightly. Spatial anti-aliasing filter is the answer (as Phonon said) if the answers are "same" then "grayscale" – Chris A. Jun 09 '11 at 19:05

1 Answers1

3

If the resolution of the output image is higher than the resolution of the stairs, then you can do any number of things. To name a few.

  1. grayscale (or binary) morphological processing using imclose
  2. edge-enhancing smoothing
  3. march around the edges of your objects, determine the corners in your mask, and make the image locally convex, but this will take some coding.

The Matlab File Exchange is your friend.

If the resolution of the output image is the same as the stairs, and the output is grayscale, you're pretty much constrained to spatial anti-aliasing filters.

If the resolution of the output image is the same as the stairs, and the output is binary, you can't do anything, obviously.

Chris A.
  • 6,817
  • 2
  • 25
  • 43
  • what do you mean in "If the resolution of the output image is higher than the resolution of the stairs"? if I'm understand you correctly so the resolution of the output image is the same as the input, but I'm zooming it to see if there is the stairs because I'm preform OCR and I'm think that this is disturbing the Identification. the output image is binary. thanks – Ofir A. Jun 09 '11 at 19:47
  • What I mean is that your output resolution could have a large number of pixels (say a 5x5 block of pixels) for every 1 of the pixels we're seeing above. If it were (and this comes up sometimes) then you'd do different approaches. This is apparently not the case though. Since you have a binary output, I don't know what you can do. Maybe you can mock up an image of what you'd like your output to look like? – Chris A. Jun 09 '11 at 20:17
  • and if my image where in gray scale, what then should I do? because I have the numbers in gray scale also, and maybe I'll check them to. thanks again. – Ofir A. Jun 09 '11 at 20:40
  • Read above. I believe that Phonon suggested the right answer for this [spatial anti-aliasing filters](http://en.wikipedia.org/wiki/Spatial_anti-aliasing). – Chris A. Jun 09 '11 at 20:48
  • do you know if I can do it in Matlab? – Ofir A. Jun 09 '11 at 20:54