ImageDev

UnsharpMasking3d

Sharpens edges on the elements of a two-dimensional image without increasing noise.

Access to parameter description

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

This algorithm is a very common filter that sharpens edges on the elements of an image without increasing noise. It first applies a Gaussian filter to a copy of the original image and blends it with the original. Undesired effects are finally reduced by using a mask to only apply the sharpening on the desired regions (that is, regions for which the gradient is above a certain threshold).

Note: Since the original data range is not preserved by this filter, the output image type is upgraded according to the Image type basic rule.

See also

Function Syntax

This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > unsharpMasking3d( std::shared_ptr< iolink::ImageView > inputImage, double edgeSize, double edgeContrast, double brightnessThreshold, std::shared_ptr< iolink::ImageView > outputImage = NULL );
This function returns outputImage.
// Function prototype.
unsharp_masking_3d( input_image,
                    edge_size = 5,
                    edge_contrast = 0.5,
                    brightness_threshold = 0,
                    output_image = None )
This function returns outputImage.
// Function prototype.
public static IOLink.ImageView
UnsharpMasking3d( IOLink.ImageView inputImage,
                  double edgeSize = 5,
                  double edgeContrast = 0.5,
                  double brightnessThreshold = 0,
                  IOLink.ImageView outputImage = null );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. Image Binary, Label, Grayscale or Multispectral nullptr
input
edgeSize
The radius of the desired edges. Float64 >0 5
input
edgeContrast
The contrast amount added at the edges. Float64 >0 0.5
input
brightnessThreshold
The minimum brightness threshold. Float64 >=0 0
output
outputImage
The output image. Its dimensions are forced to the same values as the input. Its data type is promoted. Image nullptr
Parameter Name Description Type Supported Values Default Value
input
input_image
The input image. image Binary, Label, Grayscale or Multispectral None
input
edge_size
The radius of the desired edges. float64 >0 5
input
edge_contrast
The contrast amount added at the edges. float64 >0 0.5
input
brightness_threshold
The minimum brightness threshold. float64 >=0 0
output
output_image
The output image. Its dimensions are forced to the same values as the input. Its data type is promoted. image None
Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. Image Binary, Label, Grayscale or Multispectral null
input
edgeSize
The radius of the desired edges. Float64 >0 5
input
edgeContrast
The contrast amount added at the edges. Float64 >0 0.5
input
brightnessThreshold
The minimum brightness threshold. Float64 >=0 0
output
outputImage
The output image. Its dimensions are forced to the same values as the input. Its data type is promoted. Image null

Object Examples

auto foam = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam.vip" );

UnsharpMasking3d unsharpMasking3dAlgo;
unsharpMasking3dAlgo.setInputImage( foam );
unsharpMasking3dAlgo.setEdgeSize( 5.0 );
unsharpMasking3dAlgo.setEdgeContrast( 0.5 );
unsharpMasking3dAlgo.setBrightnessThreshold( 0.0 );
unsharpMasking3dAlgo.execute();

std::cout << "outputImage:" << unsharpMasking3dAlgo.outputImage()->toString();
foam = imagedev.read_vip_image(imagedev_data.get_image_path("foam.vip"))

unsharp_masking_3d_algo = imagedev.UnsharpMasking3d()
unsharp_masking_3d_algo.input_image = foam
unsharp_masking_3d_algo.edge_size = 5.0
unsharp_masking_3d_algo.edge_contrast = 0.5
unsharp_masking_3d_algo.brightness_threshold = 0.0
unsharp_masking_3d_algo.execute()

print( "output_image:", str( unsharp_masking_3d_algo.output_image ) )
ImageView foam = Data.ReadVipImage( @"Data/images/foam.vip" );

UnsharpMasking3d unsharpMasking3dAlgo = new UnsharpMasking3d
{
    inputImage = foam,
    edgeSize = 5.0,
    edgeContrast = 0.5,
    brightnessThreshold = 0.0
};
unsharpMasking3dAlgo.Execute();

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

Function Examples

auto foam = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam.vip" );

auto result = unsharpMasking3d( foam, 5.0, 0.5, 0.0 );

std::cout << "outputImage:" << result->toString();
foam = imagedev.read_vip_image(imagedev_data.get_image_path("foam.vip"))

result = imagedev.unsharp_masking_3d( foam, 5.0, 0.5, 0.0 )

print( "output_image:", str( result ) )
ImageView foam = Data.ReadVipImage( @"Data/images/foam.vip" );

IOLink.ImageView result = Processing.UnsharpMasking3d( foam, 5.0, 0.5, 0.0 );

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