mirror of http://192.168.1.51:8099/lmh188/twain3.0
47 lines
1017 B
C++
47 lines
1017 B
C++
#ifndef IMAGE_APPLY_CHANNEL_H
|
||
#define IMAGE_APPLY_CHANNEL_H
|
||
|
||
#include "ImageApply.h"
|
||
|
||
class CImageApplyAdjustColors;
|
||
class CImageApplyChannel : public CImageApply
|
||
{
|
||
public:
|
||
|
||
typedef enum channel
|
||
{
|
||
Red, //红色通道
|
||
Green, //绿色通道
|
||
Blue, //蓝色通道
|
||
All, //去除所有HSV色彩结构中,S大于80的色彩
|
||
Invalid, //无效
|
||
Except_Red, //绿蓝色通道混合
|
||
Except_Green, //红蓝色通道混合
|
||
Except_Blue //红绿色通道混合
|
||
}Channel;
|
||
|
||
public:
|
||
|
||
CImageApplyChannel();
|
||
|
||
CImageApplyChannel(Channel channel);
|
||
|
||
virtual ~CImageApplyChannel(void);
|
||
|
||
virtual void apply(cv::Mat& pDib,int side);
|
||
|
||
virtual void apply(std::vector<cv::Mat>& mats, bool isTwoSide);
|
||
|
||
private:
|
||
|
||
void except_channel(const cv::Mat& src, cv::Mat& dst, int channel);
|
||
|
||
void colourless(const cv::Mat& src, cv::Mat& dst, uchar threshold = 80);
|
||
|
||
private:
|
||
|
||
Channel m_channel;
|
||
CImageApplyAdjustColors* colors;
|
||
};
|
||
|
||
#endif // !IMAGE_APPLY_CHANNEL_H
|