How to calculate the angle between two lines from the same origin?
Show older comments

Please I need help on this, I have extracted severla minutia points from this fingerprint image and I have been able to calculate the angle of each minutia according to the ridge direction, which i have dipslayed in green small arrows, and i want to take one of the minutia as a reference point and calculate the distance and angle each other minutia forms with the reference minutia, that is the angles in orange color, please help me on this. thanks
8 Comments
Adam Danz
on 9 Jun 2020
In your image, which minutia is the reference point? Is it the one toward the bottom-left at the vertex of the angles? If so, that would be the center of your axes (0,0) as shown in the image below. Is that correct? Under this coordinate system, to get the orange angles you can rotate minutia coordinates so that the black line between the origin and minutia2 is horizontal and then it would easier to compute the angles of all minutia to that reference line.

Fego Etese
on 9 Jun 2020
Fego Etese
on 9 Jun 2020
Edited: Fego Etese
on 9 Jun 2020
Adam Danz
on 9 Jun 2020
Angles are generally in reference to the x-axis as shown in this lesson.
Angles require 2 lines. If the line between (0,0) and minutia2 is the reference line, all points should be rotated so that this line lays on the x-axis. The image below shows you the concept but you wouldn't need to rotate the image. You would just apply a rotation matrix to the (x,y) coordinates of each minutea so that if you plot the rotated versions they would appear in the same positions as the image below, assuming you've already shifted them so that the reference dot is at (0,0). To determine the amount of rotation to apply, you would just compute the angle between the black line that extends from (0,0) to Minutia2 and the x-axis in the image from my previous comment.

Fego Etese
on 9 Jun 2020
Fego Etese
on 9 Jun 2020
Edited: Fego Etese
on 9 Jun 2020
Adam Danz
on 9 Jun 2020
Yes, that's also possible. Good idea.
Fego Etese
on 9 Jun 2020
Edited: Fego Etese
on 9 Jun 2020
Accepted Answer
More Answers (1)
David Hill
on 9 Jun 2020
Seems like just a math problem. If you have two vectors A and B, then angle between them is:
angle = acos(dot(A,B)/norm(A)/norm(B));
4 Comments
Fego Etese
on 9 Jun 2020
David Hill
on 9 Jun 2020
The vectors can be generated by using the coordinates of the image.
Fego Etese
on 9 Jun 2020
Edited: Fego Etese
on 9 Jun 2020
David Hill
on 9 Jun 2020
You need four pixel points, to generate the three vectors from the origin. It does not matter what the magnitudes are since they get divided out to compute the angle.
Categories
Find more on Image Filtering and Enhancement 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!