GrayscaleReconstruction3d
Performs a three-dimensional numerical reconstruction, starting from a grayscale marker image, into a grayscale input image.
Access to parameter description
For an introduction:
This algorithm is based on a recursive method whereby the minimum between the dilated or eroded image and the mask image is retained and used as the marker image for the next step.
At each step, the marker image is dilated or eroded by a structuring element of size 1.
This operation is repeated until stability. Therefore, the number of iterations depends on the input image and the marker image.
As shown in Figure 1, peaks and ridges are leveled down with a reconstruction by dilation, which results in a much more homogeneous output image.
Figure 1. One-dimensional example of a reconstruction by dilation
As shown in Figure 2, the valleys are leveled up with a reconstruction by erosion, which results in a much more homogeneous output image.
Figure 2. One-dimensional example of a reconstruction by erosion
See also
Access to parameter description
For an introduction:
- section Mathematical Morphology
- section Geodesic Transformations
This algorithm is based on a recursive method whereby the minimum between the dilated or eroded image and the mask image is retained and used as the marker image for the next step.
At each step, the marker image is dilated or eroded by a structuring element of size 1.
This operation is repeated until stability. Therefore, the number of iterations depends on the input image and the marker image.
As shown in Figure 1, peaks and ridges are leveled down with a reconstruction by dilation, which results in a much more homogeneous output image.
Figure 1. One-dimensional example of a reconstruction by dilation
As shown in Figure 2, the valleys are leveled up with a reconstruction by erosion, which results in a much more homogeneous output image.
Figure 2. One-dimensional example of a reconstruction by erosion
See also
Function Syntax
This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > grayscaleReconstruction3d( std::shared_ptr< iolink::ImageView > inputImage, std::shared_ptr< iolink::ImageView > inputMarkerImage, GrayscaleReconstruction3d::ReconstructionType reconstructionType, GrayscaleReconstruction3d::Neighborhood neighborhood, std::shared_ptr< iolink::ImageView > outputImage = NULL );
This function returns outputImage.
// Function prototype. grayscale_reconstruction_3d( input_image, input_marker_image, reconstruction_type = GrayscaleReconstruction3d.ReconstructionType.DILATION, neighborhood = GrayscaleReconstruction3d.Neighborhood.CONNECTIVITY_26, output_image = None )
This function returns outputImage.
// Function prototype. public static IOLink.ImageView GrayscaleReconstruction3d( IOLink.ImageView inputImage, IOLink.ImageView inputMarkerImage, GrayscaleReconstruction3d.ReconstructionType reconstructionType = ImageDev.GrayscaleReconstruction3d.ReconstructionType.DILATION, GrayscaleReconstruction3d.Neighborhood neighborhood = ImageDev.GrayscaleReconstruction3d.Neighborhood.CONNECTIVITY_26, IOLink.ImageView outputImage = null );
Class Syntax
Parameters
Parameter Name | Description | Type | Supported Values | Default Value | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|
inputImage |
The grayscale input mask image constraining reconstruction. | Image | Binary, Label or Grayscale | nullptr | |||||||
inputMarkerImage |
The grayscale input marker image containing seeds for reconstruction. It must have the same dimensions and type as the input image. | Image | Binary, Label, Grayscale or Multispectral | nullptr | |||||||
reconstructionType |
The type of reconstruction algorithm to apply.
|
Enumeration | DILATION | ||||||||
neighborhood |
The 3D neighborhood configuration for performing dilations or erosions.
|
Enumeration | CONNECTIVITY_26 | ||||||||
outputImage |
The output image. Its dimensions and type are forced to the same values as the input. | Image | nullptr |
Parameter Name | Description | Type | Supported Values | Default Value | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|
input_image |
The grayscale input mask image constraining reconstruction. | image | Binary, Label or Grayscale | None | |||||||
input_marker_image |
The grayscale input marker image containing seeds for reconstruction. It must have the same dimensions and type as the input image. | image | Binary, Label, Grayscale or Multispectral | None | |||||||
reconstruction_type |
The type of reconstruction algorithm to apply.
|
enumeration | DILATION | ||||||||
neighborhood |
The 3D neighborhood configuration for performing dilations or erosions.
|
enumeration | CONNECTIVITY_26 | ||||||||
output_image |
The output image. Its dimensions and type are forced to the same values as the input. | image | None |
Parameter Name | Description | Type | Supported Values | Default Value | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|
inputImage |
The grayscale input mask image constraining reconstruction. | Image | Binary, Label or Grayscale | null | |||||||
inputMarkerImage |
The grayscale input marker image containing seeds for reconstruction. It must have the same dimensions and type as the input image. | Image | Binary, Label, Grayscale or Multispectral | null | |||||||
reconstructionType |
The type of reconstruction algorithm to apply.
|
Enumeration | DILATION | ||||||||
neighborhood |
The 3D neighborhood configuration for performing dilations or erosions.
|
Enumeration | CONNECTIVITY_26 | ||||||||
outputImage |
The output image. Its dimensions and type are forced to the same values as the input. | Image | null |
Object Examples
auto foam = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam.vip" ); GrayscaleReconstruction3d grayscaleReconstruction3dAlgo; grayscaleReconstruction3dAlgo.setInputImage( foam ); grayscaleReconstruction3dAlgo.setInputMarkerImage( foam ); grayscaleReconstruction3dAlgo.setReconstructionType( GrayscaleReconstruction3d::ReconstructionType::DILATION ); grayscaleReconstruction3dAlgo.setNeighborhood( GrayscaleReconstruction3d::Neighborhood::CONNECTIVITY_26 ); grayscaleReconstruction3dAlgo.execute(); std::cout << "outputImage:" << grayscaleReconstruction3dAlgo.outputImage()->toString();
foam = imagedev.read_vip_image(imagedev_data.get_image_path("foam.vip")) grayscale_reconstruction_3d_algo = imagedev.GrayscaleReconstruction3d() grayscale_reconstruction_3d_algo.input_image = foam grayscale_reconstruction_3d_algo.input_marker_image = foam grayscale_reconstruction_3d_algo.reconstruction_type = imagedev.GrayscaleReconstruction3d.DILATION grayscale_reconstruction_3d_algo.neighborhood = imagedev.GrayscaleReconstruction3d.CONNECTIVITY_26 grayscale_reconstruction_3d_algo.execute() print( "output_image:", str( grayscale_reconstruction_3d_algo.output_image ) )
ImageView foam = Data.ReadVipImage( @"Data/images/foam.vip" ); GrayscaleReconstruction3d grayscaleReconstruction3dAlgo = new GrayscaleReconstruction3d { inputImage = foam, inputMarkerImage = foam, reconstructionType = GrayscaleReconstruction3d.ReconstructionType.DILATION, neighborhood = GrayscaleReconstruction3d.Neighborhood.CONNECTIVITY_26 }; grayscaleReconstruction3dAlgo.Execute(); Console.WriteLine( "outputImage:" + grayscaleReconstruction3dAlgo.outputImage.ToString() );
Function Examples
auto foam = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam.vip" ); auto result = grayscaleReconstruction3d( foam, foam, GrayscaleReconstruction3d::ReconstructionType::DILATION, GrayscaleReconstruction3d::Neighborhood::CONNECTIVITY_26 ); std::cout << "outputImage:" << result->toString();
foam = imagedev.read_vip_image(imagedev_data.get_image_path("foam.vip")) result = imagedev.grayscale_reconstruction_3d( foam, foam, imagedev.GrayscaleReconstruction3d.DILATION, imagedev.GrayscaleReconstruction3d.CONNECTIVITY_26 ) print( "output_image:", str( result ) )
ImageView foam = Data.ReadVipImage( @"Data/images/foam.vip" ); IOLink.ImageView result = Processing.GrayscaleReconstruction3d( foam, foam, GrayscaleReconstruction3d.ReconstructionType.DILATION, GrayscaleReconstruction3d.Neighborhood.CONNECTIVITY_26 ); Console.WriteLine( "outputImage:" + result.ToString() );