滑动
Signed-off-by: lls <staying_liu_1@163.com>
This commit is contained in:
parent
5467684710
commit
abffcb247f
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -65,3 +65,51 @@ void opencv_t::visit_xiangsu(Mat& temp, int a)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Mat opencv_t::operter_zuo(Mat& temp)
|
||||
{
|
||||
Mat out;
|
||||
cv::add(temp, Scalar(50, 50, 50), out);//divide
|
||||
//out = temp + Scalar(50, 50, 50);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void opencv_t::tar_bar(Mat& temp)
|
||||
{
|
||||
namedWindow("ÁÁ¶Èµ÷Õû", WINDOW_AUTOSIZE);
|
||||
int max = 100;
|
||||
int lisss = 50;
|
||||
|
||||
}
|
||||
|
||||
static void ontrack(int lit,void* temp )//»Øµ÷
|
||||
{
|
||||
|
||||
Mat image = *((Mat*)temp);
|
||||
Mat out;
|
||||
lit= lit - 50;
|
||||
cv::add(image, Scalar(lit, lit, lit), out);
|
||||
imshow("ÁÁ¶Èµ÷Õû22", out);
|
||||
}
|
||||
|
||||
void opencv_t::bar_demo(Mat& temp)
|
||||
{
|
||||
namedWindow("ÁÁ¶Èµ÷Õû22", WINDOW_AUTOSIZE);
|
||||
int lit = 50;
|
||||
int max = 100;
|
||||
createTrackbar("valuebar", "ÁÁ¶Èµ÷Õû22", &lit, max, ontrack,(void*)(&temp));
|
||||
ontrack(50, &temp);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Mat opencv_t::operter_chen(Mat& temp)
|
||||
{
|
||||
Mat out;
|
||||
multiply(temp, Scalar(2,2,2),out);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,6 +1,9 @@
|
||||
#pragma once
|
||||
#include<opencv2/opencv.hpp>
|
||||
using namespace cv;
|
||||
|
||||
|
||||
|
||||
class opencv_t
|
||||
{
|
||||
public:
|
||||
@ -9,6 +12,11 @@ public:
|
||||
static opencv_t* create_new();
|
||||
void visit_xiangsu(Mat& temp);//MatÏñËØ¶Áд·ÃÎÊ
|
||||
void visit_xiangsu(Mat& temp,int a);//MatÏñËØ¶Áд·ÃÎÊ,
|
||||
Mat operter_zuo(Mat& temp);
|
||||
void tar_bar(Mat& temp);
|
||||
void bar_demo(Mat& temp);
|
||||
|
||||
Mat operter_chen(Mat& temp);
|
||||
private:
|
||||
|
||||
};
|
||||
|
7
test.cpp
7
test.cpp
@ -5,8 +5,9 @@ using namespace cv;
|
||||
using namespace std;
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
Mat src = imread("./images/green.jpg");
|
||||
Mat src = imread("./images/hist_01.jpg");
|
||||
namedWindow("输入图像", WINDOW_FREERATIO);
|
||||
//namedWindow("bai", WINDOW_FREERATIO);
|
||||
if (src.empty())
|
||||
{
|
||||
cout << "输入图形有误" << endl;
|
||||
@ -14,9 +15,11 @@ int main(int argc, char** argv)
|
||||
Mat gray, hsv;
|
||||
|
||||
opencv_t* csss = opencv_t::create_new();
|
||||
csss->visit_xiangsu(src,1);
|
||||
//csss->visit_xiangsu(src,1);
|
||||
//cvtColor(src, hsv, COLOR_BGR2HSV);
|
||||
imshow("输入图像", src);
|
||||
csss->bar_demo(src);
|
||||
//imshow("bai", bai);
|
||||
waitKey(0);
|
||||
destroyAllWindows();
|
||||
return 0;
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,2 +1,2 @@
|
||||
test.cpp
|
||||
opencv_test.cpp
|
||||
opencvlearn.vcxproj -> C:\Users\leave1031\Desktop\learn\opencvlearn\x64\Debug\opencvlearn.exe
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user