I am trying to write a basic program for image processing and i am stuck at defining the kernel, i am getting the above error and i dont know what i am doing wrong. i tried to search and did not find anything and i am little new to both c++ and opencv
the code i have wrote is
#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "iostream"
using namespace cv;
using namespace std;
int c = 1;
int *c_Address = &c;
int initialsharp = 1;
Mat kernel = Mat_<double>(3,3) << -c, -c, -c, -c, 8*c+1, -c, -c, -c, -c ;
void trackbarPosSharp(int pos, void *y)
{
*c_Address = pos;
Mat src = imread( "blurry_moon.tif", CV_LOAD_IMAGE_GRAYSCALE );
Mat dst = Mat::zeros( src.size(), src.type() );
filter2D(src, dst, -1, kernel);
imshow("Output", dst);
}
int main( )
{
Mat src = imread( "blurry_moon.tif", CV_LOAD_IMAGE_GRAYSCALE );
//equalizeHist( channel[0], channel[0] );
namedWindow( "Original image", CV_WINDOW_AUTOSIZE );
imshow( "Original image", src );
src.release();
namedWindow("Output", CV_WINDOW_AUTOSIZE);
createTrackbar("Shrapening level ","Output", &initialsharp, 10, trackbarPosSharp);
trackbarPosSharp(1, 0);
waitKey(0);
return 0;
}