gpt4 book ai didi

matlab - 清除图像中的噪声

转载 作者:太空宇宙 更新时间:2023-11-03 20:09:19 26 4
gpt4 key购买 nike

我需要知道如何使用 Matlab 清除图像中的噪声。

让我们看这个例子:

enter image description here enter image description here

如您所见,数字看起来不是很清楚。

那么如何清除噪声和不是数字的像素,以便更容易识别。

谢谢。

最佳答案

让我们在 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"

完成!

关于matlab - 清除图像中的噪声,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5312514/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com