48 lines
1.5 KiB
C++
48 lines
1.5 KiB
C++
/*
|
||
* ====================================================
|
||
|
||
* 功能:空白页识别。
|
||
* 作者:刘丁维
|
||
* 生成时间:2020/4/21
|
||
* 最近修改时间:2020/4/21 v1.0
|
||
2020/8/12 v1.1 开放setIntensity和setMinArea;取消isNormal标识位;扩大setIntensity的设置范围,从[2, 20]扩大到[1, 100]
|
||
2020/8/25 v1.1.1 纸张检测缩进,从100像素调整到20像素
|
||
2020/10/16 v1.2 添加新接口,能够高效便捷判断图片是否为空白页
|
||
2020/10/19 v1.2.1 修复静态空白页判断识别误判的BUG
|
||
2021/04/13 v1.3.0 增加标准/票据标识位
|
||
2021/08/12 v1.3.1 添加防止不同opencv版本导致计算结果存在差异的代码。
|
||
2021/12/14 v1.3.2 重构算法。
|
||
2021/12/15 v1.3.3 微调参数。
|
||
2021/12/17 v1.3.4 增加背景色接口,实现对纯色纸张的空白页判定
|
||
* 版本号:v1.3.4
|
||
|
||
* ====================================================
|
||
*/
|
||
|
||
#ifndef IMAGE_APPLY_DISCARD_BLANK_H
|
||
#define IMAGE_APPLY_DISCARD_BLANK_H
|
||
|
||
#include "ImageApply.h"
|
||
|
||
class GIMGPROC_LIBRARY_API CImageApplyDiscardBlank : public CImageApply
|
||
{
|
||
public:
|
||
|
||
CImageApplyDiscardBlank(double threshold = 40, int edge = 150, double devTh = 50, double meanTh = 200);
|
||
|
||
virtual ~CImageApplyDiscardBlank(void);
|
||
|
||
virtual void apply(cv::Mat& pDib, int side);
|
||
|
||
virtual void apply(std::vector<cv::Mat>& mats, bool isTwoSide);
|
||
|
||
static bool apply(const cv::Mat& pDib, double threshold = 40, int edge = 150, int blockSize = 10, double devTh = 50, double meanTh = 200);
|
||
|
||
private:
|
||
double m_threshold;
|
||
int m_edge;
|
||
double m_devTh;
|
||
double m_meanTh;
|
||
};
|
||
|
||
#endif // !IMAGE_APPLY_DISCARD_BLANK_H
|