How do you segment the image horizontally?

3 次查看(过去 30 天)
Hi guys... I have an image containing a handwritten sentence of four lines... i want to segment the image into 4 segmented parts horizontally, such that each segmented part contain each of the four line... can any one help???... any help is highly appreciated!!!
PS: the image to be segmented is binary image with black background and white handwritten characters on it

采纳的回答

Image Analyst
Image Analyst 2015-6-24
You could try summing the image horizontally:
verticalProfile = sum(binaryImage, 2);
then look for bright and non-bright rows. Or you could use a long horizontal structuring element and do a morphological closing with imclose() and then look for the big blobs.
I'm sure there are published algorithms that are much better that you can find here: http://www.visionbib.com/bibliography/contentschar.html#OCR,%20Document%20Analysis%20and%20Character%20Recognition%20Systems
  26 个评论
Meghashree G
Meghashree G 2016-1-25
Hello sir,i have many similar forms like this.But segmentation of lines is not correctly achieved .How to modify the code??Please help me with this.
Walter Roberson
Walter Roberson 2016-1-25
As Image Analyst already replied,
"Otherwise, look at the link I gave to the papers of people who study this as their main career. I don't do OCR and I'm sure my algorithms just off the top of my head are not as successful as those from someone whose full time job OCR is. Please see their published papers if you want something better."
OCR is not just a trick that you get the hang of, not just a matter of fixing off-by-one errors in indexing, not just a matter of knowing the right threshold to use. OCR takes a lot of work. There are a lot of different techniques with different strengths and weaknesses. You can find several hundred books and proceedings on Amazon.com on the topic. There are a number of different conferences on the topic. You can find over one million articles about optical character recognition on scholar.google.com . It is a hard topic to do well.
Image Analyst does not have time to read and understand all of those on your behalf. And I know that I have no interest in reading and understanding those on your behalf. Very few of the regular volunteers have expressed interest in OCR. When we need OCR, we use someone else's program instead of trying to design our own. For example we might call http://www.mathworks.com/help/vision/ref/ocr.html
Your situation has exceeded our available resources, so is time for you to start doing your research.

请先登录,再进行评论。

更多回答(1 个)

Meghashree G
Meghashree G 2016-4-6
Hello sir, i used your code for line segmentation ,but for the below form its not working!! what changes should i make in order to correctly achieve line segmentation ? i have attached your code also.
Please help me..thank you
  5 个评论
Meghashree G
Meghashree G 2016-4-8
Thank you very very much sir :) it worked :)
Divya
Divya 2017-1-17
Hi Image Analyst,
your code says,
??? Undefined function or method 'histogram' for input arguments of type 'uint8'.
What modifications need to be done??

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Language Support 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by