修改了opencv4的兼容性,现在opencv3未知

main
wangchunlin 4 years ago
parent 0ac915ee18
commit 358397d204

@ -1,7 +1,7 @@
#include <vector> #include <vector>
#include <iostream> #include <iostream>
#include <exception> #include <exception>
#include <opencv/cv.h> #include <opencv2/opencv.hpp>
#include <opencv2/imgcodecs.hpp> #include <opencv2/imgcodecs.hpp>
#include <opencv2/imgproc.hpp> #include <opencv2/imgproc.hpp>
#include <opencv2/videoio.hpp> #include <opencv2/videoio.hpp>
@ -22,7 +22,7 @@ using namespace cv;
void detect_brightness(cv::Mat input_img, float& cast, float& da) void detect_brightness(cv::Mat input_img, float& cast, float& da)
{ {
cv::Mat gray_img; cv::Mat gray_img;
cv::cvtColor(input_img, gray_img, CV_BGR2GRAY); cv::cvtColor(input_img, gray_img, COLOR_BGR2GRAY);
float a = 0, Ma = 0; float a = 0, Ma = 0;
int hist[256] = { 0 }; int hist[256] = { 0 };
@ -65,4 +65,4 @@ int main(int argc, char *argv[])
detect_saturation(img, satu); detect_saturation(img, satu);
cout<<cast<<"||"<<da<<"||"<<satu; cout<<cast<<"||"<<da<<"||"<<satu;
return 0; return 0;
} }

Loading…
Cancel
Save