How do you segment the image horizontally?
5 次查看(过去 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
0 个评论
采纳的回答
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
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/181882/image.png)
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
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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/174004/image.png)
5 个评论
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 Center 和 File Exchange 中查找有关 Language Support 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!