braille recognition using image processing
이전 댓글 표시
i have a braille character recognition research and i'm not very good in matlab .. i want to know how to compute the centroids of dots and do alignment for it and make cells of braille characters ..

this is my code
RGB = imread('braille.jpg');
I = rgb2gray(RGB);
I2 = imcrop(I,[14.5100 3.5100 189.9800 134.9800]);
h = ones(5,5) / 25;
I3=imfilter(I2,h);
I4 = imadjust(I3);
I5 = imcomplement(I4);
se = strel('disk',1);
I6 = imdilate(I5,se);
I7 = im2bw(I6, 0.4);
subplot(4,4,1)
imshow(RGB)
title('rgb')
subplot(4,4,2)
imshow(I)
title('gray Image')
subplot(4,4,3)
imshow(I2)
title('Cropped Image')
subplot(4,4,4)
imshow(I3)
title('filtered Image')
subplot(4,4,5)
imshow(I4)
title('contrast Image')
subplot(4,4,6)
imshow(I5)
title('complement Image')
subplot(4,4,7)
imshow(I6)
title('dilate Image')
댓글 수: 3
Star Strider
2016년 5월 7일
Your Question would be easier to Answer if you attach your 'braille.jpg' file.
Image Analyst
2016년 5월 7일
And, is the image a profilometer image (so it's the height/topography) or is it an RGB image like you're casting brightness on the sides of the dots and shadows beside them?
Ismail Alrawi
2016년 5월 7일
답변 (1개)
Image Analyst
2016년 5월 7일
This looks easy. First you need to decide the rows and columns that divide the image up into individual tiles for each character. Then you simply need to have a 3-by-2 template where you check each place in for the intensity. If it's dark it's a spot, if it's light it's paper
for k = 1 : 6
output(k) = subImage(row(k), col(k)) > 128
end
Then you can convert all the 6 output locations into an integer that is used in a look up table to give you the letter
index = 0;
for k = 1 : 6
index = index + 2^(k-1) * output(k);
end
theCharacter = yourLookUpTable(index);
댓글 수: 16
Ismail Alrawi
2016년 5월 7일
Image Analyst
2016년 5월 7일
If you have the template location data and you want us to run it because you need more help, then sure, you can upload it.
I would think translation into English text is what is needed. Then you can have it read it with code like this:
% Program to do text to speech.
% Get user's sentence
userPrompt = 'What do you want the computer to say?';
titleBar = 'Text to Speech';
defaultString = 'Hello World! MATLAB is an awesome program!';
caUserInput = inputdlg(userPrompt, titleBar, 1, {defaultString});
if isempty(caUserInput)
return;
end; % Bail out if they clicked Cancel.
caUserInput = char(caUserInput); % Convert from cell to string.
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
Speak(obj, caUserInput);
Ismail Alrawi
2016년 5월 7일
Image Analyst
2016년 5월 8일
Follow my algorithm. Don't do the text to speech part if you don't want to - that's completely optional. Note that I did not say to do filtering or contrast adjustment. It's not necessary. Filtering is not needed unless it's noisy - so much so that there are pixels in the dots that are the same intensity as the background. I did not see anything like that so filtering is not needed.
I did do binarization in a way when I compared the value to 128, but I did it on just 6 pixels, not the whole image so this way it will be faster. The value you should compare it to is half way between the dark dot intensity and the bright background intensity.
Again, the fastest way is to measure just 6 locations, then use those to build an index, and then look up the translated character from the lookup table. Don't do a template matching like with normxcorr2() or anything - that will be slower than a lookup table.
Really, it's fast and super easy so don't make it more complicated and time consuming than it needs to be.
Ismail Alrawi
2016년 5월 9일
Image Analyst
2016년 5월 10일
No - you did anyway what I specifically told you not to do. Again, no contrast adjustment is needed. No filtering is needed. No complementing is needed. No dilation is needed And you didn't define the lookup table. All you need to do is to check intensities and use those to determine the look up table index and then read off the letter. I'll see if I can spend some time on it to get you a little farther along.
Image Analyst
2016년 5월 10일
Ismail, try the attached .m file.

afif fadilah
2017년 3월 8일
excus me sir,, i've try your code, but this can't run because "Undefined function 'histogram' for input arguments of type 'uint8'. Error in matriks (line 66) histogram(grayImage); " what's wrong sir ? i use matlab R2012.
Walter Roberson
2017년 3월 8일
use hist() instead of histogram()
afif fadilah
2017년 3월 8일
thank's sir, i use histeq () ,,
afif fadilah
2017년 3월 8일
i have this image, what must i do for this image so that this image can running on your code ?

Walter Roberson
2017년 3월 8일
histeq() and histogram() are completely different purposes; you cannot substitute histeq() for histogram(). hist() is the older routine that most closely matches histogram()
Image Analyst
2017년 3월 8일
histogram() both computes the histogram and plots it. For an older version of MATLAB, you can use imhist() and bar():
[counts, grayLevels] = imhist(grayImage);
bar(grayLevels, counts];
grid on;
afif fadilah
2017년 3월 10일
thank you sir, i want to ask again, what should i do for my image above so that my image can run use your code (m.file).
Image Analyst
2017년 3월 10일
You need to change the line that says:
baseFileName = 'braille.jpg';
so that it refers to your image. Other than that, I don't know - just work through the code line by line and see what happens.
afif fadilah
2017년 3월 13일
i know that, but that not what i ask, ok, thanks sir, i'll see
카테고리
도움말 센터 및 File Exchange에서 Images에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!