4D Matrix Local Maxima
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi All,
Here is my question. I have a 4D matrix with values. I.e. grids = zeros (10, 10, 100, 100). For each of the coordinates of this matrix we have values. I.e. grids(1,4,30,40) == 1223.3. Now I want to find the local maximas for this matrix. I used imregionalmax function but the function uses a connectivity which assumes all dimensions have the same length (for 2D it uses 8 pixel connectivity). Thus although it returns the true local maximas, it also returns many redundant values as well. My question is that is there any way to find the local maxima for matrices. Thanks.
Here is how I used the imregionalmax:
- localMaxima = imregionalmax(grids);
- linInd = find (localMaxima);
- LRvals = grids (linInd);
- [indx, indy, inz, int] = ind2sub(size(localMaxima), find(localMaxima));
- indicesLR = [indx, indy, inz, int];
- finalResult = [indicesLR, LRvals];
Here is and example of the output: The first two dimensions of my matrix represents a location and the other two represents the distance. My result set is like below but I don't want to see the redundant ones. I only want the number 2,4 in the list below.
Local Maxima Result List
- [5,5,23,28] = 10233
- [5,5,24,27] = 12111
- [5,5,22,29] = 9989
- [5,5,31,44] = 14242
- [5,5,37,43] = 13288
0 Kommentare
Antworten (2)
Image Analyst
am 24 Okt. 2014
imregionalmax() does not find local max everywhere , it only finds pixels that ARE the local max. If you don't understand the difference, let me know. To find the local max for every location, you need imdilate().
0 Kommentare
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!