2018/8/23正确版本如下:
#include <iostream>
#include <string.h>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2\core\mat.hpp>
#include<opencv2/opencv.hpp>
#define e 2.71828182845
using namespace cv;
using namespace std;
void main()
{
Mat img = imread("pic2.jpg");//读取图像img。0表示转换为灰度图像读入
imshow("原图", img);
waitKey(0);
int height = img.rows;
int width = img.cols;
//浮点变换
Mat fimg(height, width, CV_32FC3);
img.convertTo(fimg, CV_32FC3,1/255.0);
//将修改后的像素值放入另一个图片中
Mat fimg2(height,width, CV_32FC3);
for (int row = 0; row < height; row++)
for (int col = 0; col < width; col++)
{
fimg2.at<Vec3f>(row, col)[0] = float(pow(fimg.at<Vec3f>(row, col)[0], e));
fimg2.at<Vec3f>(row, col)[1] = float(pow(fimg.at<Vec3f>(row, col)[1], e));
fimg2.at<Vec3