You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.4 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/*
功能:图像对比度调节
设计者:王家星
修改时间2015 05 15
*/
#pragma once
#include "stdafx.h"
// 情报数据通用结构
#include "QBStru.h"
// OpenCV
#include <opencv2\opencv.hpp>
using namespace cv;
// 1. OpenCV结构下的图像对比度控制
//功能:图像对比度控制
//输入: 1. src 输入图像
// 2. degree 对比度, 有效范围【0,20】值越大对比度越强
//
//输出: 1. dst 输出图像
// 2. 返回值处理成功返回true失败返回false
bool cvMatContrastControl(cv::Mat& src, cv::Mat& dst, int degree = 10);
// 2. ImgStru结构下的图像对比度控制
//功能:图像对比度控制
//输入: 1. src 输入图像结构体
// 2. degree 对比度, 有效范围【0,20】值越大对比度越强
//
//输出: 1. dst 输出图像结构体
// 2. 返回值处理成功返回true失败返回false
bool ImgStruContrastControl(ImgStru* src, ImgStru* dst, int degree = 10);
// 3. 通用情报结构下的图像对比度控制
//功能:图像对比度控制
//输入: 1. qbData 通用情报数据结构体
// 2. degree 对比度, 有效范围【0,20】值越大对比度越强
// 3. bSrcFirst 默认时优先处理srcImg, srcImg-->dstImg
// 否则优先处理dstImgdstImg——>dstImg
//
//输出: 1. qbData 含对比度变化后图像的情报数据结构体
// 2. 返回值处理成功返回true失败返回false
//说明: 首先判断图像数据有效性标识位,无效时直接返回,不做任何处理;
bool QBStruContrastControl(QBStru *qbData, int degree = 10, bool bSrcFirst = true);