opencv实现gamma变换

#include 
#include 
#include
//#include
#include 
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,计算机视觉,c++)