ImageDev

Shade2d

Provides a shadowing effect on a grayscale image.

Access to parameter description

For an introduction to image filters: see section Images Filtering.

This filter is actually a combination of the search of maxima and mean values.
The proposed algorithm is from S. Steinberg, and enhances some object edges in the image. It makes the assumption that: The shaded image shows the shadow of each object under these light conditions.

Note: Because the resulting image is forced to a signed type (containing positive and negative values), it must be visualized by adjusting the data range settings.

See also

Function Syntax

This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > shade2d( std::shared_ptr< iolink::ImageView > inputImage, std::shared_ptr< iolink::ImageView > outputImage = NULL );
This function returns outputImage.
// Function prototype.
shade_2d( input_image, output_image = None )
This function returns outputImage.
// Function prototype.
public static IOLink.ImageView
Shade2d( IOLink.ImageView inputImage, IOLink.ImageView outputImage = null );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. Image Grayscale or Multispectral nullptr
output
outputImage
The output image. Its dimensions are forced to the same values as the input. If the input data type is unsigned, it is switched to its signed counterpart. Image nullptr
Parameter Name Description Type Supported Values Default Value
input
input_image
The input image. image Grayscale or Multispectral None
output
output_image
The output image. Its dimensions are forced to the same values as the input. If the input data type is unsigned, it is switched to its signed counterpart. image None
Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. Image Grayscale or Multispectral null
output
outputImage
The output image. Its dimensions are forced to the same values as the input. If the input data type is unsigned, it is switched to its signed counterpart. Image null

Object Examples

std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" );

Shade2d shade2dAlgo;
shade2dAlgo.setInputImage( polystyrene );
shade2dAlgo.execute();

std::cout << "outputImage:" << shade2dAlgo.outputImage()->toString();
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif"))

shade_2d_algo = imagedev.Shade2d()
shade_2d_algo.input_image = polystyrene
shade_2d_algo.execute()

print( "output_image:", str( shade_2d_algo.output_image ) )
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" );

Shade2d shade2dAlgo = new Shade2d
{
    inputImage = polystyrene
};
shade2dAlgo.Execute();

Console.WriteLine( "outputImage:" + shade2dAlgo.outputImage.ToString() );

Function Examples

std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" );

auto result = shade2d( polystyrene );

std::cout << "outputImage:" << result->toString();
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif"))

result = imagedev.shade_2d( polystyrene )

print( "output_image:", str( result ) )
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" );

IOLink.ImageView result = Processing.Shade2d( polystyrene );

Console.WriteLine( "outputImage:" + result.ToString() );