以下代码运行出现如图1所示错误:
#include <iostream>
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
Mat denois_abs(Mat & src);
int main()
{
Mat src = imread("F:\\wangjiao\\picture\\1.bmp",0);
Mat dst = denois_abs(src);
imshow("dst",dst);
imwrite("F:\\wangjiao\\20180330\\denois_abs_result.bmp", dst);
return 0;
}
Mat denois_abs(Mat & src)
{
float a = 1.5;
float b = 0.5;
Mat dst = src.clone();
Mat var = src * a + b;
for (int r = 1; r < src.rows - 1; ++r)
{
for (int c = 1; c < src.cols - 1; ++c)
{
float weight_sum = 0.0f;
float val_sum = 0.0f;
for (int i = -1; i <= 1;