ImageDev

PeakExtractor

This command is experimental, his signature may be modified between now and his final version.

Extracts the peaks (local maxima) of an image using a circular neighborhood analysis.

Function Syntax

This function returns outputMeasurement.
// Function prototype
PeakExtractorMsr::Ptr peakExtractor( std::shared_ptr< iolink::ImageView > inputImage, uint32_t numberOfPeaks, double threshold, iolink::Vector3u32 radius, PeakExtractor::Method method, PeakExtractorMsr::Ptr outputMeasurement = nullptr );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image from which the peaks must be extracted. Image Binary, Label or Grayscale nullptr
input
numberOfPeaks
The maximum number of peaks to extract. If this value is set to 0, all peaks having an intensity greater than or equal to the threshold vaue are detected. UInt32 Any value 0
input
threshold
The threshold value that determines the minimal intensity of a selected peak. Float64 Any value 0.5
input
method
The method for extracting the peaks.
FAST Rough extraction of local maxima.
Enumeration FAST
input
radius
The minimum distance between two extracted peaks in pixels, along the X, Y, and Z directions Vector3u32 Any value {10, 10, 10}
output
outputMeasurement
PeakExtractorMsr object containing the detected templates with their position and the peak value (analysis object). PeakExtractorMsr nullptr

Object Examples

auto fibers_score = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "fibers_score.vip" );

PeakExtractor peakExtractorAlgo;
peakExtractorAlgo.setInputImage( fibers_score );
peakExtractorAlgo.setNumberOfPeaks( 0 );
peakExtractorAlgo.setThreshold( 4000 );
peakExtractorAlgo.setRadius( {15, 15, 15} );
peakExtractorAlgo.setMethod( PeakExtractor::Method::FAST );
peakExtractorAlgo.execute();

std::cout << "positionX: " << peakExtractorAlgo.outputMeasurement()->positionX( 0 ) ;

Function Examples

auto fibers_score = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "fibers_score.vip" );

auto result = peakExtractor( fibers_score, 0, 4000, {15, 15, 15}, PeakExtractor::Method::FAST );

std::cout << "positionX: " << result->positionX( 0 ) ;