Color Spaces In OpenCV | Python - GeeksforGeeks
Có thể bạn quan tâm
Color spaces are a way to represent the color channels present in the image that gives the image that particular hue. There are several different color spaces and each has its own significance. Some of the popular color spaces are RGB (Red, Green, Blue), CMYK (Cyan, Magenta, Yellow, Black), HSV (Hue, Saturation, Value), etc. BGR color space: OpenCV’s default color space is RGB. However, it actually stores color in the BGR format. It is an additive color model where the different intensities of Blue, Green and Red give different shades of color. HSV color space: It stores color information in a cylindrical representation of RGB color points. It attempts to depict the colors as perceived by the human eye. Hue value varies from 0-179, Saturation value varies from 0-255 and Value value varies from 0-255. It is mostly used for color segmentation purpose. CMYK color space: Unlike, RGB it is a subtractive color space. The CMYK model works by partially or entirely masking colors on a lighter, usually white, background. The ink reduces the light that would otherwise be reflected. Such a model is called subtractive because inks “subtract” the colors red, green and blue from white light. White light minus red leaves cyan, white light minus green leaves magenta, and white light minus blue leaves yellow. Visualizing the different color channels of an RGB image.
Python3
import cv2 image = cv2.imread('C://Users//Gfg//rgb.png') B, G, R = cv2.split(image) # Corresponding channels are separated cv2.imshow("original", image) cv2.waitKey(0) cv2.imshow("blue", B) cv2.waitKey(0) cv2.imshow("Green", G) cv2.waitKey(0) cv2.imshow("red", R) cv2.waitKey(0) cv2.destroyAllWindows() |
Output:
S
Sourabh_Sinha Follow Improve Previous Article OpenCV | Saving an Image Next Article Arithmetic Operations on Images using OpenCV | Set-1 (Addition and Subtraction)Từ khóa » Hsv Color Space Opencv Python
-
Changing Colorspaces - OpenCV Documentation
-
Choosing The Correct Upper And Lower HSV Boundaries For Color ...
-
Learn The Working Of HSV Range In OpenCV - EduCBA
-
Changing Colorspaces - OpenCV-Python Tutorials - Read The Docs
-
OpenCV Color Spaces ( tColor ) - PyImageSearch
-
The HSV Color Space Using OpenCV In Python | Delft Stack
-
Image Segmentation Using Color Spaces In OpenCV + Python
-
Color Spaces In OpenCV (C++/Python) - LearnOpenCV
-
Detecting Colors (Hsv Color Space) - Opencv With Python - YouTube
-
Detecting Colors (Hsv Color Space) - Opencv With Python - Pysource
-
OpenCV 3 Video Capture & Switching Colorspaces RGB / HSV - 2020
-
How To Detect Colors Through HSV Color Space On OpenCV With ...
-
Color Spaces And Channels In OpenCV - Python Wife