MATLAB: Is there a method to use ‘findpeaks’ to detect bright spots in an otherwise darkimage

findpeaksimage processingImage Processing ToolboxMATLABSignal Processing Toolbox

I am currently having the problem that if I run findpeaks along the columns of said image, the same spot is being detected multiple times, as it appears as peak in every column.
I am aware that there are ad-on options for 2D peak detection, but I was hoping for a solution using findpeaks.

Best Answer

you can post process the findpeaks output but it really does not seem to be worth the effort.
islocalmax(img,1) & islocalmax(img,2)
will find 2d peaks.
You might need to do some processing for the case where a peak is the same height for several adjacent spots. You could do a imclose or dilation, and perhaps a bwmorph()
Or you could start with a dilation and then check for local max and then a bwmorph shrink... something like that.