Compare commits

...

2 Commits

19 changed files with 65 additions and 4 deletions

Binary file not shown.

Binary file not shown.

View File

@ -103,6 +103,29 @@ void opencv_t::bar_demo(Mat& 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)

View File

@ -1,7 +1,11 @@
#pragma once
#ifndef OPENCV_test
#define OPENCV_test
#include<opencv2/opencv.hpp>
#include<iostream>
#include<windows.h>
using namespace cv;
using namespace std;
class opencv_t
@ -15,10 +19,35 @@ public:
Mat operter_zuo(Mat& temp);
void tar_bar(Mat& temp);
void bar_demo(Mat& temp);
void color_sectect(Mat& temp);
Mat operter_chen(Mat& temp);
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

View File

@ -3,8 +3,17 @@
#include"opencv_test.h"
using namespace cv;
using namespace std;
void test12(int& c)
{
int cc = c;
cc = 1;
}
int main(int argc, char** argv)
{
int test = 12;
test12(test);
Mat src = imread("./images/hist_01.jpg");
namedWindow("ÊäÈëͼÏñ", WINDOW_FREERATIO);
//namedWindow("bai", WINDOW_FREERATIO);
@ -18,7 +27,7 @@ int main(int argc, char** argv)
//csss->visit_xiangsu(src,1);
//cvtColor(src, hsv, COLOR_BGR2HSV);
imshow("ÊäÈëͼÏñ", src);
csss->bar_demo(src);
csss->color_sectect(src);
//imshow("bai", bai);
waitKey(0);
destroyAllWindows();

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,2 +1,2 @@
 opencv_test.cpp
 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.