How to segment cursive/connected (Arabic) word into characters?
Mostra commenti meno recenti
I want to segment the connected character. Based on the histogram/profile, i assume that I could segment the character based on it's baseline. but, I still couldn't built an appropriate code to make it works.
I hope, anyone could help :)
The following is the code that could segment isolated character very well. But, still not work for connected character.
% // Original Code by Soumyadeep Sinha //
% Saving each single segmented character as one file
function [segm] = trysegment (a)
myFolder = 'D:\1. Thesis FINISH!!!\Data set\trial';
level = graythresh (a);
bw = im2bw (a, level);
b = imcomplement (bw);
i= padarray(b,[0 10]);
verticalProjection = sum(i, 1);
set(gcf, 'Name', 'Trying Segmentation for Cursive', 'NumberTitle', 'Off')
subplot(2, 2, 1);imshow(i);
subplot(2,2,3);
plot(verticalProjection, 'b-'); %histogram show by this code
% hist(reshape(input,[],3),1:max(input(:)));
grid on;
% % t = verticalProjection;
% % t(t==0) = inf;
% % mayukh = min(t)
% 0 where there is background, 1 where there are letters
letterLocations = verticalProjection > 0;
% Find Rising and falling edges
d = diff(letterLocations);
startingColumns = find(d>0);
endingColumns = find(d<0);
% Extract each region
y=1;
for k = 1 : length(startingColumns)
% Get sub image of just one character...
subImage = i(:, startingColumns(k):endingColumns(k));
% se = strel('rectangle',[2 4]);
% dil = imdilate(subImage, se);
th = bwmorph(subImage,'thin',Inf);
n = imresize (th, [64 NaN], 'bilinear');
figure, imshow (n);
[L,num] = bwlabeln(n);
for z= 1 : num
bw= ismember(L, z);
% Construct filename for this particular image.
baseFileName = sprintf('char %d.png', y);
y=y+1;
% Prepend the folder to make the full file name.
fullFileName = fullfile(myFolder, baseFileName);
% Do the write to disk.
imwrite(bw, fullFileName);
% subplot(2,2,4);
% pause(2);
% imshow(bw);
end
% y=y+1;
end;
segm = (n);
This is the sample of image.

%
11 Commenti
Sivakumaran Chandrasekaran
il 6 Gen 2016
try ocr as well as number plate extraction method. it may help
ana ain
il 9 Gen 2016
Walter Roberson
il 10 Gen 2016
"number plate extraction" is something you could do on arabic letters if you were able to do the arabic ocr that is being looked for here. You would need to be able to do this task first. Likewise, ocr is what you are trying to do here.
ana ain
il 11 Gen 2016
Ainatul Radhiah
il 25 Ago 2016
Modificato: Ainatul Radhiah
il 25 Ago 2016
Hi Ana , Can I get coding for the segmentation of the Arabic alphabet that has been successful? I need for my thesis, thank you very much, this is my email ainawind27@gmail.com
Nina Angraheni
il 2 Mag 2017
Hi Ana , Can I get coding for the segmentation of the Arabic alphabet that has been successful? I need for my skripsi, thank you very much, this is my email g1a013005@gmail.com
hatem herzawy
il 20 Ott 2017
RaeD AL-JaaFari
il 30 Nov 2017
Mary Hamad
il 20 Apr 2018
can I have the code in my email address because I'm trying to develop OCR for Arabic and I also stuck here :( maryamhamad7@gmil.com
Mohamed sidhoum
il 1 Mar 2020
Modificato: Image Analyst
il 2 Mar 2020
Hey ana,
I want just a help. I saw in ResearchGate that a professor sent you the method on how to segment an Arabic handwriitng word with MATLAB, (with each letter of the word in a picture). Can please email me? I need the code for my mastery final project and I'm stuck.
email : sidhoummohamedcherif@gmail.com
Have a nice day .
Image Analyst
il 2 Mar 2020
Modificato: Image Analyst
il 2 Mar 2020
Mohamed, please see my attached demo for the Bengali language. Maybe it's similar enough for you to adapt.

Risposte (3)
chandrapal Singh
il 1 Dic 2017
0 voti
Blob analysis
Image Analyst
il 1 Dic 2017
23.4.8 Other Character Sets
23.4.8.1 Devanagari, Indic, Hindi, Hindu, Bangla, Bengali, Telugu, Characters
23.4.8.2 Arabic Character Recognition
23.4.8.3 Arabic Recognition, Word Level, Word Spotting
23.4.8.4 Farsi, Persian Character Recognition
ih ih
il 19 Dic 2019
0 voti
hi ana can get the code if u please
ineed ocr arbic to my help me in project
ih14111227@gmail.com
Categorie
Scopri di più su Language Support in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!