ImageDev

GrayscaleToColor

Combines three grayscale input images into a single RGB output image.

Access to parameter description

For an introduction to image filters: section Color Transforms.

GrayscaleToColor builds an RGB image from three grayscale images representing its red, green, and blue components.

See also
See related example

Function Syntax

This function returns outputColorImage.
// Function prototype
std::shared_ptr< iolink::ImageView > grayscaleToColor( std::shared_ptr< iolink::ImageView > inputGrayImage1, std::shared_ptr< iolink::ImageView > inputGrayImage2, std::shared_ptr< iolink::ImageView > inputGrayImage3, std::shared_ptr< iolink::ImageView > outputColorImage = nullptr );
This function returns outputColorImage.
// Function prototype.
grayscale_to_color(input_gray_image1: idt.ImageType,
                   input_gray_image2: idt.ImageType,
                   input_gray_image3: idt.ImageType,
                   output_color_image: idt.ImageType = None) -> idt.ImageType
This function returns outputColorImage.
// Function prototype.
public static IOLink.ImageView
GrayscaleToColor( IOLink.ImageView inputGrayImage1,
                  IOLink.ImageView inputGrayImage2,
                  IOLink.ImageView inputGrayImage3,
                  IOLink.ImageView outputColorImage = null );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputGrayImage1
The first channel input image (red component). Image Binary, Label or Grayscale nullptr
input
inputGrayImage2
The second channel input image (green component). Its dimensions and type must be the same as the first input. Image Binary, Label or Grayscale nullptr
input
inputGrayImage3
The third channel input image (blue component). Its dimensions and type must be the same as the first input. Image Binary, Label or Grayscale nullptr
output
outputColorImage
The output image. Its spatial dimensions and type are forced to the same values as the inputs. Image nullptr
Parameter Name Description Type Supported Values Default Value
input
input_gray_image1
The first channel input image (red component). image Binary, Label or Grayscale None
input
input_gray_image2
The second channel input image (green component). Its dimensions and type must be the same as the first input. image Binary, Label or Grayscale None
input
input_gray_image3
The third channel input image (blue component). Its dimensions and type must be the same as the first input. image Binary, Label or Grayscale None
output
output_color_image
The output image. Its spatial dimensions and type are forced to the same values as the inputs. image None
Parameter Name Description Type Supported Values Default Value
input
inputGrayImage1
The first channel input image (red component). Image Binary, Label or Grayscale null
input
inputGrayImage2
The second channel input image (green component). Its dimensions and type must be the same as the first input. Image Binary, Label or Grayscale null
input
inputGrayImage3
The third channel input image (blue component). Its dimensions and type must be the same as the first input. Image Binary, Label or Grayscale null
output
outputColorImage
The output image. Its spatial dimensions and type are forced to the same values as the inputs. Image null

Object Examples

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

GrayscaleToColor grayscaleToColorAlgo;
grayscaleToColorAlgo.setInputGrayImage1( foam );
grayscaleToColorAlgo.setInputGrayImage2( foam );
grayscaleToColorAlgo.setInputGrayImage3( foam );
grayscaleToColorAlgo.execute();

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

grayscale_to_color_algo = imagedev.GrayscaleToColor()
grayscale_to_color_algo.input_gray_image1 = foam
grayscale_to_color_algo.input_gray_image2 = foam
grayscale_to_color_algo.input_gray_image3 = foam
grayscale_to_color_algo.execute()

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

GrayscaleToColor grayscaleToColorAlgo = new GrayscaleToColor
{
    inputGrayImage1 = foam,
    inputGrayImage2 = foam,
    inputGrayImage3 = foam
};
grayscaleToColorAlgo.Execute();

Console.WriteLine( "outputColorImage:" + grayscaleToColorAlgo.outputColorImage.ToString() );

Function Examples

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

auto result = grayscaleToColor( foam, foam, foam );

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

result = imagedev.grayscale_to_color(foam, foam, foam)

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

IOLink.ImageView result = Processing.GrayscaleToColor( foam, foam, foam );

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