#include "pch.h"
#include <iostream>
#include<opencv.hpp>
#include<opencv2\highgui\highgui.hpp>
#include<opencv2\core\core.hpp>
#include <opencv2\imgproc\imgproc.hpp>
using namespace cv;
using namespace std;
int th = 10;
int th_max = 255;
void demo(int, void*);
Mat qq, qq1;
int main()
{
qq = imread("C:\\Users\\EDZ\\Desktop\\1.jpg");
cvtColor(qq, qq, COLOR_BGR2GRAY);
namedWindow("qq", WINDOW_NORMAL);
imshow("qq", qq);
createTrackbar("yuzhi", "qq", &th, th_max, demo);
demo(0, 0);
waitKey(0);
return 0;
}
void demo(int, void*)
{
threshold(qq, qq1, th, th_max,3);
imshow("qq", qq1);
}