Click here to Skip to main content
15,916,215 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to segment an Image(basically text/doc Image) into header footer body and in body extracting paragraph.Image is in binary form i.e m*n matrix element contain only 0 and 1
0-for black pixel i.e text and 1-for white pixel no text
I am thinking like this I start from top for header horizontal scan till a text line detect and for footer start from bottom go to top until a text line detect(black pixel) remaining part will be body but I am not able to write a code

What I have tried:

I tried in matlab but I want to write in c++
Posted
Updated 25-Feb-19 19:50pm
v2
Comments
OriginalGriff 22-Feb-19 3:07am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with.
Use the "Improve question" widget to edit your question and provide better information.
KarstenK 22-Feb-19 8:26am    
All printers have a printable area which is smaller than an A4 paper. So need to calculate with that. They may differ - so watch out.
Rick York 22-Feb-19 11:13am    
I recommend that you do NOT write this explicitly for A4-sized paper. Just think of what would happen if someone changed their mind and decided they want to use B-size paper. Parameterize the code so that the dimensions are arguments to it. There are really two main variables : the dimensions of the paper and the desired orientation, portrait or landscape. Users can be fickle so you might need to support both. I think you should make that decision up front.

1 solution

You need to start by getting the dimensions of the page and calculating the height and width of each section that you will print into. Then within each page section you calculate the size of a paragraph, column, margin etc. Try drawing the boxes on a real piece of A4 and then see what you need to do to calculate their sizes.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900