Ask Your Question

How to calculate approx. number of pixels between two points in an image?

asked 2018-09-23 07:33:14 -0500

abdur-rehman gravatar image

updated 2018-09-23 07:40:23 -0500

I want to calculate numbers of pixels between the midpoints of two lines. image description

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2018-09-23 11:48:16 -0500

holger gravatar image

Hi - well this should be very easy: Just get the x,y coodinates of the mindpoints and compute the diff. ie top mid (x1,y1) and bottom mid (x2,y2) -> ydiff: y2-y1; xdiff: x2-x1

In General If you want to compute the distance between two point you can use the euclidenean distance function. If you want to know what is the vector (in wich directions you must go to reach from start to end, representing the diff in pixels) just substract component wise(as done above)

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-09-23 07:33:14 -0500

Seen: 93 times

Last updated: Sep 23 '18