test Signed-off-by: lls <staying_liu_1@163.com> #1
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -103,6 +103,29 @@ void opencv_t::bar_demo(Mat& temp)
|
|||||||
ontrack(50, &temp);
|
ontrack(50, &temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void opencv_t::color_sectect(Mat& temp)
|
||||||
|
{
|
||||||
|
namedWindow("·ç¸ñ±ä»»", WINDOW_AUTOSIZE);
|
||||||
|
int c = -1;//signal
|
||||||
|
Mat dst;
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
cin >> c;
|
||||||
|
if (c == -1)
|
||||||
|
{
|
||||||
|
imshow("·ç¸ñ±ä»»", temp);
|
||||||
|
waitKey(1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
c = c % 22;
|
||||||
|
applyColorMap(temp, dst, colormaps[c]);
|
||||||
|
imshow("·ç¸ñ±ä»»",dst);
|
||||||
|
waitKey(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Mat opencv_t::operter_chen(Mat& temp)
|
Mat opencv_t::operter_chen(Mat& temp)
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
#ifndef OPENCV_test
|
||||||
|
#define OPENCV_test
|
||||||
#include<opencv2/opencv.hpp>
|
#include<opencv2/opencv.hpp>
|
||||||
|
#include<iostream>
|
||||||
|
#include<windows.h>
|
||||||
using namespace cv;
|
using namespace cv;
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
class opencv_t
|
class opencv_t
|
||||||
@ -15,10 +19,35 @@ public:
|
|||||||
Mat operter_zuo(Mat& temp);
|
Mat operter_zuo(Mat& temp);
|
||||||
void tar_bar(Mat& temp);
|
void tar_bar(Mat& temp);
|
||||||
void bar_demo(Mat& temp);
|
void bar_demo(Mat& temp);
|
||||||
|
void color_sectect(Mat& temp);
|
||||||
Mat operter_chen(Mat& temp);
|
Mat operter_chen(Mat& temp);
|
||||||
private:
|
private:
|
||||||
|
std::vector<int> colormaps = {
|
||||||
|
cv::COLORMAP_AUTUMN,
|
||||||
|
cv::COLORMAP_BONE,
|
||||||
|
cv::COLORMAP_JET,
|
||||||
|
cv::COLORMAP_WINTER,
|
||||||
|
cv::COLORMAP_RAINBOW,
|
||||||
|
cv::COLORMAP_OCEAN,
|
||||||
|
cv::COLORMAP_SUMMER,
|
||||||
|
cv::COLORMAP_SPRING,
|
||||||
|
cv::COLORMAP_COOL,
|
||||||
|
cv::COLORMAP_HSV,
|
||||||
|
cv::COLORMAP_PINK,
|
||||||
|
cv::COLORMAP_HOT,
|
||||||
|
cv::COLORMAP_PARULA,
|
||||||
|
cv::COLORMAP_MAGMA,
|
||||||
|
cv::COLORMAP_INFERNO,
|
||||||
|
cv::COLORMAP_PLASMA,
|
||||||
|
cv::COLORMAP_VIRIDIS,
|
||||||
|
cv::COLORMAP_CIVIDIS,
|
||||||
|
cv::COLORMAP_TWILIGHT,
|
||||||
|
cv::COLORMAP_TWILIGHT_SHIFTED,
|
||||||
|
cv::COLORMAP_TURBO,
|
||||||
|
cv::COLORMAP_DEEPGREEN
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
11
test.cpp
11
test.cpp
@ -3,8 +3,17 @@
|
|||||||
#include"opencv_test.h"
|
#include"opencv_test.h"
|
||||||
using namespace cv;
|
using namespace cv;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
|
void test12(int& c)
|
||||||
|
{
|
||||||
|
int cc = c;
|
||||||
|
cc = 1;
|
||||||
|
}
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
int test = 12;
|
||||||
|
test12(test);
|
||||||
Mat src = imread("./images/hist_01.jpg");
|
Mat src = imread("./images/hist_01.jpg");
|
||||||
namedWindow("ÊäÈëͼÏñ", WINDOW_FREERATIO);
|
namedWindow("ÊäÈëͼÏñ", WINDOW_FREERATIO);
|
||||||
//namedWindow("bai", WINDOW_FREERATIO);
|
//namedWindow("bai", WINDOW_FREERATIO);
|
||||||
@ -18,7 +27,7 @@ int main(int argc, char** argv)
|
|||||||
//csss->visit_xiangsu(src,1);
|
//csss->visit_xiangsu(src,1);
|
||||||
//cvtColor(src, hsv, COLOR_BGR2HSV);
|
//cvtColor(src, hsv, COLOR_BGR2HSV);
|
||||||
imshow("ÊäÈëͼÏñ", src);
|
imshow("ÊäÈëͼÏñ", src);
|
||||||
csss->bar_demo(src);
|
csss->color_sectect(src);
|
||||||
//imshow("bai", bai);
|
//imshow("bai", bai);
|
||||||
waitKey(0);
|
waitKey(0);
|
||||||
destroyAllWindows();
|
destroyAllWindows();
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,2 +1,2 @@
|
|||||||
opencv_test.cpp
|
test.cpp
|
||||||
opencvlearn.vcxproj -> C:\Users\leave1031\Desktop\learn\opencvlearn\x64\Debug\opencvlearn.exe
|
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.
Binary file not shown.
Loading…
Reference in New Issue
Block a user