4D Matrix Local Maxima
이전 댓글 표시
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
답변 (2개)
Image Analyst
2014년 10월 24일
0 개 추천
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().
Ethan Turk
2014년 10월 24일
편집: Ethan Turk
2014년 10월 24일
0 개 추천
카테고리
도움말 센터 및 File Exchange에서 Video Formats and Interfaces에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!