BackgroundImage2d
Computes a background image from a grayscale image.
Access to parameter description
This algorithm estimates a background by interpolating all pixels contained in a binary mask by a second order polynomial. If no mask is provided, all the image pixels are considered for performing the interpolation.
See also
Access to parameter description
This algorithm estimates a background by interpolating all pixels contained in a binary mask by a second order polynomial. If no mask is provided, all the image pixels are considered for performing the interpolation.
See also
Function Syntax
This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > backgroundImage2d( std::shared_ptr< iolink::ImageView > inputImage, std::shared_ptr< iolink::ImageView > inputMaskImage, std::shared_ptr< iolink::ImageView > outputImage = NULL );
This function returns outputImage.
// Function prototype. background_image_2d( input_image, input_mask_image, output_image = None )
This function returns outputImage.
// Function prototype. public static IOLink.ImageView BackgroundImage2d( IOLink.ImageView inputImage, IOLink.ImageView inputMaskImage, IOLink.ImageView outputImage = null );
Class Syntax
Parameters
Parameter Name | Description | Type | Supported Values | Default Value | |
---|---|---|---|---|---|
inputImage |
The input image. | Image | Grayscale or Multispectral | nullptr | |
inputMaskImage |
The binary mask image for the polynomial interpolation. If it equals null, the background is computed from all pixels of the input image. This image must have same dimensions as the input image. | Image | Binary | nullptr | |
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 input image. | image | Grayscale or Multispectral | None | |
input_mask_image |
The binary mask image for the polynomial interpolation. If it equals null, the background is computed from all pixels of the input image. This image must have same dimensions as the input image. | image | Binary | None | |
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 input image. | Image | Grayscale or Multispectral | null | |
inputMaskImage |
The binary mask image for the polynomial interpolation. If it equals null, the background is computed from all pixels of the input image. This image must have same dimensions as the input image. | Image | Binary | null | |
outputImage |
The output image. Its dimensions and type are forced to the same values as the input. | Image | null |
Object Examples
std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" ); auto polystyrene_sep = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_sep.vip" ); BackgroundImage2d backgroundImage2dAlgo; backgroundImage2dAlgo.setInputImage( polystyrene ); backgroundImage2dAlgo.setInputMaskImage( polystyrene_sep ); backgroundImage2dAlgo.execute(); std::cout << "outputImage:" << backgroundImage2dAlgo.outputImage()->toString();
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif")) polystyrene_sep = imagedev.read_vip_image(imagedev_data.get_image_path("polystyrene_sep.vip")) background_image_2d_algo = imagedev.BackgroundImage2d() background_image_2d_algo.input_image = polystyrene background_image_2d_algo.input_mask_image = polystyrene_sep background_image_2d_algo.execute() print( "output_image:", str( background_image_2d_algo.output_image ) )
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" ); ImageView polystyrene_sep = Data.ReadVipImage( @"Data/images/polystyrene_sep.vip" ); BackgroundImage2d backgroundImage2dAlgo = new BackgroundImage2d { inputImage = polystyrene, inputMaskImage = polystyrene_sep }; backgroundImage2dAlgo.Execute(); Console.WriteLine( "outputImage:" + backgroundImage2dAlgo.outputImage.ToString() );
Function Examples
std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" ); auto polystyrene_sep = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_sep.vip" ); auto result = backgroundImage2d( polystyrene, polystyrene_sep ); std::cout << "outputImage:" << result->toString();
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif")) polystyrene_sep = imagedev.read_vip_image(imagedev_data.get_image_path("polystyrene_sep.vip")) result = imagedev.background_image_2d( polystyrene, polystyrene_sep ) print( "output_image:", str( result ) )
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" ); ImageView polystyrene_sep = Data.ReadVipImage( @"Data/images/polystyrene_sep.vip" ); IOLink.ImageView result = Processing.BackgroundImage2d( polystyrene, polystyrene_sep ); Console.WriteLine( "outputImage:" + result.ToString() );