Traditional Culture Encyclopedia - Photography and portraiture - How to calculate the distance between two points (pixels) in an image

How to calculate the distance between two points (pixels) in an image

According to the method of coordinate system, the distance between two points in the image can be calculated.

Let the coordinates of two points in the image be m point (x 1, y 1) and n point (x2, y2).

So the distance between two points is: MN=√(x2-x 1)? -(y2-y 1)? .

For example: x 1=4, y 1=2, x2=7, y2=6,

So the deviation between these two points is: √(7-4)? -(6-2)? =5。

Extended data:

Pixel function:

The image quality of a digital camera is partly determined by pixels. When they are larger than a certain size, it is meaningless to compare them with pixels. The pixels of mainstream SLR digital cameras are around1000000, but 5 million pixels are enough for ordinary photography and home use.

Because the resolution of the display used by people is limited, generally from 1024×768 to 1920× 1200, if a picture with too high pixels is displayed at this resolution, the picture will be compressed to the size of the current screen.

At this time, the sharpness is too high and some pictures will be distorted. The imaging quality mainly depends on the size and quality of camera lens and photosensitive element.

Baidu Encyclopedia-Distance formula between two points