最近接了一个单子,具体任务是首先进行去雾操作,然后进行车牌的检测和分割,话不多说具体的代码如下所示:、
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
C++使用OpenCV实现车牌去雾与检测
本文介绍了如何使用C++和OpenCV库进行图像去雾、车牌检测和分割。通过myFun.h、myFun.cpp及main.cpp三个文件的代码实现,实现了从图像预处理到轮廓检测,再到中值滤波、图像分割和ROI区域选择的一系列步骤。最终,成功地进行了车牌的垂直和水平边框切割,并展示了图像处理和分割后的车牌结果。
订阅专栏 解锁全文
2万+

被折叠的 条评论
为什么被折叠?



