This article takes you through the two pulses of “image-machine vision” related functions (for python)

Nowadays, artificial intelligence is hot, and the accompanying machine vision is also very promising. Machine vision is closely related to image processing. Now I will explain in detail the related functions of image processing and computer vision to help you get through the relationship between image processing and computer vision~~~~~
Insert picture description here

image.binary_to_grayscale(binary_image_value)

Returns the gray value (0-255) corresponding to the binary value (0-1).

image.binary_to_rgb(binary_image_value)

Returns the tuple (r, g, b) in RGB888 format corresponding to the binary value (0-1).

image.binary_to_lab(binary_image_value)

Returns the LAB format tuple (l, a, b) corresponding to the binary value (0-1).
The range of L is 0 to 100, and the range of A and B is -128 to 128.

image.binary_to_yuv(binary_image_value)

Returns the tuple (y, u, v) in the YUV format corresponding to the binary value (0-1).

The range of Y is 0 to 255, and the range of U and V is -128 to 128.

image.grayscale_to_binary(grayscale_value)

Returns the binary value (0-1) corresponding to the gray value (0-255).

image.grayscale_to_rgb(grayscale_value)

Returns the RGB888 format tuple (r, g, b) corresponding to the gray value (0-255).

annotation

Use the RGB565->RGB888 process for conversion, so this method will not return accurate values ​​like the pure RGB888 system. However, the image library is correct to work this way internally.

image.grayscale_to_lab(grayscale_value)

Returns the LAB format tuple (l, a, b) corresponding to the gray value (0-255).

The range of L is 0 to 100, and the range of A and B is -128 to 128.

annotation

RGB565->LAB process is used for conversion, so this method will not return the exact value like pure LAB system. However, the image library is correct to work this way internally.

image.grayscale_to_yuv(grayscale_value)

Returns the tuple (y, u, v) in the YUV format corresponding to the gray value (0-255).

The range of Y is 0 to 255, and the range of U and V is -128 to 128.

annotation

Use the RGB565->YUV process for conversion, so this method will not return the exact value like a pure YUV system. However, the image library is correct to work this way internally.

image.rgb_to_binary(rgb_tuple)

Returns the binary value (0-1) of the center range threshold corresponding to the tuple (r, g, b) in RGB888 format.

annotation

RGB888->RGB565 process is used for conversion, so this method will not return accurate values ​​like pure RGB888 system. However, the image library is correct to work this way internally.

image.rgb_to_grayscale(rgb_tuple)

Returns the gray value (0-255) corresponding to the tuple (r, g, b) in RGB888 format.

annotation

RGB888->RGB565 process is used for conversion, so this method will not return accurate values ​​like pure RGB888 system. However, the image library is correct to work this way internally.

image.rgb_to_lab(rgb_tuple)

Return the LAB format tuple (l, a, b) corresponding to the RGB888 format tuple (r, g, b).

The range of L is 0 to 100, and the range of A and B is -128 to 128.

annotation

RGB888->RGB565 process is used for conversion, so this method will not return accurate values ​​like pure RGB888 system.
However, the image library is correct to work this way internally.

image.rgb_to_yuv(rgb_tuple)

Returns the tuple (y, u, v) in the YUV format corresponding to the tuple (r, g, b) in RGB888 format.

The range of Y is 0 to 255, and the range of U and V is -128 to 128.

annotation

RGB888->RGB565 process is used for conversion, so this method will not return accurate values ​​like pure RGB888 system. However, the image library is correct to work this way internally.

image.lab_to_binary(lab_tuple)

Returns the binary value (0-1) of the center range threshold corresponding to the tuple (l, a, b) in LAB format.

annotation

Use the LAB->RGB565 process for conversion, so this method will not return the exact value like a pure LAB system. However, the image library is correct to work this way internally.

image.lab_to_grayscale(lab_tuple)

Returns the gray value (0-255) corresponding to the tuple (l, a, b) in LAB format.

annotation

Use the LAB->RGB565 process for conversion, so this method will not return the exact value like a pure LAB system. However, the image library is correct to work this way internally.

image.lab_to_rgb(lab_tuple)

Returns the tuple (r, g, b) in RGB888 format corresponding to the tuple lab_tuple (l, a, b) in LAB format.

annotation

Use the LAB->RGB565 process for conversion, so this method will not return the exact value like a pure LAB system. However, the image library is correct to work this way internally.

image.lab_to_yuv(lab_tuple)

Returns the tuple (y, u, v) in the YUV format corresponding to the tuple (l, a, b) in the LAB format.

The range of Y is 0 to 255, and the range of U and V is -128 to 128.

annotation

Use the LAB->RGB565 process for conversion, so this method will not return the exact value like a pure LAB system. However, the image library is correct to work this way internally.

image.yuv_to_binary(yuv_tuple)

Returns the binary value (0-1) of the center range threshold corresponding to the tuple (y, u, v) in YUV format.

annotation

The YUV->RGB565 process is used for conversion, so this method will not return the exact value like a pure YUV system. However, the image library is correct to work this way internally.

image.yuv_to_grayscale(yuv_tuple)

Returns the gray value (0-255) corresponding to the tuple (y, u, v) in YUV format.

annotation

The YUV->RGB565 process is used for conversion, so this method will not return the exact value like a pure YUV system. However, the image library is correct to work this way internally.

image.yuv_to_rgb(lab_tuple)

Returns the tuple (r, g, b) in the RGB888 format corresponding to the tuple (y, u, v) in the YUV format.

annotation

The YUV->RGB565 process is used for conversion, so this method will not return the exact value like a pure YUV system. However, the image library is correct to work this way internally.

image.yuv_to_lab(yuv_tuple)

Returns the tuple (l, a, b) in the LAB format corresponding to the tuple (y, u, v) in the YUV format.

The range of L is 0 to 100, and the range of A and B is -128 to 128.

annotation

The YUV->RGB565 process is used for conversion, so this method will not return the exact value like a pure YUV system. However, the image library is correct to work this way internally.

image.load_descriptor(path)

Load a descriptor object from the disk.

path is the path where the descriptor file is saved.

image.save_descriptor(path, descriptor)

Save the descriptor object descriptor to disk.

path is the path where the descriptor file is saved.

image.match_descriptor(descritor0, descriptor1[, threshold=70[, filter_outliers=False]])

For LBP descriptors, this function returns an integer that reflects the difference between the two descriptors. This distance measurement is particularly necessary. This distance is a measure of similarity. The closer this measure is to 0, the better the LBPF feature points match.

For ORB descriptors, this function returns a kptmatch object. See above.

threshold is used to filter ambiguous matching services for ORB keys.
A lower threshold value will be closely tied to the key point matching algorithm. The threshold value is between 0-100 (int). The default value is 70.

filter_outliers is used to filter outliers for ORB key points. Feature points allow users to increase the threshold value. The default setting is False.

Insert picture description here

Guess you like

Origin blog.csdn.net/ywsydwsbn/article/details/107623105