#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);
opencv——inRange
最新推荐文章于 2024-08-06 15:31:43 发布
该博客通过示例代码介绍了如何利用OpenCV的inRange函数进行肤色检测,通过创建滑块条动态调整HSV颜色范围,实现了图像的实时处理。在循环中,inRange函数用于将HSV图像中指定颜色范围的像素筛选出来,展示在dst窗口中,按'q'键退出程序。
摘要由CSDN通过智能技术生成