how to get potential segmentation columns(PSC) in an handwritten image?
Mostrar comentarios más antiguos
hello! im trying to segment individual characters of handwritten image . for that i have pre-procesed the image like binarisation , thinning. now my next step is PSC ( each column in the word image, for which the sum of foreground white pixels is 0 or 1 ).

in the attached image i have achieved till step (C) . after doing PSC the output will be as shown in step (d).
how do i achieve this ? please help me with the code. thank you
Respuestas (1)
Image Analyst
el 21 de Dic. de 2015
Take the sum vertically, then threshold at 1 or less:
horizontalProfile = sum(double(binaryImage), 1); % double may not be required - not sure.
logicalSpaceIndexes = horizontalProfile <= 1;
Now you have a logical vector that tells you whether a column has 0 or 1 binary pixel in it. If you want actual indexes, you can do
actualSpaceIndexes = find(logicalSpaceIndexes);
That may be more or less convenient to use, depending on what you want to do with the location information and how you want to use it.
14 comentarios
Meghashree G
el 22 de Dic. de 2015
Thank you sir.We are getting PSC.How to print All PSCs over-segmenting the word image in red color?? something like the below image!

Image Analyst
el 22 de Dic. de 2015
You can use fill() or patch(). Just give the 4 corner coordinates of each rectangle.
sindhu c
el 22 de Dic. de 2015
sindhu c
el 22 de Dic. de 2015
Image Analyst
el 22 de Dic. de 2015
You can use simple indexing, or the imcrop() function.
Meghashree G
el 23 de Dic. de 2015
sir,we are not getting you.we were referring one of the papers out of the links which you provided.There we got to know by PSC we can achieve character segmentation.NOw our task is draw lines based on PSC and do little modifications and then crop.So,first based on PSC,how do we draw lines as shown in the image (d. in the main figure which is attached along with the question).Please help us with the code to achieve this.Thank You
Image Analyst
el 23 de Dic. de 2015
I was answering sindhu where he wanted to "cut" the image. And he already has the left and right columns because you can see he already put up red rectangles in his image at the top of this page. And it sounds like you also already have the "PSC" segmentation (where the columns are). So assuming the columns are col1 and col2, then to cut out (crop) a rectangle of all the rows between column col1 and col2 you do this:
croppedImage = grayImage(:, col1:col2);
Meghashree G
el 23 de Dic. de 2015
sindhu is a girl.we are in the same team :) and no sir,she has asked in the question that she should get the red rectangles ,to visualize she has put up the image .she has not the red rectangles.So we are asking you how to put up that red rectangles.
that's fine sir.we are working on the implementation part,its just that we could'nt find the solution for the problems like this,so seeking your help :)
Meghashree G
el 23 de Dic. de 2015
she has clearly mentioned below the image that she has achieved till (c) in the image.Please see that
Image Analyst
el 23 de Dic. de 2015
Sorry, I didn't know she was a girl from the name (not my native language) and I didn't know you were on the same team. To put up red rectangles over the spaces, you can use fill() or patch(). But that requires that you know the coordinates of the vertices. Hopefully by following the algorithm in the paper you can find the columns that define the start and stop of the red zones. Then just use patch() or fill().
Meghashree G
el 6 de En. de 2016
Sir,the algorithm in the paper says like this.
step 3:This image is now converted from binary format to a RGB format as shown in Fig(c).
Now, it becomes computationally easier to display the PSC (Potential Segmentation Columns) in different color other than black and white.
Step 4: All PSCs over-segmenting the word image are printed in red color as shown in Fig.(d). It is clear from Fig.(d) that each column in the word image, for which the sum of foreground white pixels is 0 or 1, is a PSC and vertically cuts the word image.
Please do refer the attached code

After converting to RGB ,what should be done according to the algorithm??
Please do help me.Thank you
Meghashree G
el 6 de En. de 2016
Fig (c) and Fig (d) are the images in the main question
Image Analyst
el 6 de En. de 2016
I don't know why you want or need an RGB image. That image is not really needed for segmentation, it's just for your information/curiosity. To just indicate those red zones, just use patch() or fill() - it's easy.
Meghashree G
el 6 de En. de 2016
Yes sir i used rectangle function to indicate red lines.Now for one image i'm specifying the co-ordinates.But how to indicate those red lines for when different images is given as input?? I mean on what basis, the red lines should be drawn?sorry for asking too many questions.
Categorías
Más información sobre ROI-Based Processing en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
