原图
RGB TO GRAY
import cv2
gray_img=cv2.imread('try.jpg',cv2.IMREAD_GRAYSCALE)
cv2.imshow('gray',gray_img)
cv2.waitKey()
import cv2
gray_img=cv2.imread('try.jpg')
gray_img=cv2.cvtColor(gray_img,cv2.COLOR_BGR2GRAY)
cv2.imshow('gray',gray_img)
cv2.waitKey()
颜色空间
In computer vision and image processing, color space refers to a specific way of
organizing colors. A color space is actually a combination of two things: a color model
and a mapping function.
There are many different color spaces that are useful. Some of the more popular color
spaces are RGB, YUV, HSV, Lab, and so on.
RGB: It’s probably the most popular color space. It stands for Red, Green, and Blue.
In this color space, each color is represented as a weighted combination of red, green,
and blue. So every pixel value is represented as a tuple of three numbers
correspondi