rk3399_arm_lvds/imgproc/ContaminationDetection.h

51 lines
1.9 KiB
C
Raw Normal View History

2024-03-05 03:46:18 +00:00
/*
* ====================================================
*
*
* 2023/10/09
* 2023/10/09 v1.0
2023/11/08 v1.1
2023/12/05 v1.2
2023/12/06 v1.2.1 2
* v1.2.1
* ====================================================
*/
#ifndef CONTAMINATION_DETECTION_H
#define CONTAMINATION_DETECTION_H
typedef unsigned char uchar;
class ContaminationDetection
{
public:
ContaminationDetection();
/// <summary>
/// 检测
/// </summary>
/// <param name="data1">top行待测数据</param>
/// <param name="data2">bottom行待测数据</param>
/// <param name="length">数据长度</param>
/// <param name="threshold1">第一阈值,超过该阈值视为存在脏污</param>
/// <param name="threshold2">第二阈值配合width使用超过该阈值且连续宽度达到width视为存在脏污</param>
/// <param name="width">脏污宽度配合threshold2使用</param>
/// <returns>为0时表示无污染反之有污染。</returns>
static int detect1(const uchar *data1, const uchar *data2, int length, uchar threshold1, uchar threshold2, int width);
/// <summary>
/// 检测
/// </summary>
/// <param name="data">图像数据</param>
/// <param name="width">像素宽度</param>
/// <param name="height">高度</param>
/// <param name="channels">通道数</param>
/// <param name="color">超过该阈值视为存在脏污</param>
/// <param name="length">脏污累计宽度</param>
/// <returns>为0时表示无污染;为1时表示脏污无规则可能由纸张遮挡造成为2时表示脏污规则</returns>
static int detect2(const uchar *data, int width, int height, int channels, uchar color, int length);
};
#endif