4 x 4 Mask to Identify Regions on Map with Highest Value
Ältere Kommentare anzeigen
Good afternoon everyone!
I have a 360 x 576 matrix that represents a map of the world (latitude and longitude, respectively). Each of the elements in the matrix has a value between 0 and 100 that represents the amount of precipitation present at that geographic location. I would like to create a mask that checks every 4 rows by 4 columns to identify those regions on the "map" with the highest concentration of values. Essentially, I am looking for those regions where intense precipitation concentrates so that I may further inspect these geographic locations. Here, I think finding the average of the 4 x 4 mask might be helpful, but I don't know how to apply the averaging method to the entire matrix without overlapping. Also, I'm unsure if I can "highlight" the top five or so "4 x 4 boxes" with the highest values for the entire matrix. Any suggestions? I'm actively working on the problem but would appreciate any ideas. Thanks!
Michelle
Akzeptierte Antwort
Weitere Antworten (1)
jonas
am 19 Jul. 2020
Using imresize from the image processing TB
%non-overlapping (use conv2 method 'valid' for overlapping)
A = imresize(Z,0.5,'box');
%get indices for max id
[val, id] = max(A,[],[1,2],'linear');
[x,y] = ind2sub(size(A),id)*2;
The indices are multiplied by a factor 2 to get indices in the original matrix.
1 Kommentar
Michelle De Luna
am 1 Aug. 2020
Kategorien
Mehr zu Display Image finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
