Filters in Image Processing

4 visualizzazioni (ultimi 30 giorni)
Rooter Boy
Rooter Boy il 14 Nov 2020
Commentato: Rooter Boy il 15 Nov 2020
I have a question about filters in Matlab.
For example, I have a matrix of any picture.
A=[14 12 10 12 11 10 13 7 9 16;
16 14 13 13 12 6 9 10 13 11;
16 14 12 13 11 8 9 11 11 3;
13 13 12 12 15 11 12 12 4 3,
16 9 4 12 14 8 9 21 11 5;
16 15 15 12 8 8 5 5 6 12;
12 11 13 11 13 4 4 3 2 5;
7 7 13 13 14 4 4 3 4 5;
8 11 5 12 12 4 5 4 4 5;
14 14 12 6 12 5 2 3 5 3]
We know that starts from the index (0,0) when you apply any filter. (Use a 3x3 filter.)
I want to find new value of the pixel (5,5) after it applies a median filter, and mean filter for window size (3,3) pixels.
I can find
T=medfilt2(A,[3 3]);
T(5,5) % The answer is 12
and
A=uint8(A);
H=fspecial('average',[3 3]);
T=imfilter(A,H);
T(3,3) % The answer is 13
but I can't find new value of the pixel (4,4) after that applied the 4 neighborhood Laplacian operation. I don't know how to do it. I tried this code for filter for the 4 neighborhood Laplacian operation.
A=uint8(A);
H = fspecial('laplacian',0.2)
T=imfilter(A,H);
I don't know how to find it. If you help me, i will be very happy.

Risposte (1)

Image Analyst
Image Analyst il 14 Nov 2020
MATLAB is 1-based, not zero based. So the pixel at (5,5) when starting with 0 in the upper left is really the value T(6,6).
  4 Commenti
Rooter Boy
Rooter Boy il 15 Nov 2020
Sir,
No no , i'm not sure. I just tried this code "H = fspecial('laplacian', 0.2)" for finding answer of question 8. I have a no idea about this question.
That is most likely a wrong try, so this code will not.
İf we use "H = [0, -1, 0; -1, 4, -1; 0, -1, 0];", so how do we use this to find the answer of Question 8 ?
Rooter Boy
Rooter Boy il 15 Nov 2020
Sir, Thank you for answer. I voted your answer. I have last one more question, I would be glad if you look at it.
I found answer is 130 but i'm not sure. I'll be glad if you check.

Accedi per commentare.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by