How to pick a sliding window of pixels arround a pixel ?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Ynne
am 25 Dez. 2017
Kommentiert: Ynne
am 25 Dez. 2017
Hi, I used the following loop to select at each iteration a window of 5x5 pixels around a pixel of a given image 'im' in this case:
for ii=3:size(im,1)-2
for jj=3:size(im,2)-2
win=im(ii-2:ii+2,jj-2:jj+2);
end
end
How do i change it to enlarge the window to 32x32 ?
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 25 Dez. 2017
Change the 2 to 15 and 16. Note that usually window sizes are an odd number so that the filter does not create a half pixel shift in the output image. Because your size is not odd, that's why you have to subtract 15 but add 16, or vice versa, instead of the same number for each direction.
And, why don't you use nlfilter(), like in my attached demo, which handles all of that for you?
5 Kommentare
Image Analyst
am 25 Dez. 2017
correlagram may not have 64 elements.
After you get it, set a breakpoint there and execute this line
>> whos correlogram
What does it say?
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!