CannyEdgeDetector2d
Performs Canny's computational approach to edge detection on a two-dimensional grayscale image.
Access to parameter description
This algorithm extracts the local maxima of a smoothed gradient image by applying the following steps:
To complete the Canny edge detector method, a thresholding by hysteresis must be applied on this output image afterward.
A second output provides an estimation of the two threshold values necessary to perform this step.
Reference: J.F.Canny. "A computational approach to edge detection." IEEE Transactions on Pattern Analysis and Machine Intelligence, vol.8, No 6, pp. 679-698, Nov. 1986.
See also
Access to parameter description
This algorithm extracts the local maxima of a smoothed gradient image by applying the following steps:
- Gaussian filtering
- Gradient computation
- Non maximum suppression in the gradient direction
To complete the Canny edge detector method, a thresholding by hysteresis must be applied on this output image afterward.
A second output provides an estimation of the two threshold values necessary to perform this step.
Reference: J.F.Canny. "A computational approach to edge detection." IEEE Transactions on Pattern Analysis and Machine Intelligence, vol.8, No 6, pp. 679-698, Nov. 1986.
See also
Function Syntax
This function returns a CannyEdgeDetector2dOutput structure containing outputImage and outputMeasurement.
// Output structure of the cannyEdgeDetector2d function. struct CannyEdgeDetector2dOutput { /// The output grayscale image representing the detected edges. std::shared_ptr< iolink::ImageView > outputImage; /// The output measurement provides the estimated parameters of the threshold values used by the hysteresis. CannyEdgeDetectorMsr::Ptr outputMeasurement; }; // Function prototype
CannyEdgeDetector2dOutput cannyEdgeDetector2d( std::shared_ptr< iolink::ImageView > inputImage, iolink::Vector2d standardDeviation, std::shared_ptr< iolink::ImageView > outputImage = NULL, CannyEdgeDetectorMsr::Ptr outputMeasurement = NULL );
Class Syntax
Parameters
Parameter Name | Description | Type | Supported Values | Default Value | |
---|---|---|---|---|---|
![]() |
inputImage |
The input grayscale image. | Image | Binary, Label, Grayscale or Multispectral | nullptr |
![]() |
standardDeviation |
The gaussian filter standard deviation value. | Vector2d | >=0.1 | {1.f, 1.f} |
![]() |
outputImage |
The output grayscale image representing the detected edges.
Its dimensions are forced to the same values as the input. Its data type is forced to floating point. |
Image | nullptr | |
![]() |
outputMeasurement |
The output measurement provides the estimated parameters of the threshold values used by the hysteresis. | CannyEdgeDetectorMsr | nullptr |
Object Examples
std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" ); CannyEdgeDetector2d cannyEdgeDetector2dAlgo; cannyEdgeDetector2dAlgo.setInputImage( polystyrene ); cannyEdgeDetector2dAlgo.setStandardDeviation( {1, 1} ); cannyEdgeDetector2dAlgo.execute(); std::cout << "outputImage:" << cannyEdgeDetector2dAlgo.outputImage()->toString(); std::cout << "thresholdHigh: " << cannyEdgeDetector2dAlgo.outputMeasurement()->thresholdHigh( 0 ) ;
Function Examples
std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" ); auto result = cannyEdgeDetector2d( polystyrene, {1, 1} ); std::cout << "outputImage:" << result.outputImage->toString(); std::cout << "thresholdHigh: " << result.outputMeasurement->thresholdHigh( 0 ) ;