本文的目标是实现添加滚动条对图片的亮度和对比度进行动态调整。
这里直接上代码了(记得把图片拷贝到工程cpp文件同级目录下),接着贴上效果图:
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <iostream>
using namespace std;
using namespace cv;
int main(int argc, char** argv)
{
Mat src = imread("pic.jpg");
if (!src.data)
{
cout << "Error loading the imag