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

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

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

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

add a comment

1

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)

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

Seen: **93 times**

Last updated: **Sep 23 '18**

Area of a single pixel object in OpenCV

build problems for android_binary_package - Eclipse Indigo, Ubuntu 12.04

OpenCV DescriptorMatcher matches

OpenCV for Android (2.4.2): OpenCV Loader imports not resolved

Can't compile .cu file when including opencv.hpp

Weird result while finding angle

Using OpenCV's stitching module, strange error when compositing images

compile error in opencv2/flann/lsh_table.h when compiling bgslibrary

Copyright OpenCV foundation, 2012-2018. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.