CPC G06T 7/74 (2017.01) [G06T 7/564 (2017.01); G06T 7/62 (2017.01); G06T 2207/10024 (2013.01); G06T 2207/20224 (2013.01); G06T 2207/30201 (2013.01)] | 18 Claims |
1. A distance measurement method, comprising:
obtaining an image of a target device, the image of the target device comprising a target object of a first color and a background object of a second color, the first color being different from the second color;
processing the image of the target device to obtain a processed image, the processed image comprising a processed target object of a third color and a processed background object of a fourth color;
detecting a contour of the processed target object of the third color;
calculating an area encircled by the contour; and
calculating a distance between a camera and the target device upon determination of the area encircled by the contour;
wherein processing the image of the target device comprises:
obtaining color component values in a color space of a pixel data of the image of the target device; and
converting the color component values into converted color component values based on a first conversion algorithm;
wherein the color component values of the pixel data comprise a first color component value and a second color component value;
wherein the first conversion algorithm comprises:
subtracting the second color component value of the pixel data from the first color component value of the pixel data to obtain a subtracted value; and
assigning an absolute value of the subtracted value as a color component value for each color component of the pixel data, thereby obtaining the converted color component values of the processed image.
|