RandomImage2d
Creates a new two-dimensional image with random values having an equidistribution.
Access to parameter description
RandomImage2d creates an image with random values that follow a uniform distribution.
The output image intensity values are included in the range $\left[Mean-\frac{Range}{2}~..~Mean+\frac{Range}{2}\right]$.
Where $Mean$ and $Range$ are input parameters of the algorithm.
The image histogram is flat, which means that each intensity has an equiprobability to occur.
The type of the output image is set by an enumerate as detailed in the Data Type Management section.
See also
See related example
Access to parameter description
RandomImage2d creates an image with random values that follow a uniform distribution.
The output image intensity values are included in the range $\left[Mean-\frac{Range}{2}~..~Mean+\frac{Range}{2}\right]$.
Where $Mean$ and $Range$ are input parameters of the algorithm.
The image histogram is flat, which means that each intensity has an equiprobability to occur.
The type of the output image is set by an enumerate as detailed in the Data Type Management section.
See also
See related example
Function Syntax
This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > randomImage2d( RandomImage2d::OutputType outputType, int32_t imageSizeX, int32_t imageSizeY, double mean, double range, std::shared_ptr< iolink::ImageView > outputImage = NULL );
This function returns outputImage.
// Function prototype. random_image_2d( output_type = RandomImage2d.OutputType.UNSIGNED_INTEGER_8_BIT, image_size_x = 1024, image_size_y = 1024, mean = 80, range = 10, output_image = None )
This function returns outputImage.
// Function prototype. public static IOLink.ImageView RandomImage2d( RandomImage2d.OutputType outputType = ImageDev.RandomImage2d.OutputType.UNSIGNED_INTEGER_8_BIT, Int32 imageSizeX = 1024, Int32 imageSizeY = 1024, double mean = 80, double range = 10, IOLink.ImageView outputImage = null );
Class Syntax
Parameters
Class Name | RandomImage2d |
---|
Parameter Name | Description | Type | Supported Values | Default Value | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
imageSizeX |
The X size in pixels of the output image. | Int32 | >=1 | 1024 | |||||||||||||||||
imageSizeY |
The Y size in pixels of the output image. | Int32 | >=1 | 1024 | |||||||||||||||||
outputType |
The output image data type.
|
Enumeration | UNSIGNED_INTEGER_8_BIT | ||||||||||||||||||
mean |
The mean intensity of the output distribution. | Float64 | Any value | 80 | |||||||||||||||||
range |
The intensity range of the output distribution. | Float64 | >0 | 10 | |||||||||||||||||
outputImage |
The output image. | Image | nullptr |
Object Examples
RandomImage2d randomImage2dAlgo; randomImage2dAlgo.setOutputType( RandomImage2d::OutputType::UNSIGNED_INTEGER_8_BIT ); randomImage2dAlgo.setImageSizeX( 256 ); randomImage2dAlgo.setImageSizeY( 256 ); randomImage2dAlgo.setMean( 80.0 ); randomImage2dAlgo.setRange( 10.0 ); randomImage2dAlgo.execute(); std::cout << "outputImage:" << randomImage2dAlgo.outputImage()->toString();
random_image_2d_algo = imagedev.RandomImage2d() random_image_2d_algo.output_type = imagedev.RandomImage2d.UNSIGNED_INTEGER_8_BIT random_image_2d_algo.image_size_x = 256 random_image_2d_algo.image_size_y = 256 random_image_2d_algo.mean = 80.0 random_image_2d_algo.range = 10.0 random_image_2d_algo.execute() print( "output_image:", str( random_image_2d_algo.output_image ) )
RandomImage2d randomImage2dAlgo = new RandomImage2d { outputType = RandomImage2d.OutputType.UNSIGNED_INTEGER_8_BIT, imageSizeX = 256, imageSizeY = 256, mean = 80.0, range = 10.0 }; randomImage2dAlgo.Execute(); Console.WriteLine( "outputImage:" + randomImage2dAlgo.outputImage.ToString() );
Function Examples
auto result = randomImage2d( RandomImage2d::OutputType::UNSIGNED_INTEGER_8_BIT, 256, 256, 80.0, 10.0 ); std::cout << "outputImage:" << result->toString();
result = imagedev.random_image_2d( imagedev.RandomImage2d.UNSIGNED_INTEGER_8_BIT, 256, 256, 80.0, 10.0 ) print( "output_image:", str( result ) )
IOLink.ImageView result = Processing.RandomImage2d( RandomImage2d.OutputType.UNSIGNED_INTEGER_8_BIT, 256, 256, 80.0, 10.0 ); Console.WriteLine( "outputImage:" + result.ToString() );