finding first and second maximum in an image/matrix

2 views (last 30 days)
Hello,
I have a 360x180 matrix. It has the normalised energy values in dB representing the beam pattern of microphone array in (1:360)° azimuth versus (1:180)° elevation angles.
When I plot it as imagesc(), I have a mainlobe at certain azimuth and elevation surrounded by few sidelobes.
Now I want to find the ratio of maximum sidelobe to the mainlobe. How can I do it?
Please help.

Answers (1)

Image Analyst
Image Analyst on 28 Jan 2012
Since your peaks probably have some width to them you can't simply sort the values and find the greatest. You also probably can't just threshold the image since the separate peaks may have different heights. Therefore I recommend using imregionalmax() in the Image Processing Toolbox. Then you can binarize the image and label it and call regionprops. For each peak you can get the max. (Actually you can get that without even calling regionprops.) But you probably need regionprops to find the centroids of all the peaks so you can determine which blobs are main peaks and which blobs are sidelobes of that main peak (say, the side lobe centroids are within a certain distance of the centroid of the larger main peak). Upload your image to tinypic.com if you need any help. It can get a little tricky if you have multiple clusters of peaks & side lobes and all those have different heights
  15 Comments
zozo
zozo on 30 Jan 2012
Also, I think I need to process the matrix H(360x180) itself instead of images. Since I need to loop this process around to find the above ratio for all 64800 angles(meaning 68400 images!!) and plot them together using imagesc() or surf().
Please guide.
zozo
zozo on 1 Feb 2012
I have done the following:
peaks=imregionalmax(H); %H is 360x180 matrix
G=regionprops(peaks,'PixelIdxLis');
figure
imagesc(ele,azi,peaks); % view max. peaks
r=struct2cell(G);
O=cell2mat(r);
v=O(end-1)./O(end);
Finally I have ratio of 2nd max to max peaks stored in v in conjecture with second sidelobe to mainlobe of beampattern.
Isit sufficient? Or do I have to find Intensities at each peak?

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!