How to find the margin in an image of the text document?

10 views (last 30 days)
I have a sample of handwriting. And I want to find the left, right and top margin[i.e., the space between the starting of the writing and the edge of the paper to the left is the left margin]. Please help me with the code.

Accepted Answer

Image Analyst
Image Analyst on 17 Dec 2015
Did you try to threshold and then use regionprops(L, 'BoundingBox')?
If the shadows on the paper are a problem then call edge() first and then get the bounding box from the edge image.
Image Analyst
Image Analyst on 5 Sep 2021
I don't want to answer your question in @Poornima Gokhale's discussion. So like I said, start your own question somewhere else (NOT here) and I'll answer there. @Poornima Gokhale probably doesn't care about your problem.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!