Borrar filtros
Borrar filtros

Measurement angle of two drawn lines on Image.

9 visualizaciones (últimos 30 días)
metin atilgan
metin atilgan el 21 de Jun. de 2016
Respondida: NURUL AMIRA MHD RIZAL el 12 de Mayo de 2018
I need to measure angle between two lines that I drawed. Actually I want to measure angles on face image for example eyes angle. I will draw two lines on image and I want to know angle between them. I'm creating gui that includes distance and angle measurement.
Is it possible that measure angles between drawn lines by me?

Respuesta aceptada

Rime
Rime el 25 de Jun. de 2016
Editada: Rime el 25 de Jun. de 2016
Do you detect the eye and draw the lines manually? If so, Let's forget the application and generalize the question as "measure the angle between two lines".
We will first figure out how to measure the angle of a line. When you draw the line, actually you defines its two endpoints. Let's say point 1 with location (x1,y1) and point 2 with location (x2,y2). The angle of this line in cartesian coordinate (your image) can be calculated by its tangent.
theta1 = atan((y1-y2)/(x1-x2));
The angle of second line can be calculated in the same way. Let's say line 2 has two points (x3,y3) and (x4,y4).
theta2 = atan((y3-y4)/(x3-x4));
Then, the angle between this two lines are the difference of theta1 and theta 2.
theta = theta1-theta2
Please remember the result is with unit radians. If you want degree, multiple the result by 180/pi.
Let me know, if I didn't make it clear.

Más respuestas (1)

NURUL AMIRA MHD RIZAL
NURUL AMIRA MHD RIZAL el 12 de Mayo de 2018
How to draw the straight lines automatically on image? For example I am using a cyclist image on a bike. I want to draw lines at his outer body to get intersection lines.

Categorías

Más información sobre Image Processing Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by