read_sequenceread_sequenceReadSequenceReadSequenceread_sequence (Operator)
Name
read_sequenceread_sequenceReadSequenceReadSequenceread_sequence — Einlesen von Bildern.
Signatur
read_sequence( : Image : HeaderSize, SourceWidth, SourceHeight, StartRow, StartColumn, DestWidth, DestHeight, PixelType, BitOrder, ByteOrder, Pad, Index, FileName : )
Herror read_sequence(Hobject* Image, const Hlong HeaderSize, const Hlong SourceWidth, const Hlong SourceHeight, const Hlong StartRow, const Hlong StartColumn, const Hlong DestWidth, const Hlong DestHeight, const char* PixelType, const char* BitOrder, const char* ByteOrder, const char* Pad, const Hlong Index, const char* FileName)
Herror T_read_sequence(Hobject* Image, const Htuple HeaderSize, const Htuple SourceWidth, const Htuple SourceHeight, const Htuple StartRow, const Htuple StartColumn, const Htuple DestWidth, const Htuple DestHeight, const Htuple PixelType, const Htuple BitOrder, const Htuple ByteOrder, const Htuple Pad, const Htuple Index, const Htuple FileName)
void ReadSequence(HObject* Image, const HTuple& HeaderSize, const HTuple& SourceWidth, const HTuple& SourceHeight, const HTuple& StartRow, const HTuple& StartColumn, const HTuple& DestWidth, const HTuple& DestHeight, const HTuple& PixelType, const HTuple& BitOrder, const HTuple& ByteOrder, const HTuple& Pad, const HTuple& Index, const HTuple& FileName)
void HImage::ReadSequence(Hlong HeaderSize, Hlong SourceWidth, Hlong SourceHeight, Hlong StartRow, Hlong StartColumn, Hlong DestWidth, Hlong DestHeight, const HString& PixelType, const HString& BitOrder, const HString& ByteOrder, const HString& Pad, Hlong Index, const HString& FileName)
void HImage::ReadSequence(Hlong HeaderSize, Hlong SourceWidth, Hlong SourceHeight, Hlong StartRow, Hlong StartColumn, Hlong DestWidth, Hlong DestHeight, const char* PixelType, const char* BitOrder, const char* ByteOrder, const char* Pad, Hlong Index, const char* FileName)
void HImage::ReadSequence(Hlong HeaderSize, Hlong SourceWidth, Hlong SourceHeight, Hlong StartRow, Hlong StartColumn, Hlong DestWidth, Hlong DestHeight, const wchar_t* PixelType, const wchar_t* BitOrder, const wchar_t* ByteOrder, const wchar_t* Pad, Hlong Index, const wchar_t* FileName)
(Nur Windows)
static void HOperatorSet.ReadSequence(out HObject image, HTuple headerSize, HTuple sourceWidth, HTuple sourceHeight, HTuple startRow, HTuple startColumn, HTuple destWidth, HTuple destHeight, HTuple pixelType, HTuple bitOrder, HTuple byteOrder, HTuple pad, HTuple index, HTuple fileName)
void HImage.ReadSequence(int headerSize, int sourceWidth, int sourceHeight, int startRow, int startColumn, int destWidth, int destHeight, string pixelType, string bitOrder, string byteOrder, string pad, int index, string fileName)
def read_sequence(header_size: int, source_width: int, source_height: int, start_row: int, start_column: int, dest_width: int, dest_height: int, pixel_type: str, bit_order: str, byte_order: str, pad: str, index: int, file_name: str) -> HObject
Beschreibung
read_sequenceread_sequenceReadSequenceReadSequenceReadSequenceread_sequence liest Bilddaten, die unformatiert vorliegen,
aus einer Datei und liefert ein „passendes“ Bild zurück. Die
Bilddaten müssen dabei Pixel für Pixel zeilenweise hintereinander
abgespeichert sein.
Ein etwaiger Datei-Header (mit Länge HeaderSizeHeaderSizeHeaderSizeHeaderSizeheaderSizeheader_size Bytes)
wird übersprungen. Die Parameter SourceWidthSourceWidthSourceWidthSourceWidthsourceWidthsource_width und
SourceHeightSourceHeightSourceHeightSourceHeightsourceHeightsource_height geben die Größe des Bildes auf Datei an.
DestWidthDestWidthDestWidthDestWidthdestWidthdest_width und DestHeightDestHeightDestHeightDestHeightdestHeightdest_height geben an, wie groß das
eingelesene Bild sein soll. Im einfachsten Fall stimmen diese
Parameter überein. Es können aber auch Ausschnitte eingelesen
werden. Dazu kann mittels StartRowStartRowStartRowStartRowstartRowstart_row und
StartColumnStartColumnStartColumnStartColumnstartColumnstart_column die obere linke Ecke des gewünschten
Bildausschnitts festgelegt werden.
An Pixeltypen werden 'bit'"bit""bit""bit""bit""bit", 'byte'"byte""byte""byte""byte""byte",
'short'"short""short""short""short""short" (16 Bit, ohne Vorzeichen), 'signed_short'"signed_short""signed_short""signed_short""signed_short""signed_short"
(16 Bit, mit Vorzeichen), 'long'"long""long""long""long""long" (32 Bit, mit Vorzeichen),
'swapped_long'"swapped_long""swapped_long""swapped_long""swapped_long""swapped_long" (32 Bit, mit vertauschten Halbwörtern) und
'real'"real""real""real""real""real" (32 Bit Gleitkommazahlen) (unterstützt. Weiter
erlaubt read_sequenceread_sequenceReadSequenceReadSequenceReadSequenceread_sequence die Extraktion von Komponenten eines
RGB Bildes, sofern für jedes Pixel ein Tripel von drei Bytes (in
der Reihenfolge „rot“, „grün“, „blau“) in der Bilddatei
abgelegt wurde. Für die Rotkomponente ist dann als Pixeltyp
'r_byte'"r_byte""r_byte""r_byte""r_byte""r_byte" und entsprechend für die Grün- und
Blaukomponente 'g_byte'"g_byte""g_byte""g_byte""g_byte""g_byte" bzw. 'b_byte'"b_byte""b_byte""b_byte""b_byte""b_byte" zu wählen.
Für die Bitreihenfolge (BitOrderBitOrderBitOrderBitOrderbitOrderbit_order) kann 'MSBFirst'"MSBFirst""MSBFirst""MSBFirst""MSBFirst""MSBFirst"
(most significant bit first) bzw. die Umkehrung davon
('LSBFirst'"LSBFirst""LSBFirst""LSBFirst""LSBFirst""LSBFirst") gewählt werden. Analog dazu werden auch die
Bytereihenfolgen (ByteOrderByteOrderByteOrderByteOrderbyteOrderbyte_order) 'MSBFirst'"MSBFirst""MSBFirst""MSBFirst""MSBFirst""MSBFirst" (most
significant byte first) bzw. 'LSBFirst'"LSBFirst""LSBFirst""LSBFirst""LSBFirst""LSBFirst"
verarbeitet. Schließlich lässt sich noch ein Alignement
(PadPadPadPadpadpad) am Zeilenende einstellen: 'byte'"byte""byte""byte""byte""byte",
'short'"short""short""short""short""short" oder 'long'"long""long""long""long""long". Falls in der Datei eine
ganze Bildsequenz abgelegt ist, erlaubt der Parameter IndexIndexIndexIndexindexindex
die Wahl eines Einzelbildes (beginnend mit Index 1).
Bilddateien werden im aktuellen Directory (vorgegeben durch die
Betriebssystemumgebung) und im Bilderdirectory von HALCON
gesucht. Das Bilderdirectory von HALCON ist in einer unixartigen Umgebung
auf '.' und '/usr/local/halcon/images'
voreingestellt und kann mit dem Befehl set_systemset_systemSetSystemSetSystemSetSystemset_system gesetzt
werden. Es kann mehr als ein Bilderdirectory angegeben werden.
Dies geschieht, indem man die einzelnen Directories durch einen
Doppelpunkt trennt.
Weiterhin kann der Suchpfad mit der Environment-Variablen
HALCONIMAGES gesetzt werden (gleicher Aufbau wie bei
'image_dir'"image_dir""image_dir""image_dir""image_dir""image_dir"). Beispiel:
setenv HALCONIMAGES "/usr/images:/usr/local/halcon/images"
Ebenso sucht HALCON die Bilder in dem Unter-Directory
'images' (Bilder für die Programmbeispiele). Für das
HALCON-Directory wird die Environment-Variable HALCONROOT
verwendet.
Achtung
Falls Dateien vom Pixeltyp 'real'"real""real""real""real""real" eingelesen werden und die
Bytereihenfolge falsch (d.h. nicht wie die Daten in der Datei
gespeichert sind) gewählt wird, kann es zu Programmfehlern oder
sogar Abstürzen aufgrund von Gleitkomma-Ausnahmebehandlungen
kommen.
Ausführungsinformationen
- Multithreading-Typ: reentrant (läuft parallel zu nicht-exklusiven Operatoren).
- Multithreading-Bereich: global (kann von jedem Thread aufgerufen werden).
- Wird ohne Parallelisierung verarbeitet.
Parameter
ImageImageImageImageimageimage (output_object) image → objectHImageHObjectHImageHobject * (byte / int2 / uint2 / int4)
Eingelesenes Bild.
integer → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Anzahl Bytes für Dateikopf.
Defaultwert: 0
Typischer Wertebereich: 0
≤
HeaderSize
HeaderSize
HeaderSize
HeaderSize
headerSize
header_size
SourceWidthSourceWidthSourceWidthSourceWidthsourceWidthsource_width (input_control) extent.x → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Anzahl Bildspalten des Bildes auf Datei.
Defaultwert: 512
Typischer Wertebereich: 1
≤
SourceWidth
SourceWidth
SourceWidth
SourceWidth
sourceWidth
source_width
SourceHeightSourceHeightSourceHeightSourceHeightsourceHeightsource_height (input_control) extent.y → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Anzahl Bildzeilen des Bildes auf Datei.
Defaultwert: 512
Typischer Wertebereich: 1
≤
SourceHeight
SourceHeight
SourceHeight
SourceHeight
sourceHeight
source_height
StartRowStartRowStartRowStartRowstartRowstart_row (input_control) point.y → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Startpunkt Bildausschnitt (Zeile).
Defaultwert: 0
Typischer Wertebereich: 0
≤
StartRow
StartRow
StartRow
StartRow
startRow
start_row
Restriktion: StartRow < SourceHeight
StartColumnStartColumnStartColumnStartColumnstartColumnstart_column (input_control) point.x → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Startpunkt Bildausschnitt (Spalte).
Defaultwert: 0
Typischer Wertebereich: 0
≤
StartColumn
StartColumn
StartColumn
StartColumn
startColumn
start_column
Restriktion: StartColumn < SourceWidth
DestWidthDestWidthDestWidthDestWidthdestWidthdest_width (input_control) extent.x → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Anzahl Bildspalten des erzeugten Bildes.
Defaultwert: 512
Typischer Wertebereich: 1
≤
DestWidth
DestWidth
DestWidth
DestWidth
destWidth
dest_width
Restriktion: DestWidth <= SourceWidth
DestHeightDestHeightDestHeightDestHeightdestHeightdest_height (input_control) extent.y → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Anzahl Bildzeilen des erzeugten Bildes.
Defaultwert: 512
Typischer Wertebereich: 1
≤
DestHeight
DestHeight
DestHeight
DestHeight
destHeight
dest_height
Restriktion: DestHeight <= SourceHeight
PixelTypePixelTypePixelTypePixelTypepixelTypepixel_type (input_control) string → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Art der Pixelwerte.
Defaultwert:
'byte'
"byte"
"byte"
"byte"
"byte"
"byte"
Werteliste: 'b_byte'"b_byte""b_byte""b_byte""b_byte""b_byte", 'bit'"bit""bit""bit""bit""bit", 'byte'"byte""byte""byte""byte""byte", 'g_byte'"g_byte""g_byte""g_byte""g_byte""g_byte", 'long'"long""long""long""long""long", 'r_byte'"r_byte""r_byte""r_byte""r_byte""r_byte", 'real'"real""real""real""real""real", 'short'"short""short""short""short""short", 'signed_short'"signed_short""signed_short""signed_short""signed_short""signed_short", 'swapped_long'"swapped_long""swapped_long""swapped_long""swapped_long""swapped_long"
BitOrderBitOrderBitOrderBitOrderbitOrderbit_order (input_control) string → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Reihenfolge der Bits innerhalb eines Bytes.
Defaultwert:
'MSBFirst'
"MSBFirst"
"MSBFirst"
"MSBFirst"
"MSBFirst"
"MSBFirst"
Werteliste: 'LSBFirst'"LSBFirst""LSBFirst""LSBFirst""LSBFirst""LSBFirst", 'MSBFirst'"MSBFirst""MSBFirst""MSBFirst""MSBFirst""MSBFirst"
ByteOrderByteOrderByteOrderByteOrderbyteOrderbyte_order (input_control) string → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Reihenfolge der Bytes innerhalb einer
'short'-Einheit.
Defaultwert:
'MSBFirst'
"MSBFirst"
"MSBFirst"
"MSBFirst"
"MSBFirst"
"MSBFirst"
Werteliste: 'LSBFirst'"LSBFirst""LSBFirst""LSBFirst""LSBFirst""LSBFirst", 'MSBFirst'"MSBFirst""MSBFirst""MSBFirst""MSBFirst""MSBFirst"
PadPadPadPadpadpad (input_control) string → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Dateneinheiten innerhalb einer Bildzeile (Alignement).
Defaultwert:
'byte'
"byte"
"byte"
"byte"
"byte"
"byte"
Werteliste: 'byte'"byte""byte""byte""byte""byte", 'long'"long""long""long""long""long", 'short'"short""short""short""short""short"
IndexIndexIndexIndexindexindex (input_control) integer → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Nummer des Bildes innerhalb der Datei.
Defaultwert: 1
Typischer Wertebereich: 1
≤
Index
Index
Index
Index
index
index
(lin)
FileNameFileNameFileNameFileNamefileNamefile_name (input_control) filename.read → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Name der einzulesenden Datei.
Ergebnis
Sind die Parameterwerte korrekt, dann liefert read_sequenceread_sequenceReadSequenceReadSequenceReadSequenceread_sequence
den Wert 2 (H_MSG_TRUE). Andernfalls wird eine Fehlerbehandlung
durchgeführt.
Nachfolger
disp_imagedisp_imageDispImageDispImageDispImagedisp_image,
count_channelscount_channelsCountChannelsCountChannelsCountChannelscount_channels,
decompose3decompose3Decompose3Decompose3Decompose3decompose3,
write_imagewrite_imageWriteImageWriteImageWriteImagewrite_image,
rgb1_to_grayrgb1_to_grayRgb1ToGrayRgb1ToGrayRgb1ToGrayrgb1_to_gray
Alternativen
read_imageread_imageReadImageReadImageReadImageread_image
Siehe auch
read_imageread_imageReadImageReadImageReadImageread_image
Modul
Foundation