VectorToMagnitude2d
Computes amplitude and orientation of a 2D vector such as a gradient from its X and Y components.
Access to parameter description
For an introduction to gradient operations: Gradient Section.
VectorToMagnitude2d extracts the Euclidean norm, maximum component or orientation of a 2D vector from its X and Y components.
It is typically used to compute the magnitude of a 2D image gradient.
The results depend on the selected output mode.
See also
Access to parameter description
For an introduction to gradient operations: Gradient Section.
VectorToMagnitude2d extracts the Euclidean norm, maximum component or orientation of a 2D vector from its X and Y components.
It is typically used to compute the magnitude of a 2D image gradient.
The results depend on the selected output mode.
See also
Function Syntax
This function returns a VectorToMagnitude2dOutput structure containing outputAmplitudeImage and outputOrientationImage.
// Output structure of the vectorToMagnitude2d function. struct VectorToMagnitude2dOutput { /// The amplitude output image. std::shared_ptr< iolink::ImageView > outputAmplitudeImage; /// The orientation output image. std::shared_ptr< iolink::ImageView > outputOrientationImage; }; // Function prototype
VectorToMagnitude2dOutput vectorToMagnitude2d( std::shared_ptr< iolink::ImageView > inputImageX, std::shared_ptr< iolink::ImageView > inputImageY, VectorToMagnitude2d::OutputType outputType, std::shared_ptr< iolink::ImageView > outputAmplitudeImage = NULL, std::shared_ptr< iolink::ImageView > outputOrientationImage = NULL );
Class Syntax
Parameters
Parameter Name | Description | Type | Supported Values | Default Value | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
inputImageX |
The X vector component input image. | Image | Grayscale or Multispectral | nullptr | ||||||
![]() |
inputImageY |
The Y vector component input image. | Image | Grayscale or Multispectral | nullptr | ||||||
![]() |
outputType |
The output mode.
|
Enumeration | AMPLITUDE_MAXIMUM | |||||||
![]() |
outputAmplitudeImage |
The amplitude output image. | Image | nullptr | |||||||
![]() |
outputOrientationImage |
The orientation output image. | Image | nullptr |
Object Examples
std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" ); VectorToMagnitude2d vectorToMagnitude2dAlgo; vectorToMagnitude2dAlgo.setInputImageX( polystyrene ); vectorToMagnitude2dAlgo.setInputImageY( polystyrene ); vectorToMagnitude2dAlgo.setOutputType( VectorToMagnitude2d::OutputType::AMPLITUDE_MAXIMUM ); vectorToMagnitude2dAlgo.execute(); std::cout << "outputAmplitudeImage:" << vectorToMagnitude2dAlgo.outputAmplitudeImage()->toString(); std::cout << "outputOrientationImage:" << vectorToMagnitude2dAlgo.outputOrientationImage()->toString();
Function Examples
std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" ); auto result = vectorToMagnitude2d( polystyrene, polystyrene, VectorToMagnitude2d::OutputType::AMPLITUDE_MAXIMUM ); std::cout << "outputAmplitudeImage:" << result.outputAmplitudeImage->toString(); std::cout << "outputOrientationImage:" << result.outputOrientationImage->toString();