| Table of Contents / Image / Creation | Operators |
gen_image_const — Create an image with constant gray value.
The operator gen_image_const creates an image of the indicated size. The height and width of the image are determined by Height and Width. HALCON supports the following image types:
1 byte per pixel, (0..255)
1 byte per pixel, signed
2 bytes per pixel, signed
2 bytes per pixel, unsigned
4 bytes per pixel, signed
8 bytes per pixel, signed, available on 64 bit systems only)
4 bytes per pixel, floating point
two matrices of the type 'real'
two matrices of type 'real'
1 byte per pixel (0..180)
1 byte per pixel; cyclic arithmetics (0..255).
The default value 0 is set via the operator set_system('init_new_image',<'true'/'false'>).
Created image with new image matrix.
Pixel type.
Default value: 'byte'
List of values: 'byte', 'direction', 'cyclic', 'int1', 'int2', 'uint2', 'int4', 'int8', 'real', 'complex', 'vector_field'
Width of image.
Default value: 512
Suggested values: 128, 256, 512, 1024
Typical range of values: 1 ≤ Width ≤ 512 (lin)
Minimum increment: 1
Recommended increment: 10
Restriction: Width >= 1
Height of image.
Default value: 512
Suggested values: 128, 256, 512, 1024
Typical range of values: 1 ≤ Height ≤ 512 (lin)
Minimum increment: 1
Recommended increment: 10
Restriction: Height >= 1
gen_image_const(&New,"byte",width,height);
get_image_pointer1(New,(long*)&pointer,type,&width,&height);
for (row=0; row<height-1; row++)
for (col=0; col<width-1; col++)
pointer[row*width+col] = (row + col) % 256;
If the parameter values are correct, the operator gen_image_const returns the value 2 (H_MSG_TRUE). Otherwise an exception is raised.
paint_region, reduce_domain, get_image_pointer1, copy_obj
reduce_domain, paint_gray, paint_region, set_grayval, get_image_pointer1
Foundation
| Table of Contents / Image / Creation | Operators |
| HALCON Reference Manual 10.0.2 | Copyright © 1996-2011 MVTec Software GmbH |