MATLAB: Remove duplicate locations and replace by a single one

coordinatesduplicatesimageunique

Hi.
I am trying to locate the 6 dots in my frequency domain image (its the FFT of a hexagonal array of spots)
Using a technique called "template matching" via matlabs function c=normxcorr2(template,Raw), I'm able to locate the 6 best matches. However, as below some of the matches occur that are 2 for the same object (just displaced by say 1 pixel in the image)
the location x, y and actual intensity of the 6 matches are:
75.0000 204.0000 0.7882
75.0000 205.0000 0.7882
140.0000 315.0000 0.7607
268.0000 93.0000 0.7607
333.0000 203.0000 0.7555
333.0000 204.0000 0.7555
How can I replace similar locations that are within say 10 pixels in either x or y of each other with the one that has the highest intensity. If the intensities are the same just pick the first one?
Thanks for any help Jason

Best Answer

https://www.mathworks.com/help/matlab/ref/uniquetol.html
Related Question