MATLAB Answers


how to align the line detected to the middle of the image

Asked by PEIYU LIM on 20 Apr 2019
Latest activity Commented on by PEIYU LIM on 22 Apr 2019
The two transmission line is detected and then how can I align that two blue lines to the middle of the image which are symmetrically


Sign in to comment.

1 Answer

Answer by Image Analyst
on 20 Apr 2019
 Accepted Answer

Presumably you know the angle if the line(s) since you plotted them over the grayscale image. So use imrotate() to rotate it, then use imtranslate() to shift it.


If let say I want to make it automatically, its possible for me to do it?
Yes, though after it's been rotated, it might be a little tricky to figure out how much to translate it. I don't have any code for that, so give it a try and attach your script if you can't figure it out.
Because I have a series of image which is slightly changed about the alignment.
So I'm finding the solution that can auto align the line to the middle and straight after the line has been detected.

Sign in to comment.