I am using conv2 to perform convolution on a gray image. conv2 was returning a floating value so I performed floor operation on it.
The input image is:
The code:
clc;
clear all;
close all;
img = imread("balloonGrayNoisy.jpg");
z = ones(3, 3);
newImg = floor( conv2(img, z/9) );
for i = 1:size(newImg, 1)
for j = 1: size(newImg, 2)
if(newImg(i,j) > 255)
disp(newImg(i, j))
endif
endfor
endfor
imshow(newImg)
Where img is the image read. When I output the newImg, It shows a blank image:
The loop is to ensure the values are in range. Inface, they are, but I don't know why am I not getting the output.