code_device/hgdriver/ImageProcess/ImageApplyCvtColor.h

53 lines
1.1 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/6/19
* 最近修改时间v1.0 2020/6/19
v1.1 2020/6/20 添加BGR转HSV,添加BGR_MAX添加BGR_MIN
* 版本号v1.1
* ====================================================
*/
#ifndef IMAGE_APPLY_CONVERT_COLOR_H
#define IMAGE_APPLY_CONVERT_COLOR_H
#include "ImageApply.h"
class GIMGPROC_LIBRARY_API CImageApplyCvtColor : public CImageApply
{
public:
//转换模式
enum ConversionCodes
{
BGR_MAX = 1, //BGR取大值转GRAY
BGR_MIN = 2, //BGR取小值转GRAY
BGR2GRAY = 6, //BGR转GRAY
BGR2HSV = 40 //BGR转HSV
};
/*
* type [in]:色彩转换模式默认BGR转Gray
* */
CImageApplyCvtColor(ConversionCodes type = BGR2GRAY);
virtual ~CImageApplyCvtColor();
virtual void apply(cv::Mat& pDib, int side);
virtual void apply(std::vector<cv::Mat>& mats, bool isTwoSide);
inline ConversionCodes getConversionCode() { return m_code; }
inline void setConversionCode(ConversionCodes code) { m_code = code; }
private:
ConversionCodes m_code;
};
#endif // !IMAGE_APPLY_CUSTOM_CAMMA_H