opencv识别RGB三种颜色并返回结果

本文介绍了如何利用OpenCV库在图像处理中识别RGB三种颜色,并详细阐述了颜色空间转换和颜色阈值设置的方法,帮助读者理解并实现颜色识别功能。
摘要由CSDN通过智能技术生成
#include <imgproc/imgproc.hpp>  
#include <opencv2/core/core.hpp>  
#include<opencv2/highgui/highgui.hpp>
#include <iostream>  
#include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>
#include<string> 
#include<vector>

#define BIGGEST(a,b,c) (a>b?(a>c?a:c):(b>c?b:c))

#define RED 1
#define GREEN 2
#define BLUE 3

//HSV范围 
//红色HSV范围
#define iLowH_R  125
#define iHighH_R  155
#define iLowS_R  43
#define iHighS_R  255
#define iLowV_R  46
#define iHighV_R  255
//绿色HSV范围
#define iLowH_G  35
#define iHighH_G  77
#define iLowS_G  43
#define iHighS_G  255
#define iLowV_G  46
#define iHighV_G  255
//蓝色HSV范围
#define iLowH_B  100
#define iHighH_B  124
#define iLowS_B  128
#define iHighS_B  255
#define iLowV_B  102
#define iHighV_B  255

using namespace cv;
using namespace std;

Mat WhiteBalance(Mat image);
double PixelTotal(Mat mask);
int HSV(Mat img);

int main() {

	IplImage* examp
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值