how to segment words in an image containing paragraph?
Mostra commenti meno recenti

In the image,now line segmentation is done! How to segment words?? Pls help me with the code.. Thank you
Risposte (2)
Image Analyst
il 26 Nov 2015
0 voti
For each line, do the same process as you did for the lines. Sum the image vertically and look for gaps.
5 Commenti
sindhu c
il 27 Nov 2015
sindhu c
il 27 Nov 2015
Image Analyst
il 27 Nov 2015
No - you're supposed to get the horizontal profile, NOT the vertical profile.
horizontalProfile = mean(thisLine, 1);
% Columns in a word will have a sum that's pretty low
darkColumns = horizontalProfile < 210; % or whatever works.
Now wherever darkColumns is true will be a column that has letters in it. You can find individual stretches of dark columns with bwlabel
labeledColumns = bwlabel(darkColumns);
Not sure what you want to do after this. If you want to extract separate words, use ismember(), for example to get the third word
word3 = ismember(labeledColumns, 3); These are logical columns
% Extract only those columns from word #3 from the sentence band:
wordNumber3 = thisLine(:, word3); % wordNumber3 is a 2D image.
sindhu c
il 27 Nov 2015
sindhu c
il 27 Nov 2015
Divya
il 17 Gen 2017
0 voti
Hi Image Analyst,
Thank you for the code to segment lines. But I'm unable to segment with this code.
For the same image given above, the statement "darkColumns = horizontalProfile < 210; " gives zero column.
And when labeling such column doesn't give any result.
I tried changing threshold values. But I am getting stuck in labeling the columns. Can you please help me
Categorie
Scopri di più su Language Support in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
