4 x 4 Mask to Identify Regions on Map with Highest Value
Mostra commenti meno recenti
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
Risposta accettata
Più risposte (1)
jonas
il 19 Lug 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 Commento
Michelle De Luna
il 1 Ago 2020
Categorie
Scopri di più su Display Image in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
