read_sequence ( : Image : HeaderSize, SourceWidth, SourceHeight, StartRow, StartColumn, DestWidth, DestHeight, PixelType, BitOrder, ByteOrder, Pad, Index, FileName : )

Read images.

The operator read_sequence reads unformatted image data, from a file and returns a "suitable" image. The image data must be filed consecutively pixel by pixel and line by line. Any file headers (with the length HeaderSize bytes) are skipped. The parameters SourceWidth and SourceHeight indicate the size of the filed image. DestWidth and DestHeight indicate the size the image which is read should have. In the simplest case these parameters are the same. However, areas can also be read. The upper left corner of the required image area can be determined via StartRow and StartColumn.

The pixel types 'bit', 'byte', 'short' (16 bits, unsigned), 'signed_short' (16 bits, signed), 'long' (32 bits, signed) and 'swapped_long' (32 bits, with swapped segments) are supported. Furthermore the operator read_sequence enables the extraction of components of a RBG image if a triple of three bytes (in the sequence "red", "green", "blue") was filed in the image file. For the red component the pixel type 'r_byte' must be chosen, and correspondingly for the green and blue components 'g_byte' or 'b_byte', respectively.

'MSBFirst' (most significant bit first) or the inversion thereof ('LSBFirst') can be chosen for the bit order (BitOrder). The byte orders (ByteOrder) 'MSBFirst' (most significant byte first) or 'LSBFirst', respectively, are processed analogously. Finally an alignment (Pad) can be set at the end of the line: 'byte', 'short' or 'long'. If a whole image sequence is stored in the file a single image (beginning at Index 1) can be chosen via the parameter Index.

Image files are searched in the current directory (determined by the operating system environment) and in the image directory of HORUS The image directory of HORUS is preset a '/bilder' and '/usr/local/horus/images' in a UNIX environment and can be set via the operator set_system. More than one image directory can be indicated by separating the individual directories by blanks.

Furthermore the search path can be set via the environment variable HORUSIMAGES (same structure as in 'image_dir'). Example: setenv HORUSIMAGES "/usr/images /usr/local/horus/images"

HORUS also searches the image in the sub-directory "images" (images for program examples). The environment variable HORUSROOT is used for the HORUS directory.


Parameters

Image (output_object)
image -> object
Image read.

HeaderSize (input_control)
integer -> integer
Number of bytes for file header.
Default value: 0
Range of values: 0 <= HeaderSize

SourceWidth (input_control)
extent.x -> integer
Number of image columns of the filed image.
Default value: 512
Range of values: 1 <= SourceWidth

SourceHeight (input_control)
extent.y -> integer
Number of image lines of the filed image.
Default value: 512
Range of values: 1 <= SourceHeight

StartRow (input_control)
point.y -> integer
Starting point of image area (line).
Default value: 0
Range of values: 0 <= StartRow
Restriction: StartRow < SourceHeight

StartColumn (input_control)
point.x -> integer
Starting point of image area (column).
Default value: 0
Range of values: 0 <= StartColumn
Restriction: StartColumn < SourceWidth

DestWidth (input_control)
extent.x -> integer
Number of image columns of output image.
Default value: 512
Range of values: 1 <= DestWidth
Restriction: DestWidth <= SourceWidth

DestHeight (input_control)
extent.y -> integer
Number of image lines of output image.
Default value: 512
Range of values: 1 <= DestHeight
Restriction: DestHeight <= SourceHeight

PixelType (input_control)
string -> string
Type of pixel values.
Default value: 'byte'
List of values: 'bit', 'byte', 'r_byte', 'g_byte', 'b_byte', 'short', 'signed_short', 'long', 'swapped_long'

BitOrder (input_control)
string -> string
Sequence of bits within one byte.
Default value: 'MSBFirst'
List of values: 'MSBFirst', 'LSBFirst'

ByteOrder (input_control)
string -> string
Sequence of bytes within one 'short' unit.
Default value: 'MSBFirst'
List of values: 'MSBFirst', 'LSBFirst'

Pad (input_control)
string -> string
Data units within one image line (alignment).
Default value: 'byte'
List of values: 'byte', 'short', 'long'

Index (input_control)
integer -> integer
Number of images in the file.
Default value: 1
Range of values: 1 <= Index

FileName (input_control)
filename.named -> string
Name of input file.


Result

If the parameter values are correct the operator read_sequence returns the value TRUE. If the file cannot be opened FAIL is returned. Otherwise an exception is raised.


Possible Predecessors

read_info


Possible Successors

disp_image, count_channels, decompose3, write_image, rgb1_to_grey


Alternatives

read_image


See also

read_image, read_picture



Copyright © 1996-1997 MVTec Software GmbH