clean noise from an image

后端 未结 4 1616
北荒
北荒 2020-12-15 15:06

I need to know how to clean noise from an image with Matlab.

lets look at this example:

\"enter

4条回答
  •  Happy的楠姐
    2020-12-15 15:30

    Did you start with a bilevel (two color, black and white)? Or did you threshold it yourself?

    If it's the latter, you may find it easier to perform noise reduction before you threshold. In this case, please upload the image you have before thresholding.

    If it's the former, then you'll have a tough time as traditional noise reduction is concerned. The reason is that a lot of noise reduction approaches take advantage of the distinction in statistical properties between the noise and the actual natural image. By thresholding, that distinction is essentially destroyed.

    EDIT

    OK, technically, your image isn't really noisy -- it's blurry (letters are running into each other) and has background interference.

    But anyway, here is how I would deal with it:

    • Pick a color channel to work with (RGB is three channels, typically one is enough). I chose green because it looked the easiest to manipulate.
    • Blur the image (I used a 5x5 Gaussian kernel in GIMP)
    • Threshold using an empirically determined threshold (basically, try each threshold until you get a decent result). It's OK if some of the numbers have gaps -- we can close them in the next step
    • Morphological image processing (erosion and dilation)

    Green channel:

    enter image description here

    Blur (5x5 Gaussian):

    enter image description here

    Thresholded image (I used a threshold of ~93 in GIMP):

    enter image description here

    Final result:

    enter image description here

    You can see that the gaps in the middle 6 and 9 have dissapeared. Unfortunately, I couldn't get the gap in the left 3 to go away -- it's simply too large. Here's what the problems causing this are:

    • The line along the top of the image is much darker than some parts of the 3. If you use a threshold to remove the line, then a gap will be created. If you were to somehow remove that line (e.g. by more zealous cropping), the thresholding result would be much better as far as the 3 is concerned.
    • Also, the middle 2 and 6 are running together. Heavy thresholding is required to prevent them from both forming the same blob after thresholding.

提交回复
热议问题