how to replace the center pixel of a 3X3 window with the min difference among its surronding pixels in matlab?
Ältere Kommentare anzeigen
I want to replace the center pixel of a 3x3 window filter with the minimum difference among its surrounding pixels. I want to run this process for all pixels of the image.
Then I want to calculate the mean square of the minimum differences of all pixels in the entire image.
Would you please give me some suggestion or code snippet to solve my problem. I am new in matlab.
Please response..
2 Kommentare
Walter Roberson
am 25 Aug. 2013
If two pixels have the same value, then would the minimum difference be 0? Or should the minimum difference be only amongst the unique values (unless all the values are the same)?
Are you wanting the minimum difference comparing the center pixel with the others, or the minimum difference between all pixels in the window compared to all other pixels in the window?
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 25 Aug. 2013
0 Stimmen
You could do it easily with blockproc()
1 Kommentar
Walter Roberson
am 25 Aug. 2013
If Px is the 3 x 3 pixel array, then
min(diff(sort(Px([1:4, 6:9]))))
Kategorien
Mehr zu Images finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!