Clear Filters
Clear Filters

how to change angle of line in image

1 view (last 30 days)
Sandhu
Sandhu on 4 Jan 2012
hi, i want to know " how to change the angle of a line in this image. here i have a line with -45 dig. http://imageshack.us/photo/my-images/209/line45dig.jpg/
i want to make this to straight line. i tried imrotate(img,45); http://imageshack.us/f/221/strightline.jpg/ but if i did this entire line is splitting into small lines. i want the same continuous line with out any gaps. due to this i am loosing original data. so, if you have any ideas please suggest me.
Thanks in advance.

Answers (1)

Sean de Wolski
Sean de Wolski on 4 Jan 2012
Look at some of the interpolation options in:
doc imrotate
And perhaps try a different one.
You could also dilate the line before rotating it ( imdilate ) rotate it, and then skeletonize it after ( bwmorph with the skel option).
doc imdilate
doc bwmorph

Community Treasure Hunt

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

Start Hunting!