Sapera LT Agenda Overview Sapera Fundamentals Sapera Class

  • Slides: 35
Download presentation
Sapera LT

Sapera LT

Agenda • • • Overview Sapera++ Fundamentals Sapera++ Class Descriptions Sapera++ Examples Advanced Topics

Agenda • • • Overview Sapera++ Fundamentals Sapera++ Class Descriptions Sapera++ Examples Advanced Topics

Overview • • • DALSA Coreco’s Main API 32 bit OOP, multi-threaded library C++

Overview • • • DALSA Coreco’s Main API 32 bit OOP, multi-threaded library C++ encapsulation of low level ‘C’ library Modular and device independent Trigger-To-Image Reliability (T 2 IR)

Advanced Features (Version 6. 00) • Support for the Genie (Gig. E camera). •

Advanced Features (Version 6. 00) • Support for the Genie (Gig. E camera). • Format conversion support in buffer module (in Sapera and the Cam. Expert). • RGB line profiler function in Cam. Expert. • Diagnostic to for collecting all relevant DALSA Coreco driver and SDK information. • Tool for creating, editing and saving LUTs in Cam. Expert.

Compiler Support • Microsoft Visual C++ 6 and Visual Studio. NET 2003 for the

Compiler Support • Microsoft Visual C++ 6 and Visual Studio. NET 2003 for the Standard C and Sapera++ APIs. • Borland C++ Builder 6 or higher for the Standard C and Sapera++ APIs. • Microsoft Visual Basic 6 for the Active. X controls. • Borland Delphi 7 for the Active. X controls. • Microsoft Visual Studio. NET 2003 (C# and VB) for the Active. X controls.

Important Sapera Tools Camera. Expert ◦ The first step in creating an application. ◦

Important Sapera Tools Camera. Expert ◦ The first step in creating an application. ◦ Supports flat-field correction and Bayer Conversion. Sapera Configuration Tool ◦ Used for contiguous memory allocation and serial-port assignment. Application Wizard ◦ Speed the development cycle.

Sapera Diagnostic Tools • Log. Viewer ◦ Logs and displays messages from all Sapera

Sapera Diagnostic Tools • Log. Viewer ◦ Logs and displays messages from all Sapera sources. • PCI-Diagnostics ◦ Provides low-level information for devices on the bus. • Direct Draw Capabilities ◦ Gives information on what modes support overlays and the off-screen surface. • Display Performance ◦ Benchmarks different operations in different display modes.

Agenda • ü • • • Overview Sapera++ Fundamentals Sapera++ Class Descriptions Sapera++ Examples

Agenda • ü • • • Overview Sapera++ Fundamentals Sapera++ Class Descriptions Sapera++ Examples Advanced Topics

Sapera Terminology Server: ◦ Abstract representation of a physical device (e. g. PC, frame

Sapera Terminology Server: ◦ Abstract representation of a physical device (e. g. PC, frame grabber, etc…). Resource: ◦ A set of functionality situated in hardware or software. Module: ◦ Set of functions dedicated to a specific task (e. g. buffer management).

The Sapera++ Architecture Basic Classes: ◦ All classes related to getting the image from

The Sapera++ Architecture Basic Classes: ◦ All classes related to getting the image from the camera to the host computer ◦ Hardware Independent Classes ◦ Hardware Specific Classes GUI Classes: ◦ MFC Specific ◦ User interfacing of common tasks ◦ Independent of the Basic Classes

Application Error Management Errors can be reported in four ways: ◦ Messages are sent

Application Error Management Errors can be reported in four ways: ◦ Messages are sent to a popup window ◦ Messages are sent to the Log. Viewer ◦ Messages are sent to the active debugger ◦ Messages are kept internally (the last can be retrieved with ‘Get. Last. Status()’) During development the Log. Viewer can come in handy: ◦ Application and driver messages are stored by the Log. Viewer

Capabilities and Parameters Capabilities: ◦ Allow the interrogation of all functional aspects of a

Capabilities and Parameters Capabilities: ◦ Allow the interrogation of all functional aspects of a given module ◦ Allows the application determine what features are supported on a given piece of hardware Parameters: ◦ Allow an application to configure all functional aspects of a given module ◦ Allow an application to determine the current configuration of a module

Steps to Building an Application 1. 2. 3. 4. 5. Include Sap. Class. Basic.

Steps to Building an Application 1. 2. 3. 4. 5. Include Sap. Class. Basic. h Add $(SAPERADIR)ClassesBasic to the include path. Add Sap. Class. Basic. lib to the Release build definitions. Add Sap. Class. Basic. D. lib to the Debug build definitions. Select ‘Multithreaded DLL’ as the run-time library used during execution.

Agenda • • ü • • Overview Sapera++ Fundamentals Sapera++ Class Descriptions Sapera++ Examples

Agenda • • ü • • Overview Sapera++ Fundamentals Sapera++ Class Descriptions Sapera++ Examples Advanced Topics

Sapera++ Class Descriptions Sap. Acquisition: ◦ Implements access and configuration of acquisition resources. ◦

Sapera++ Class Descriptions Sap. Acquisition: ◦ Implements access and configuration of acquisition resources. ◦ Allows Signal Status verification (when an acquisition device is has the capability; T 2 IR): ▪ Hsync/Vsync present, Hsync/Vsync locked, Pixel. Clock present, Chroma present, ◦ Provides callbacks for key conditions and events: ▪ External Trigger, Trigger-Ignored, Vertical Sync Present, Pixel-Clock Present/Missing, Frame-Lost, Data-Overflow.

Sapera++ Class Descriptions Sap. Buffer: ◦ Provides all buffer related functionality. ◦ Provides parameters

Sapera++ Class Descriptions Sap. Buffer: ◦ Provides all buffer related functionality. ◦ Provides parameters for the control of acquisition and the detection of error conditions (T 2 IR). ◦ Supports time/counter stamps (T 2 IR). ◦ Buffer copy method performs automatic data format conversion between source and destination. ◦ Includes a new software Bayer. Conversion and White. Balance functions.

Sapera++ Class Descriptions Sap. Transfer: ◦ Implements a flexible transfer process which supports all

Sapera++ Class Descriptions Sap. Transfer: ◦ Implements a flexible transfer process which supports all Sapera compatible DALSA Coreco hardware. ◦ Specialized classes have been derived from Sap. Transfer in order to simplify the most common transfer configurations (e. g. Sap. Acq. To. Buf). ◦ Provides callbacks on transfer events such as Start/End of frame, N-Lines/Line-N, as well as, line/field data under-runs (T 2 IR).

Sapera++ Class Descriptions Sap. View: ◦ Provides functionality for the display of data stored

Sapera++ Class Descriptions Sap. View: ◦ Provides functionality for the display of data stored in a Sap. Buffer objects. ◦ Uses an internal thread to manage data viewing. ◦ Takes care of access and control of available display hardware (Sap. Display) including non-destructive overlays (when image data is YUV). ◦ Provides control over zoom/scale of data in view. ◦ Is able to generate a user definable callback at the end of the view window update.

Sapera++ Class Descriptions Sap. Display: ◦ New methods have been added to provide information

Sapera++ Class Descriptions Sap. Display: ◦ New methods have been added to provide information of the display hardware’s state and capabilities. ◦ A function has been added that allows the application to change the current display mode. Sap. Lut: ◦ Is a new Sapera++ class that implements Look-Up. Table functionality for acquisition and viewing.

Sapera++ Class Descriptions Sap. Manager: ◦ Provides high level management capabilities to all derived

Sapera++ Class Descriptions Sap. Manager: ◦ Provides high level management capabilities to all derived Sapera++ classes. ◦ Provides functions for the access, information and control of Servers (I. e. Host PC, Frame Grabbers and processing boards). ◦ Allows the selection of error reporting method, as well as, error message/code retrieval. Sap. Location: ◦ Identifies a Server/Resource pair.

Sapera++ Class Description Sap. Graphic: ◦ Implements functionality for the creation and display of

Sapera++ Class Description Sap. Graphic: ◦ Implements functionality for the creation and display of graphic objects and text. ◦ Provides control over draw modes (I. e. how graphics and image data are combined). ◦ Allows for batch draw-mode when sending graphics to the overlay surface. ◦ Provides a command for manual control of graphics display.

Sapera++ Class Descriptions Sap. Gio: ◦ Provides control and information for a board’s general

Sapera++ Class Descriptions Sap. Gio: ◦ Provides control and information for a board’s general I/O resources. ◦ Allows user defined callbacks to be issued when I/O states change. ◦ Can be used with the Sap. Counter class to enable I/O pin states to change automatically. Sap. Counter: ◦ Allows for the counting of I/O events and timers. ◦ Is able to issue callbacks for counter events.

Sapera++ Class Descriptions Sap. Processing (not ‘the’ Sapera Processing!): ◦ The Sap. Processing class

Sapera++ Class Descriptions Sap. Processing (not ‘the’ Sapera Processing!): ◦ The Sap. Processing class must be derived in order to integrate user defined processing. ◦ Sap. Buffer Full/Empty states are used to prevent current data from being overwritten by new data. ◦ Processing can be user defined or, can include functionality provided by Sapera Processing 5. 30 (or later). ◦ A user defined callback can be defined to signal the end of processing of the current image. ◦ Processing is performed inside a variable priority thread and processing time can be read after each frame is processed.

Agenda • • • ü • Overview Sapera++ Fundamentals Sapera++ Class Descriptions Sapera++ Examples

Agenda • • • ü • Overview Sapera++ Fundamentals Sapera++ Class Descriptions Sapera++ Examples Advanced Topics

Using Sapera++ Typical Allocation of Sapera++ objects: // Allocate the buffer object Sap. Buffer

Using Sapera++ Typical Allocation of Sapera++ objects: // Allocate the buffer object Sap. Buffer *p. Buffer = new Sap. Buffer( 1, 512); if (p. Buffer->Create()) { // Buffer created OK. . . }. . . // Implicit BOOL operator for creation validation if (*p. Buffer) { p. Buffer->Destroy(); } // Release the object memory delete p. Buffer; p. Buffer = NULL;

Basic Image Display Sap. Buffer *p. Buffer; Sap. View *p. View; p. Buffer =

Basic Image Display Sap. Buffer *p. Buffer; Sap. View *p. View; p. Buffer = new Sap. Buffer(1, 640, 480, Sap. Format. Mono 8); p. View = new Sap. View( p. Buffer, Sap. Hwnd. Desktop); p. Buffer->Create(); p. View->Show(); // Display the image on the desktop p. View->Destroy(); p. Buffer->Destroy(); delete p. View; delete p. Buffer;

Basic Acquisition and Display // Object declaration Sap. Acquisition *p. Acq; Sap. Buffer *p.

Basic Acquisition and Display // Object declaration Sap. Acquisition *p. Acq; Sap. Buffer *p. Buffer; Sap. Transfer *p. Xfer; Sap. View *p. View; // Object allocation p. Acq = Sap. Acquisition( Sap. Location(“X 64_1”, 0), my. Camera. ccf); p. Buffer = new Sap. Buffer( 1, p. Acq); p. View = new Sap. View( p. Buffer, Sap. Hwnd. Desktop); p. Xfer = new Sap. Transfer( my. Xfer. Callback, p. View); p. Xfer->Add. Pair(Sap. Xfer. Pair( p. Acq, p. Buffer);

Basic Acquisition and Display p. Acq->Create(); // Create the objects p. Buffer->Create(); p. Xfer->Create();

Basic Acquisition and Display p. Acq->Create(); // Create the objects p. Buffer->Create(); p. Xfer->Create(); p. View->Create(); // Start a continuous transfer (live grab) p. Xfer->Start(); . . . p. Xfer->Stop(); // Stop the transfer p. Xfer->Wait( 5000); // Wait for grab to stop p. Xfer->Destroy(); p. View->Destroy(); p. Buffer->Destroy(); p. Acq->Destroy(); delete p. Xfer; p. View; p. Buffer; p. Acq;

Basic Acquisition and Display // Do the new image display in the transfer callback

Basic Acquisition and Display // Do the new image display in the transfer callback void my. Xfer. Callback( Sap. Xfer. Callback. Info *p. Info) { // Display the last transferred frame Sap. View *p. View = (Sap. View *) p. Info->Get. Context(); p. View->Show(); }

Agenda • • ü Overview Sapera++ Fundamentals Sapera++ Class Descriptions Sapera++ Examples Advanced Topics

Agenda • • ü Overview Sapera++ Fundamentals Sapera++ Class Descriptions Sapera++ Examples Advanced Topics

Advanced Topics Trash Buffers ◦ Trash buffers are a special type of buffers used

Advanced Topics Trash Buffers ◦ Trash buffers are a special type of buffers used for receiving ‘lost’ images. ◦ A lost image occurs when the application has not finished processing the image in the grab buffer. ◦ Grab synchronization is achieved using Empty/Full flags in the buffer objects. ◦ Callback events can be attached to the Trash buffer in order to know when an image is lost. ◦ Lost images must trigger recycling of the item being inspected.

Trigger-To-Image Reliability Sap. Acquisition Support: ◦ Signal Status can be checked: ▪ Horizontal/Vertical Sync

Trigger-To-Image Reliability Sap. Acquisition Support: ◦ Signal Status can be checked: ▪ Horizontal/Vertical Sync present ▪ Horizontal/Vertical Sync Locked ▪ Pixel Clock present ▪ Chroma signal present ◦ Callbacks can be defined to signal: ▪ External Trigger Received/Ignored ▪ Horizontal/Vertical Sync lost ▪ Frame lost ▪ Data overflow

Trigger-To-Image Reliability Sap. Buffer Support ◦ State Flags ▪ Buffer Full/Empty. ▪ Buffer Overflow.

Trigger-To-Image Reliability Sap. Buffer Support ◦ State Flags ▪ Buffer Full/Empty. ▪ Buffer Overflow. ◦ Counter Stamps ▪ Buffers can be stamped with an event count based on I/O trigger counts. ◦ Buffers are always Time Stamped ▪ Using hardware timers if supported by the frame grabber. ▪ Using the high resolution system clock if not.

Trigger-To-Image Reliability Sap. Transfer Support ◦ Callbacks can be defined to signal: ▪ Image

Trigger-To-Image Reliability Sap. Transfer Support ◦ Callbacks can be defined to signal: ▪ Image Line Under-Runs: When less pixels than expected are received in a given line. ▪ Image Field Under-Runs: When less lines than expected are received in a given field (also applies to single field images; I. e. progressive scan).

Sapera++ Question Period…

Sapera++ Question Period…