How to find the slant angle in an image?

I have a word which is cursive,hence it is slant. I want to segment the letters so i want to find the slant angle so the i can eliminate that which is helful for segmentation. Please help me with the code.

 Accepted Answer

See my attached demo where I use the radon transform to find the mean angle of an image by looking for the maximum projection value and then use imrotate() to rotate the image.

10 Comments

when i use this code for my image, i got the following output
That is the image only is getting tilted, not the word inside it. But i want the word 'and' which is slant to be erect.
To "unslant" words without rotating the image, use imwarp. Look at the documentation and see the code example on shearing the image.
Hello sir,i used imwrap and following is the output image.How to get the slant angle?
Or is Randon Transform Max at angle 62.0(in the output image) only the slant angle?
Please reply sir,Thank you
No, 62 is not necessarily the slant angle. You have to know what the radon transform means. It's the projected sum. Since your image's foreground is dark, that's a problem. The radon transform is brightest when the sum is brightest so you're summing up the background, not the letters and so you'd probably be more accurate inverting your image (255 minus your image) and then doing the radon transform.
oh ok sir ! now i did that and now i'm getting 101.0 instead of 62,what does it infer?is this the slant angle now?
Hello, can i ask about "unslant" the words without rotationg the image? i already tried to use imwrap in several ways and i can't find the solution. I'm already read the documentation on shearing the image, but still can't find the solution. Please help me with the code how to implement the imwrap to "unslant" the word without rotating the image. Thanks in advance
I don't have code for that. If it's something that is needed, then someone will have published a paper on it in the OCR literature here: http://www.visionbib.com/bibliography/contentschar.html#OCR,%20Document%20Analysis%20and%20Character%20Recognition%20Systems
I'll search the problem there, hope there's similiar problem with mine. Thanks for the reference, cheers.
Hey Meghashree, can you please share the code for calculating slant angle?

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!