# Image Processing [closed]

I have an image and I am trying to find its rows and columns.

A = imread('lena.jpg');
nrows = size(A,1)
ncols = size(A,2)


This is 3 dimensional matrix. Output of this 512 and 512. I know A is the matrix but how can I know value of for example A[211][312] ? I want to use convolution filter to the image, obtain new matrix and turn it into a picture like "lena with blur".

• What do you mean by 3-dimensional ? Is it a color image? – Laurent Duval May 26 '20 at 12:07
• yes it is a color image – Oğuzhan Kırlar May 26 '20 at 12:07

You can iterate for each channel:

data = double(imread('lena.jpg'));
data = data/255; % Potentially optional
dataFilt = zeros(size(data));
nChan = size(data,3);
kernelFilter = ones(11,11)/121;
for iChan = 1:nChan
dataFilt(:,:,iChan) = filter2(kernelFilter,data(:,:,iChan));
end
subplot(1,2,1)
imagesc(data)
xlabel('Picture')
subplot(1,2,2)
imagesc(dataFilt)
xlabel('Picture with blur')