Einzelnen Beitrag anzeigen

BoolString

Registriert seit: 2. Feb 2009
Ort: Varel
70 Beiträge
 
RAD-Studio 2009 Pro
 
#20

AW: Ansprechen einer GigE Kamera (Prosilica GC2450C)

  Alt 23. Jul 2012, 21:10
Bin am Wochenende natürlich nicht so wirklich weiter gekommen.

Ich bekomme inzwischen schon mal die maximalen Auflösungen der Kamera, die BitTiefe und habe inzwischen die kompletten E_UNI_CAMERA_INFO Block mit den E_CAMINFO_XXX Deklarationen als Konstanten übersetzt. Macht es Sinn die als reine Konstanten zu übersetzen, oder sollte man besser die enum Struktur übernehmen?

Wie hast du denn die Variable text in deinem Beispiel für UCC_GetCameraInfoString deklariert? Die Funktion wirft bei mir immer einen von S_OK verschiedenen Wert.

Die Funktion

Delphi-Quellcode:
  
Function UCC_PrepareFreeGrab (CamId :UInt32;Var pMode, pColorFormatId, pWidth, pHeight, pBufferCount, pXOffset, pYOffset, pBusLoad : UInt32) : UNI_RETURN_TYPE; stdcall; external 'UniControl.DLL';

Var aCamMode : UInt32;
    aColFormat : UInt32;
    aBufferCount : UInt32;
    aXOffset : UInt32;
    aYOffset : UInt32;
    aBusLoad : UInt32;
    aResult : Cardinal;

  aColFormat := E_CC_YUV422;
  aCamMode := 0;
  aBufferCount := 0;
  aXOffset := 0;
  aYOffset := 0;
  aBusLoad := 0;
  aResult := UCC_PrepareFreeGrab (CameraIDs[0], aCamMode, aColFormat, aCamMaxWidth, aCamMaxHeight, aBufferCount, aXOffset, aYOffset, aBusLoad);
  Memo1.Lines.Add ('Camera prepare free grab: ' + IntToStr (aResult));
wirft auf jeden Fall schon mal ein S_OK zurück. Aber diese Bilder benötigen dann ja vermutlich ein Debayering. an dieser Stelle müsste ich dann die UniTransform Funktionen einbeziehen, oder?

Im Manual bin ich jetzt auf die Funktion UCC_GrabBitmapImage gestoßen. Kann man damit die einzelne Bitmaps gewinnen, die ich dann wie gewohnt verarbeiten kann? Soweit wie ich es jetzt nachvollziehen kann, scheint dies so zu sein. Ich schau mir gerade die zugehörigen S_SIS_DATA Deklaration an. Das Union und die aufeinanderbauenden Records versuche ich so zu übersetzen. Ist das in der Theorie zumindest richtig?
Delphi-Quellcode:
  S_SISEnable : Packed Record of
                  Case m_Enable : UInt32 of
                    1 : Packed Record of
                            m_CycleCounter : UInt32 = 1; //!< inq cycle counter
                            m_FrameCounter : UInt32 = 1; //!< inq frame count since last reset
                            m_TriggerCounter : UInt32 = 1; //!< inq triggers received by the camera
                            m_AOILeft : UInt32 = 1; //!< inq left coordinate of the cameras AOI
                            m_AOITop : UInt32 = 1; //!< inq top coordinate of the cameras AOI
                            m_AOIWidth : UInt32 = 1; //!< inq width of the AOI
                            m_AOIHeight : UInt32 = 1; //!< inq height of the AOI
                            m_Shutter : UInt32 = 1; //!< inq camera shutter for the image
                            m_Gain : UInt32 = 1; //!< inq camera gain for the image
                            Reserved0 : UInt32 = 1;
                            m_OutputState : UInt32 = 1; //!< inq output pin states
                            m_InputState : UInt32 = 1; //!< inq input pin states
                            m_SequenceIndex : UInt32 = 1; //!< inq position in sequence
                            Reserved2a : UInt32 = 1;
                            m_ColorCoding : UInt32 = 1; //!< inq IIDC color coding
                            Reserved2b : UInt32 = 1;
                            m_SerialNumber : UInt32 = 1; //!< inq serial number of the camera
                            m_UserValue : UInt32 = 1; //!< inq user defined value
                            Reserved2 : UInt32 = 13;
                            m_Valid : UInt32 = 1; //!< Data in m_Enable is valid
                        end;
                    2 : m_Data : UInt32; //!< m_Enable as UINT32
                  end;

/** SIS data structure*/

  S_SIS_DATA : Packed Record of
                  m_CycleCounter : UInt32; //!< bus cycle count
                  m_FrameCounter : UInt32; //!< frame count since last reset
                  m_TriggerCounter : UInt32; //!< from camera received triggers
                  m_AOILeft : UInt16; //!< left coordinate of the AOI begin
                  m_AOITop : UInt16; //!< top coordinate of the AOI begin
                  m_AOIWidth : UInt16; //!< width of the AOI
                  m_AOIHeight : UInt16; //!< height of the AOI
                  m_Shutter : UInt32; //!< camera shutter for the image
                  m_Gain : UInt16; //!< camera gain for the image
                  m_Reserved0 : UInt16; //!< reserved for future use
                  m_OutputState : Array [0..3] of UInt8; //!< state of the output pins
                  m_InputState : Array [0..1] of UInt8; //!< state of the input pins
                  m_Reservec1 : Array [0..1] of UInt8; //!< reserved for future use
                  m_SequenceIndex : UInt8; //!< position in the sequence
                  m_Reserved2a : UInt8; //!< reserved for future use
                  m_ColorCoding : UInt8; //!< IIDC color coding for the transport format
                  m_Reserved2b : UInt8; //!< reserved for future use
                  m_SerialNumber : UInt32; //!< camera serial number
                  m_UserValue : UInt32; //!< user defined value
                  m_SISEnable : S_SIS_ENABLE; //!< state inq struct
                end;
Und welchen Pointer auf das Bitmap möchte UCC_GrabBitmapImage denn wohl haben? Auf das @Bitmap, Handles oder irgendwelche Datenbereiche?

Nur mal für mich... wie weit bin ich denn wohl noch von einem ersten, (Prosilica)kameraunabhängigen Bild entfernt?

Liebe Grüße

Jan
  Mit Zitat antworten Zitat