code_device/hgdriver/ImageProcess/ImageApplyRefuseInflow.h

45 lines
1.3 KiB
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* ====================================================
* 功能:防渗透。
* 作者:刘丁维
* 生成时间2020/4/21
* 最近修改时间v1.0 2020/04/21
* v1.1 2022/05/04 重构算法,采用提高对比度实现防渗透。
* v2.0 2023/08/12 筹够算法,采用双边滤波实现防渗透。
* v2.1 2023/10/20 修复原图不能同时作为目标图的BUG。
* v3.0 2023/12/02 更新方案,通过识别文稿底色,填充近似颜色实现防渗透。接口有所调整
* v3.1 2023/12/04 支持灰度图防渗透
* 版本号v3.1
* ====================================================
*/
#ifndef IMAGE_APPLY_REFUSE_INFLOW_H
#define IMAGE_APPLY_REFUSE_INFLOW_H
#include "ImageApply.h"
class GIMGPROC_LIBRARY_API CImageApplyRefuseInflow : public CImageApply
{
public:
/// <summary>
///
/// </summary>
/// <param name="threshod">背景阈值.取值范围[0, 255]</param>
/// <param name="range">文稿底色相近范围。取值范围[0, 255]</param>
CImageApplyRefuseInflow(int threshod = 20, int range = 40);
virtual ~CImageApplyRefuseInflow();
virtual void apply(cv::Mat& pDib, int side);
virtual void apply(std::vector<cv::Mat>& mats, bool isTwoSide);
private:
int m_threshold;
int m_range;
};
#endif // !IMAGE_APPLY_REFUSE_INFLOW_H