opencv——inRange

该博客通过示例代码介绍了如何利用OpenCV的inRange函数进行肤色检测,通过创建滑块条动态调整HSV颜色范围,实现了图像的实时处理。在循环中,inRange函数用于将HSV图像中指定颜色范围的像素筛选出来,展示在dst窗口中,按'q'键退出程序。
摘要由CSDN通过智能技术生成
#include <opencv2\opencv.hpp>
#include <iostream>

using namespace cv;

void callback1(int pos, void*)
{
	std::cout << "hmin" << pos << std::endl;
}
void callback2(int pos, void*)
{
	std::cout << "smin" << pos << std::endl;
}
void callback3(int pos, void*)
{
	std::cout << "vmin" << pos << std::endl;
}
void callback4(int pos, void*)
{
	std::cout << "hmax" << pos << std::endl;
}
void callback5(int pos, void*)
{
	std::cout << "smax" << pos << std::endl;
}
void callback6(int pos, void*)
{
	std::cout << "vmax" << pos << std::endl;
}
int main()
{
	Mat src, hsv, dst;
	int hmin = 0;
	int smin = 0;
	int vmin = 0;
	int hmax = 255;
	int smax = 255;
	int vmax = 255;

	src = imread("../data/baboon.jpg");
	imshow("src", src);
	cvtColor(src, hsv, CV_RGB2HSV);
	
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值