twain3.0/huagao/ImageProcess/ImageApplyColorCastCorrect.h

62 lines
1.7 KiB
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.

/*
* ====================================================
* 功能:色偏校正
* 作者:刘丁维
* 生成时间2022/12/01
* 最近修改时间2022/12/01
* 版本号v1.0 2022/12/01
* v1.1 2022/12/01 增加从文件中读取查值表数据接口;增加导出查值表数据接口
* ====================================================
*/
#ifndef IMAGE_APPLY_COLOR_CAST_CORRECT_H
#define IMAGE_APPLY_COLOR_CAST_CORRECT_H
#include "ImageApply.h"
class CImageApplyColorCastCorrect : public CImageApply
{
public:
/// <summary>
/// 默认使用 points_x = { 0, 80, 175, 255 } points_y = { 12, 85, 175, 270 }曲线创建查值表
/// </summary>
CImageApplyColorCastCorrect();
/// <summary>
/// 用户自定义查值表
/// </summary>
/// <param name="points_x">HSV色彩空间H通道曲线变换节点坐标X轴</param>
/// <param name="points_y">HSV色彩空间H通道曲线变换节点坐标Y轴</param>
CImageApplyColorCastCorrect(const std::vector<double>& points_x, const std::vector<double>& points_y);
/// <summary>
/// 从文件中加载现有查值表数据
/// </summary>
/// <param name="fileName"></param>
CImageApplyColorCastCorrect(const std::string& fileName);
virtual ~CImageApplyColorCastCorrect(void);
virtual void apply(cv::Mat& pDib, int side);
virtual void apply(std::vector<cv::Mat>& mats, bool isTwoSide);
/// <summary>
/// 导出当前查值表数据
/// </summary>
/// <param name="fileName"></param>
void exportTableData(const std::string& fileName);
private:
std::vector<double> caculate(const std::vector<double>& points_x, const std::vector<double>& points_y);
void createTable(const std::vector<double>& points_x, const std::vector<double>& points_y);
private:
uint* m_table;
};
#endif