clean noise from an image

后端 未结 4 1603
北荒
北荒 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条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-15 15:36

    Let's do it step by step in Mathematica:

    (*first separate the image in HSB channels*)
    i1 = ColorSeparate[ColorNegate@yourColorImage, "HSB"]
    

    enter image description here

    (*Let's keep the B Channel*)
    i2 = i1[[3]]
    

    enter image description here

    (*And Binarize it *)
    i3 = Binarize[i2, 0.92]
    

    enter image description here

    (*Perform a Thinning to get the skeleton*)
    i4 = Thinning[i3]
    

    enter image description here

    (*Now we cut those hairs*)
    i5 = Pruning[i4, 10]
    

    enter image description here

    (*Remove the small lines*)
    i6 = DeleteSmallComponents[i5, 30]
    

    enter image description here

    (*And finally dilate*)
    i7 = Dilation[i6, 3]
    

    enter image description here

    (*Now we can perform an OCR*)
    TextRecognize@i7
    -->"93 269 23"  
    

    Done!

提交回复
热议问题