【DAY_2】OpenCV 灰度图、图片的颜色空间

本文介绍了计算机视觉中颜色空间的概念,包括RGB、YUV和HSV等常见颜色模型。RGB是最常用的,由红、绿、蓝三种颜色组成。YUV在某些应用中能更好地分离亮度和色度信息。HSV则更符合人类对颜色的感知,由色调、饱和度和明度构成。文中还提到了YUV中的Y通道与灰度图的关联,以及HSV色彩空间在图像处理中的优势。
摘要由CSDN通过智能技术生成

原图

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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值