peaks2 - find peaks in 2D data without additional toolbox

Find peaks in 2D data just as with Matlab's 'findpeaks' function

Ahora está siguiendo esta publicación

Fast and effective 2D peak finding algorithm returning peak locations and values. Accepts 2D arrays as an input (for instance, image acquired with a camera from some optics experiment). Various filters can be selected such as the minimal absolute value or threshold above the immediate surroundings etc.
It mimicks the same syntax as Matlab's own 'findpeaks' function but does not require any additional Matlab toolbox, just the base program.
MinPeakHeight, Threshold and MinPeakDistance parameters are accepted, just like in the original 'findpeaks' function:
● MinPeakHeight simply filters out those peaks lower than this absolute value;
● Threshold only retains those peaks higher than its immediate neighbors by the specified threshold value;
● MinPeakDistance specifies the minimal Cartesian circle around which weaker peaks are 'shadowed' and removed;
● as of this moment, peak prominence is not implemented yet.
The idea behind the algorithm is simple yet effective. The 2D peak finding algorithm works by comparing each point to its immediate surroudings (all 8 points around: left, rihgt, top, bottom etc.) in an vectorised fashion. This guarantees minimal execution time. A point is considered as a peak if it is strictly greater than its immediate neighbors all around.

Citar como

Kristupas Tikuišis (2026). peaks2 - find peaks in 2D data without additional toolbox (https://es.mathworks.com/matlabcentral/fileexchange/113225-peaks2-find-peaks-in-2d-data-without-additional-toolbox), MATLAB Central File Exchange. Recuperado .

Agradecimientos

Inspiración para: Mobile Phone Astrometry Explorer

Información general

Compatibilidad con la versión de MATLAB

  • Compatible con cualquier versión

Compatibilidad con las plataformas

  • Windows
  • macOS
  • Linux
Versión Publicado Notas de la versión Action
1.1.3

In the new MinPeakDistance filter, the final peak list was not updated. Now corrected.

1.1.2

Minimal polishing of the description

1.1.1

The code cleaned a bit, no other real changes

1.1

MinPeakDistance functionality added

1.0.3

Updated image

1.0.2

Updated description

1.0.1

I simply updated the description of the function, as well as proper tagging. No code change this time.

1.0.0