61 lines
1.6 KiB
C++
61 lines
1.6 KiB
C++
/*
|
||
* ====================================================
|
||
|
||
* 功能:色偏校正
|
||
* 作者:刘丁维
|
||
* 生成时间:2022/12/01
|
||
* 最近修改时间:v1.0 2022/12/01
|
||
* v1.1 2022/12/01 增加从文件中读取查值表数据接口;增加导出查值表数据接口
|
||
* 版本号:v1.1
|
||
* ====================================================
|
||
*/
|
||
|
||
#ifndef IMAGE_APPLY_COLOR_CAST_CORRECT_H
|
||
#define IMAGE_APPLY_COLOR_CAST_CORRECT_H
|
||
|
||
#include "ImageApply.h"
|
||
|
||
class GIMGPROC_LIBRARY_API 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 |