4 x 4 Mask to Identify Regions on Map with Highest Value
古いコメントを表示
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
採用された回答
その他の回答 (1 件)
jonas
2020 年 7 月 19 日
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.
カテゴリ
ヘルプ センター および File Exchange で Display Image についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
