opencv第6讲--tracking_bar的使用

Mat dst,m,src;
int lightness = 50;

static void on_track(int, void*)
{
	m = Scalar(lightness, lightness, lightness);

	add(src, m, dst);

	imshow("亮度调整", dst);
}

void QuickDemo::tracking_bar_demo(Mat& image)
{
	namedWindow("亮度调整", WINDOW_AUTOSIZE);

	dst = Mat::zeros(image.size(), image.type());
	m = Mat::zeros(image.size(), image.type());

	src = image;

	int max_value = 100;

	createTrackbar("value bar", "亮度调整", &lightness, max_value, on_track);

	on_track(50, 0);
}

  

上一篇:JS - 鼠标经过边框旋转


下一篇:回溯算法之全排列 力扣刷题