最近接了一个单子,具体任务是首先进行去雾操作,然后进行车牌的检测和分割,话不多说具体的代码如下所示:、
myFun.h文件
#pragma once #ifndef FUNCTION_H #define FUNCTION_H
#include<opencv2/core/core.hpp> #include<opencv2/imgproc/imgproc.hpp>
#include<opencv2/highgui/highgui.hpp> #include<iostream> #include<map>
#include<math.h> using namespace std; using namespace cv; //导向滤波,用来优化t(x),针对单通道
class MyClass { public: Mat guidedfilter(Mat& srcImage, Mat& srcClone, int r,
double eps); Mat dark_channel(Mat src); int calculate_A(Mat src, Mat
dark_channel_mat); Mat calculate_tx(Mat& src, int A, Mat& dark_channel_mat);
Mat haze_removal_img(Mat& src, int A, Mat& tx); Mat Image_Preprocessing(Mat
temp);//图像预处理 Mat Morphological_Processing(Mat temp);//形态学处理 Mat
Locate_License_Plate(Mat temp, Mat src, Mat gray_src);//车牌定位 Mat
Affine_Transform(Mat temp);//仿射变换(用于将提取出来车牌转化为同一尺寸) Mat Remove_Vertial_Border
今日推荐