twain3.0/huagao/ImageProcess/ImageApplyChannel.h

47 lines
1017 B
C++
Raw 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.

#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