How should I denoise the image to extract the characters from the image?

4 ビュー (過去 30 日間)
Kartik Bharadwaj
Kartik Bharadwaj 2017 年 9 月 20 日
回答済み: Ramnarayan Krishnamurthy 2017 年 9 月 22 日
</matlabcentral/answers/uploaded_files/88526/test.png> I tried to denoise the image using Gaussian filter and imerosion, however I am losing the characters in the process.

回答 (1 件)

Ramnarayan Krishnamurthy
Ramnarayan Krishnamurthy 2017 年 9 月 22 日
A possible approach to solve the above problem is as follows:
% Read in the image
Iin = rgb2gray(imread('test.png'));
% Bottom Hat filtering to enhance the "valleys"
I1 = imbothat(Iin,strel('diamond',5)),strel('diamond',1);
% Opening with a horizontal element
I2 = imopen(I1,strel('arbitrary',[1 1 1]));
% Opening with a vertical element
I3 = imopen(I2,strel('arbitrary',[1 1 1]'));
% Binarize
I4 = ~imbinarize(I3,.8);
imshow(I4)
I believe that the OCR reader would be robust enough to read in these alphabets now.
Another approach specific to this image would involve addressing the 2 conspicuous noises: 1) Salt and pepper noise 2) Random lines
Removing the salt and pepper noise is pretty simple using a median filter.
imshow(medfilt2(Iin))
Removing the lines may be slightly more complex. Consider using the hough transform to locate and remove the undesired lines. The example describes how to find the houghlines in an image:
You would now have to remove these lines and then perform basic operations to have it in the desired format.
Hope this helps!

カテゴリ

Help Center および File ExchangeImages についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by