#include <opencv2\core\core.hpp>
#include <opencv2\highgui\highgui.hpp>
#include<opencv2\imgproc\imgproc.hpp>
//#include<cmath>
#include <iostream>
using namespace std;
using namespace cv;
void gammas(Mat input, double gamma, Mat &output)
{
Mat fI;
input.convertTo(fI, CV_64F, 1 / 255.0, 0);
Mat O;
pow(fI, gamma, output);
}
int main()
{
Mat output_img;
Mat I = imread("1 (4).png", IMREAD_GRAYSCALE);
gammas(I, 1.5, output_img);
//显示效果
imshow("output_img", output_img);
waitKey(0);
}
opencv实现gamma变换
最新推荐文章于 2023-04-26 11:27:22 发布