mirror of http://192.168.1.51:8099/lmh188/twain3.0
52 lines
1.2 KiB
C++
52 lines
1.2 KiB
C++
/*
|
||
* ====================================================
|
||
|
||
* 功能:空白页识别。
|
||
* 作者:刘丁维
|
||
* 生成时间:2020/4/21
|
||
* 最近修改时间:2020/4/21 v1.0
|
||
2020/8/12 v1.1 开放setIntensity和setMinArea;取消isNormal标识位;扩大setIntensity的设置范围,从[2, 20]扩大到[1, 100]
|
||
* 版本号:v1.1
|
||
|
||
* ====================================================
|
||
*/
|
||
|
||
#ifndef IMAGE_APPLY_DISCARD_BLANK_H
|
||
#define IMAGE_APPLY_DISCARD_BLANK_H
|
||
|
||
#include "ImageApply.h"
|
||
|
||
class CImageApplyDiscardBlank : public CImageApply
|
||
{
|
||
public:
|
||
/*
|
||
* isnormal [in]:true标准模式,false为票据复写纸模式
|
||
* */
|
||
CImageApplyDiscardBlank();
|
||
|
||
virtual ~CImageApplyDiscardBlank(void);
|
||
|
||
virtual void apply(cv::Mat& pDib,int side);
|
||
|
||
virtual void apply(std::vector<cv::Mat>& mats, bool isTwoSide);
|
||
|
||
void setIntensity(int val);
|
||
|
||
void setMinArea(int val) { dSize = val; }
|
||
|
||
private:
|
||
|
||
int processRectR(const cv::Mat& image, cv::RotatedRect& rotatedRect, std::vector<cv::Point>& maxContour,
|
||
double scale, double thresh, int blobAreaSize);
|
||
|
||
bool scalar_LE(const cv::Scalar& val1, const cv::Scalar& val2);
|
||
|
||
cv::Mat getRoiMat(const cv::Mat& pDib);
|
||
private:
|
||
bool m_res;
|
||
bool isNormalDiscard;
|
||
int dSize;
|
||
cv::Scalar devTh;
|
||
};
|
||
|
||
#endif // !IMAGE_APPLY_DISCARD_BLANK_H
|