KlassenKlassenKlassenKlassen | | | | Operatoren

read_sequenceread_sequenceReadSequenceread_sequenceReadSequenceReadSequence (Operator)

Name

read_sequenceread_sequenceReadSequenceread_sequenceReadSequenceReadSequence — 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)

Herror 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)

HImage HImage::ReadSequence(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 HOperatorSetX.ReadSequence(
[out] IHUntypedObjectX*Image, [in] VARIANT HeaderSize, [in] VARIANT SourceWidth, [in] VARIANT SourceHeight, [in] VARIANT StartRow, [in] VARIANT StartColumn, [in] VARIANT DestWidth, [in] VARIANT DestHeight, [in] VARIANT PixelType, [in] VARIANT BitOrder, [in] VARIANT ByteOrder, [in] VARIANT Pad, [in] VARIANT Index, [in] VARIANT FileName)

void HImageX.ReadSequence(
[in] Hlong HeaderSize, [in] Hlong SourceWidth, [in] Hlong SourceHeight, [in] Hlong StartRow, [in] Hlong StartColumn, [in] Hlong DestWidth, [in] Hlong DestHeight, [in] BSTR PixelType, [in] BSTR BitOrder, [in] BSTR ByteOrder, [in] BSTR Pad, [in] Hlong Index, [in] BSTR FileName)

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)

Beschreibung

read_sequenceread_sequenceReadSequenceread_sequenceReadSequenceReadSequence 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 HeaderSizeHeaderSizeHeaderSizeHeaderSizeHeaderSizeheaderSize Bytes) wird übersprungen. Die Parameter SourceWidthSourceWidthSourceWidthSourceWidthSourceWidthsourceWidth und SourceHeightSourceHeightSourceHeightSourceHeightSourceHeightsourceHeight geben die Größe des Bildes auf Datei an. DestWidthDestWidthDestWidthDestWidthDestWidthdestWidth und DestHeightDestHeightDestHeightDestHeightDestHeightdestHeight geben an, wie groß das eingelesene Bild sein soll. Im einfachsten Fall stimmen diese Parameter überein. Es können aber auch Auschnitte eingelesen werden. Dazu kann mittels StartRowStartRowStartRowStartRowStartRowstartRow und StartColumnStartColumnStartColumnStartColumnStartColumnstartColumn 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_sequenceReadSequenceread_sequenceReadSequenceReadSequence 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 (BitOrderBitOrderBitOrderBitOrderBitOrderbitOrder) 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 (ByteOrderByteOrderByteOrderByteOrderByteOrderbyteOrder) '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'"/usr/local/halcon/images""/usr/local/halcon/images""/usr/local/halcon/images""/usr/local/halcon/images""/usr/local/halcon/images" voreingestellt und kann mit dem Befehl set_systemset_systemSetSystemset_systemSetSystemSetSystem 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"'""`images""""`images""""`images""""`images""""`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.

Parallelisierung

Parameter

ImageImageImageImageImageimage (output_object)  image objectHImageHImageHImageHImageXHobject * (byte / int2 / uint2 / int4)

Eingelesenes Bild.

HeaderSizeHeaderSizeHeaderSizeHeaderSizeHeaderSizeheaderSize (input_control)  integer HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Anzahl Bytes für Dateikopf.

Defaultwert: 0

Typischer Wertebereich: 0 ≤ HeaderSize HeaderSize HeaderSize HeaderSize HeaderSize headerSize

SourceWidthSourceWidthSourceWidthSourceWidthSourceWidthsourceWidth (input_control)  extent.x HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Anzahl Bildspalten des Bildes auf Datei.

Defaultwert: 512

Typischer Wertebereich: 1 ≤ SourceWidth SourceWidth SourceWidth SourceWidth SourceWidth sourceWidth

SourceHeightSourceHeightSourceHeightSourceHeightSourceHeightsourceHeight (input_control)  extent.y HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Anzahl Bildzeilen des Bildes auf Datei.

Defaultwert: 512

Typischer Wertebereich: 1 ≤ SourceHeight SourceHeight SourceHeight SourceHeight SourceHeight sourceHeight

StartRowStartRowStartRowStartRowStartRowstartRow (input_control)  point.y HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Startpunkt Bildausschnitt (Zeile).

Defaultwert: 0

Typischer Wertebereich: 0 ≤ StartRow StartRow StartRow StartRow StartRow startRow

Restriktion: StartRow < SourceHeight

StartColumnStartColumnStartColumnStartColumnStartColumnstartColumn (input_control)  point.x HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Startpunkt Bildausschnitt (Spalte).

Defaultwert: 0

Typischer Wertebereich: 0 ≤ StartColumn StartColumn StartColumn StartColumn StartColumn startColumn

Restriktion: StartColumn < SourceWidth

DestWidthDestWidthDestWidthDestWidthDestWidthdestWidth (input_control)  extent.x HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Anzahl Bildspalten des erzeugten Bildes.

Defaultwert: 512

Typischer Wertebereich: 1 ≤ DestWidth DestWidth DestWidth DestWidth DestWidth destWidth

Restriktion: DestWidth <= SourceWidth

DestHeightDestHeightDestHeightDestHeightDestHeightdestHeight (input_control)  extent.y HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Anzahl Bildzeilen des erzeugten Bildes.

Defaultwert: 512

Typischer Wertebereich: 1 ≤ DestHeight DestHeight DestHeight DestHeight DestHeight destHeight

Restriktion: DestHeight <= SourceHeight

PixelTypePixelTypePixelTypePixelTypePixelTypepixelType (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (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"

BitOrderBitOrderBitOrderBitOrderBitOrderbitOrder (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (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"

ByteOrderByteOrderByteOrderByteOrderByteOrderbyteOrder (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (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 HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (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 HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Nummer des Bildes innerhalb der Datei.

Defaultwert: 1

Typischer Wertebereich: 1 ≤ Index Index Index Index Index index (lin)

FileNameFileNameFileNameFileNameFileNamefileName (input_control)  filename.read HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Name der einzulesenden Datei.

Ergebnis

Sind die Parameterwerte korrekt, dann liefert read_sequenceread_sequenceReadSequenceread_sequenceReadSequenceReadSequence den Wert 2 (H_MSG_TRUE). Andernfalls wird eine Fehlerbehandlung durchgeführt.

Nachfolger

disp_imagedisp_imageDispImagedisp_imageDispImageDispImage, count_channelscount_channelsCountChannelscount_channelsCountChannelsCountChannels, decompose3decompose3Decompose3decompose3Decompose3Decompose3, write_imagewrite_imageWriteImagewrite_imageWriteImageWriteImage, rgb1_to_grayrgb1_to_grayRgb1ToGrayrgb1_to_grayRgb1ToGrayRgb1ToGray

Alternativen

read_imageread_imageReadImageread_imageReadImageReadImage

Siehe auch

read_imageread_imageReadImageread_imageReadImageReadImage

Modul

Foundation


KlassenKlassenKlassenKlassen | | | | Operatoren