Normalize image 0 - 255 for display
Hi, I am trying to create a gaussian kernel and then normalize it so I can display it because the values are all too small like to the power of negative something. i used the normalize function but im still getting a black screen. the minimum is supposed to be 0 and the max 255 and everything else is scale in between. my code is below. help thanks.
int main() {
Mat kernelX = getGaussianKernel(49, 13);
Mat kernelY = getGaussianKernel(49, 13);
Mat kernelXY = kernelX * kernelY.t();
normalize(kernelXY, kernelXY, 0, 255);
namedWindow("l", CV_WINDOW_NORMAL);
imshow("l", kernelXY);
waitKey(0);
}
this is what i got in matlab with code
gaussian = fspecial('gaussian', [49 49], 13);
colormap gray
imagesc(gaussian);
How can I get the same result in opencv ?