break an image file into multiple image files in matlab

1 view (last 30 days)
I need to process a source file(in .jpg). It contains a paragraph of text. I want to separate each line and produce it into separate files.
for eg I have an image file which contains:
Chicken Sandwich
Heavy Motor
Sign Language
I want to create 3 files. Each should contain one line. I want to break the file w.r.t the line spacing. How should I proceed ?

Accepted Answer

Image Analyst
Image Analyst on 24 Aug 2013
Try collapsing the image horizontally:
verticalProfile = sum(grayImage, 2);
then look for bright and dark regions that indicate where the lines of text start and stop.
  11 Comments
Image Analyst
Image Analyst on 25 Aug 2013
I plotted the histogram. Did you not notice it? What value do you think would split it into foreground and background the best?
EssCee
EssCee on 25 Aug 2013
Ah, Got it now. Thanks a lot sir for your help.

Sign in to comment.

More Answers (0)

Categories

Find more on Convert Image Type in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!