Independent and future-proof: decoupling of hardware and software through image abstraction Martin Kersting, Technical Director, Authorized Executive STEMMER IMAGING STEMMER IMAGING Technology Forum 2015, Unterschleißheim
THE CHALLENGE WHY HAVING SOFTWARE INTERFACES?
THE CHALLENGE BECAUSE OF FLEXIBILITY Components may become obsolete Different processors Different operating systems Different camera technology It all comes down to different application requirements
THE CHALLENGE BUT I M USING STANDARDS LIKE GIGE-VISION AND USB3-VISION These are hardware standards defining the transport media The GenICam standard defines the properties of the camera (XML file) and the transport interface of the data (Transport Layer) The GenICam Transport Layer has two ends The Consumer end and the Producer end The producer comes from a hard- or a software manufacture and may support only one hardware vendor
SOFTWARE INTERFACES SOFTWARE INTERFACES Software components that implement functionality without the need to gain knowledge of their internal implementation Compiler independent Dynamically loadable including lifetime management A component A can substitute component B if both implement the same interface Fully documented Well tested Designed with an awareness that the interface will be used by oblivious users An implementation is a black box defined by its interface
SOFTWARE INTERFACES SOFTWARE INTERFACES The functionality of a software interface behaves similar for all hardware drivers supporting the interface Switching between different hardware becomes very simple Load a different driver, check for the existence of the interface you want to use and call its methods New functionality based on new technology trends is implemented in new interfaces Existing interfaces will never change This will ensure backward compatibility and protect your development investments
THE COMPONENT OBJECT MODEL INTRODUCED BY MICROSOFT An instance of an interface implementation is a pointer to an array of pointers to methods of the interface The implementation can be instantiated at runtime An interface pointer will be used to access the methods All interfaces are immutable and identified by a Global Unique Identifier (GUID) WARNING: Changing the interface will break the backward compatibility Implementation can be done in C++, C or Delphi (Pascal) Only available under Windows
PSEUDO COM INTRODUCED IN COMMON VISION BLOX Pretty similar to COM, but: Thread safe Lifetime guarantee Lightweight Available for different OS and processors FOR SURE: No interface change since 1996 New functionality introduced by new interfaces
ACCESSING ACQUISITION HARDWARE THE HARDWARE ABSTRACTION LAYER OF CVB Grabbing images IGrabber IPingPong IGrab2 ILineScan Accessing the hardware IDeviceControl INodeMapHandle INodeMapHandle2 Trigger and I/O ISoftwareTrigger ITrigger IBasicDigIO Selecting the hardware IBoardSelect IBoardSelect2 ICameraSelect ICameraSelect2 INotify IPropertyChange IRegPort
HARDWARE INTERFACES Imaging Application Proprietary Algorithms CVB Tools Manto Minos Display OCX Display DLL Image OCX Image DLL Grabber OCX Driver DLL IImageVPA ITrigger IGrab2 IDeviceControl IBoardSelect ICameraSelect... CVB Image Object XXX.vin YYY.vin X64CL.vin X64AN.vin CVAVT1394.vin GenICam.vin GenICam.vin AVI.dll Hardware abstraction through the DDK Grabber Grabber IEEE1394 DCAM USB3-Vision GigE-Vision Video files Image files... Image Source: Hardware Image Source: File system
ACQUISITION INTERFACES OVER TIME CVB IMPLEMENTED 4 ACQUISITION INTERFACES IGrabber Single buffer frame grabber or camera Repeated snaps will fill the buffer IPingPong Two buffers filled in ping-pong mode Process one buffer while acquiring into the second buffer IGrab2 Fills a ring buffer of a fix length Process one buffer while filling the other buffers IRingBuffer Change the number of buffers IGrab2 can use dynamically
IGRABBER INTERFACE APP VIN Camera Snap Ret Snap Snap function waits until an image has been acquired The availability of only one image buffer will likely lead to frame drops
IPINGPONG INTERFACE APP VIN Camera StartPingPong Ret StartPingPong WaitPingPong Ret WaitPingPong StartPingPong Ret StartPingPong UpdatePingPong Ret UpdatePingPong WaitPingPong Ret WaitPingPong StartPingPong Ret StartPingPong UpdatePingPong Ret UpdatePingPong Two buffers are used in ping-pong mode No frame loss as long as processing keeps up with camera frame rate
IGRAB2 INTERFACE I APP VIN Camera G2Grab G2Wait Ret G2Wait G2Grab starts acquisition into a ringbuffer The frame transfer will increase the acquisition index and lock the acuired buffer G2Wait waits until an image has been acquired and increase the processing index
IGRAB2 INTERFACE II APP VIN Camera G2Wait Ret G2Wait The frame transfer will increase the acquisition index and lock the acquired buffer G2Wait will unlock the previous processing buffer and increase the processing index
IGRAB2 INTERFACE III APP VIN Camera G2Grab G2Wait TIMEOUT G2Wait waits until an image has been acquired, but not forever
IGRAB2 INTERFACE IV APP VIN Camera G2Grab Images that have been acquired will lock the ringbuffer
IGRAB2 INTERFACE V APP VIN Camera G2Wait G2Wait G2Wait will unlock the previous image at the processing index and switch to the next image within the ringbuffer
IGRAB2 WAIT MODES ADVANCED WAIT MODES FOR MANY FRAME GRABBERS OR CAMERAS Select the mode in driver configuration file ; waiting mode for grab2 ; 0 wait for new image ; 1 wait for next image after last delivered one ; 2 return last acquired image WaitNextFrame = 1
IGRAB2 WAIT MODE = 1 (DEFAULT) APP VIN Camera G2Wait The next image in acquisition order will be used
IGRAB2 WAIT MODE = 2 APP VIN Camera G2Wait The last image in acquisition order will be used, all previous images will be removed
IGRAB2 WAIT MODE = 0 APP VIN Camera G2Wait The driver will wait until the next image has been acquired, all previous images will be removed
IRINGBUFFER DYNAMICALLY CHANGE THE NUMBER OF BUFFERS AVAILABLE TO IGRAB2 Limited by the available host memory ~1GByte under Windows 32 70GByte successfully tested under Windows 7 64Bit Supports manual and automatic Lock modes Allows for a simple implementation of high speed recording systems
STILL GOT QUESTIONS? Join our LinkedIn group EUROPEAN VISION TECHNOLOGY FORUM and continue discussing with our experts.
THANK YOU FOR YOUR ATTENTION! STEMMER IMAGING GmbH Gutenbergstr. 9-13 82178 Puchheim Germany Phone: +49 89 80902-0 Fax: +49 89 80902-116 info@stemmer-imaging.de www.stemmer-imaging.com Your contact: Martin Kersting