350 likes | 827 Views
Agenda. OverviewSapera FundamentalsSapera Class DescriptionsSapera ExamplesAdvanced Topics. Overview. DALSA Coreco's Main API32 bit OOP, multi-threaded libraryC encapsulation of low level C' libraryModular and device independentTrigger-To-Image Reliability (T2IR). Advanced Features
E N D
1. Sapera LT
2. Agenda Overview
Sapera++ Fundamentals
Sapera++ Class Descriptions
Sapera++ Examples
Advanced Topics Callback support
Trigger-To-Image Reliability
Callback support
Trigger-To-Image Reliability
3. 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 (T2IR)
4. Advanced Features (Version 6.00) Support for the Genie (GigE camera).
Format conversion support in buffer module (in Sapera and the CamExpert).
RGB line profiler function in CamExpert.
Diagnostic to for collecting all relevant DALSA Coreco driver and SDK information.
Tool for creating, editing and saving LUTs in CamExpert.
5. 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 ActiveX controls.
Borland Delphi 7 for the ActiveX controls.
Microsoft Visual Studio .NET 2003 (C# and VB) for the ActiveX controls.
6. Important Sapera Tools CameraExpert
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.
7. Sapera Diagnostic Tools LogViewer
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.
8. Agenda Overview
Sapera++ Fundamentals
Sapera++ Class Descriptions
Sapera++ Examples
Advanced Topics Overview
Sapera Tools (What in the package)
The Sapera Architecture
Structural overview
Classes Basic/GUI
Terminology
Sapera Basics
Steps to building an application
Class Descriptions
Basic image display
Basic Grab and display
Advanced Topics
The Trash Buffer (I.e. Buffer States)
Callback support
Trigger-To-Image Reliability
Overview
Sapera Tools (What in the package)
The Sapera Architecture
Structural overview
Classes Basic/GUI
Terminology
Sapera Basics
Steps to building an application
Class Descriptions
Basic image display
Basic Grab and display
Advanced Topics
The Trash Buffer (I.e. Buffer States)
Callback support
Trigger-To-Image Reliability
9. 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). ACQ:
A server may have more than on Acquisition module
CAB:
Only on per board.ACQ:
A server may have more than on Acquisition module
CAB:
Only on per board.
10. 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
Servers & Resources:
Are controlled through handles.Servers & Resources:
Are controlled through handles.
11. Application Error Management Errors can be reported in four ways:
Messages are sent to a popup window
Messages are sent to the LogViewer
Messages are sent to the active debugger
Messages are kept internally (the last can be retrieved with ‘GetLastStatus()’)
During development the LogViewer can come in handy:
Application and driver messages are stored by the LogViewer
12. 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
13. Steps to Building an Application Include SapClassBasic.h
Add $(SAPERADIR)\Classes\Basic to the include path.
Add SapClassBasic.lib to the Release build definitions.
Add SapClassBasicD.lib to the Debug build definitions.
Select ‘Multithreaded DLL’ as the run-time library used during execution.
14. Agenda Overview
Sapera++ Fundamentals
Sapera++ Class Descriptions
Sapera++ Examples
Advanced Topics Overview
Sapera Tools (What in the package)
The Sapera Architecture
Structural overview
Classes Basic/GUI
Terminology
Sapera Basics
Steps to building an application
Class Descriptions
Basic image display
Basic Grab and display
Advanced Topics
The Trash Buffer (I.e. Buffer States)
Callback support
Trigger-To-Image Reliability
Overview
Sapera Tools (What in the package)
The Sapera Architecture
Structural overview
Classes Basic/GUI
Terminology
Sapera Basics
Steps to building an application
Class Descriptions
Basic image display
Basic Grab and display
Advanced Topics
The Trash Buffer (I.e. Buffer States)
Callback support
Trigger-To-Image Reliability
15. Sapera++ Class Descriptions SapAcquisition:
Implements access and configuration of acquisition resources.
Allows Signal Status verification (when an acquisition device is has the capability; T2IR):
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.
16. Sapera++ Class Descriptions SapBuffer:
Provides all buffer related functionality.
Provides parameters for the control of acquisition and the detection of error conditions (T2IR).
Supports time/counter stamps (T2IR).
Buffer copy method performs automatic data format conversion between source and destination.
Includes a new software BayerConversion and WhiteBalance functions.
17. Sapera++ Class Descriptions SapTransfer:
Implements a flexible transfer process which supports all Sapera compatible DALSA Coreco hardware.
Specialized classes have been derived from SapTransfer in order to simplify the most common transfer configurations (e.g. SapAcqToBuf).
Provides callbacks on transfer events such as Start/End of frame, N-Lines/Line-N, as well as, line/field data under-runs (T2IR).
18. Sapera++ Class Descriptions SapView:
Provides functionality for the display of data stored in a SapBuffer objects.
Uses an internal thread to manage data viewing.
Takes care of access and control of available display hardware (SapDisplay) 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.
19. Sapera++ Class Descriptions SapDisplay:
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.
SapLut:
Is a new Sapera++ class that implements Look-Up-Table functionality for acquisition and viewing.
20. Sapera++ Class Descriptions SapManager:
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.
SapLocation:
Identifies a Server/Resource pair.
21. Sapera++ Class Description SapGraphic:
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.
22. Sapera++ Class Descriptions SapGio:
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 SapCounter class to enable I/O pin states to change automatically.
SapCounter:
Allows for the counting of I/O events and timers.
Is able to issue callbacks for counter events.
23. Sapera++ Class Descriptions SapProcessing (not ‘the’ Sapera Processing!):
The SapProcessing class must be derived in order to integrate user defined processing.
SapBuffer 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.
24. Agenda Overview
Sapera++ Fundamentals
Sapera++ Class Descriptions
Sapera++ Examples
Advanced Topics Overview
Sapera Tools (What in the package)
The Sapera Architecture
Structural overview
Classes Basic/GUI
Terminology
Sapera Basics
Steps to building an application
Class Descriptions
Basic image display
Basic Grab and display
Advanced Topics
The Trash Buffer (I.e. Buffer States)
Callback support
Trigger-To-Image Reliability
Overview
Sapera Tools (What in the package)
The Sapera Architecture
Structural overview
Classes Basic/GUI
Terminology
Sapera Basics
Steps to building an application
Class Descriptions
Basic image display
Basic Grab and display
Advanced Topics
The Trash Buffer (I.e. Buffer States)
Callback support
Trigger-To-Image Reliability
25. Using Sapera++ Typical Allocation of Sapera++ objects:
// Allocate the buffer object
SapBuffer *pBuffer = new SapBuffer( 1, 512, 512);
if (pBuffer->Create())
{ // Buffer created OK... }
...
// Implicit BOOL operator for creation validation
if (*pBuffer)
{ pBuffer->Destroy(); }
// Release the object memory
delete pBuffer;
pBuffer = NULL;
26. Basic Image Display SapBuffer *pBuffer;
SapView *pView;
pBuffer = new SapBuffer(1, 640, 480, SapFormatMono8);
pView = new SapView( pBuffer, SapHwndDesktop);
pBuffer->Create();
pView->Create();
pView->Show(); // Display the image on the desktop
pView->Destroy();
pBuffer->Destroy();
delete pView;
delete pBuffer;
27. Basic Acquisition and Display // Object declaration
SapAcquisition *pAcq;
SapBuffer *pBuffer;
SapTransfer *pXfer;
SapView *pView;
// Object allocation
pAcq = SapAcquisition( SapLocation(“X64_1”, 0), myCamera.ccf);
pBuffer = new SapBuffer( 1, pAcq);
pView = new SapView( pBuffer, SapHwndDesktop);
pXfer = new SapTransfer( myXferCallback, pView);
pXfer->AddPair(SapXferPair( pAcq, pBuffer);
28. Basic Acquisition and Display pAcq->Create(); // Create the objects
pBuffer->Create();
pXfer->Create();
pView->Create();
// Start a continuous transfer (live grab)
pXfer->Start();
...
pXfer->Stop(); // Stop the transfer
pXfer->Wait( 5000); // Wait for grab to stop
pXfer->Destroy(); delete pXfer;
pView->Destroy(); delete pView;
pBuffer->Destroy(); delete pBuffer;
pAcq->Destroy(); delete pAcq;
29. Basic Acquisition and Display // Do the new image display in the transfer callback
void myXferCallback( SapXferCallbackInfo *pInfo)
{
// Display the last transferred frame
SapView *pView = (SapView *) pInfo->GetContext();
pView->Show();
}
30. Agenda Overview
Sapera++ Fundamentals
Sapera++ Class Descriptions
Sapera++ Examples
Advanced Topics Overview
Sapera Tools (What in the package)
The Sapera Architecture
Structural overview
Classes Basic/GUI
Terminology
Sapera Basics
Steps to building an application
Class Descriptions
Basic image display
Basic Grab and display
Advanced Topics
The Trash Buffer (I.e. Buffer States)
Callback support
Trigger-To-Image Reliability
Overview
Sapera Tools (What in the package)
The Sapera Architecture
Structural overview
Classes Basic/GUI
Terminology
Sapera Basics
Steps to building an application
Class Descriptions
Basic image display
Basic Grab and display
Advanced Topics
The Trash Buffer (I.e. Buffer States)
Callback support
Trigger-To-Image Reliability
31. 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.
32. Trigger-To-Image Reliability SapAcquisition 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
33. Trigger-To-Image Reliability SapBuffer 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.
34. Trigger-To-Image Reliability SapTransfer 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).
35. Sapera++
Question Period…