Upload
rayhsu
View
746
Download
3
Tags:
Embed Size (px)
Citation preview
Leutron Vision - OrChid Guide
Outline
✰Introduction✰Image Acquisition✰Image Processing✰Advanced Topics✰Commands
Introduction
✰Orchid/Daisy✰DLL / .Net Class Library✰Log Message Receiver✰Obsolete - ActiveX
IntroductionLog Message Receiver
Introduction
✰Acquisition Modules
✰Processing Modules
Modules
Live Module (LvxLive)Real-Time Modules (LvxRt)
The Preprocessor Module (LvxPrep)The DirectX Preprocessor Module(LvxDX)
Introduction
✰ Display Live Image✰ Making a Snap(By Stopping the Live)✰ Copying the Snap Image to Clipboard✰ Saving the Snap Image to a BMP, TIFF or JPG File✰ Saving Live Image to an AVI file✰ Returning the Snap Bitmap as Pointer to Device Independent
Bitmap✰ Display a Dialog Box for Grabber/Camera/Connector Selection✰ Display a Dialog Box for Live Image Setting✰ Possibility to Save/Load the Setting
LvxLive Module
Introduction
✰ Primary Module / Asynchronous Reset Module✰ Grabbing of an Image or Sequence of Images to an Internal Buffer✰ Display the Acquired Sequence✰ Notify Frame Completion✰ Grabbing in a Loop to Simulate Live✰ Saving Image to BMP, TIFF, JPEG file✰ Adding Grabbed Image to AVI File✰ Copying Image to Clipboard✰ Display a Dialog Box
Real Time Module
Run-Time SettingI/O ConfigureCOM Ports Communication
Introduction
✰Convert Pixel Format✰Applying Filters
Preprocessor Module
Noise ReductionBayer Array DecodingWhite Balance 、 Color Space CorrectionShading CorrectionOverlay Text or Graph
Introduction
✰Image Manipulation✰Overlay Text and Graphics
DirectX Processor
Introduction
✰C Interface✰Backward compatible
DLL Version of Orchid
Introduction
✰Unmanaged/managed Code✰.NET Frame Work 2.0✰LeutronVision.Orchid.DLL
.Net Class Library
Introduction
✰DLL - C✰.Net - C++✰lvx_OpenTask() / lvx_CloseTask()✰lvx_ Prefix✰Error Handling✰GDIPlus
Difference Between DLL and .Net Class Library Version
Introduction
✰ The names of the Orchid .Net Classes correspond to the module types:• LvxLive - the Live module• LvxRt - the real-time Primary module (based on Basic Sequencer DRAL)• LvxRtAr - the real-time Asynchronous Reset module (based on Asynchronous Reset Sequencer DRAL)• LvxPrep - the Preprocessor module• LvxDX - the DirectX Processor module• LvxDll - auxiliary class for controlling the load of Orchid.DLL. Its properties and methods are static, i.e. you do not need to create an instance of this class and use the properties and methods directly.• LvxException - class for throwing exceptions, derived from System::Exception
✰ • For C/C++ compilers the Orchid. l ib import library must be linked to your application and the Orchid.h file must be included. Note that for Borland compilers the OrchidBc.l ib must be used instead.
✰ • For Borland Delphi, the Orchid.pas unit is to be added to your project and referenced in the "uses" part in other units. Alternatively, you can use OrchidDyn.pas, which can load Orchid DLL on demand.
✰ • For MS Visual Basic 6 the Orchid.bas file is to be added to the project.
Linking Orchid With Your Application
Introduction
Introdction
✰1. Check in your code2. Hardware Functionality3. Manual
✰Log Message Receiver
Trouble Shooting
* Running Before Orchid Application Star up* spends additional time by sending the messages to it
Image Acquisition
✱ Setup A Connection✱ Specify Display Window✱ Showing the Live Image and Setting its Attributes
✱ Making a Snap and Setting its Attributes
✱ Recording to AVI File✱ Saving the Setting✱ Other Functions
Understanding LvxLive Module Functionality
Image Acquisition
✰ LvxBaseAcquisition::Grabber, LvxBaseAcquisition::Connector, LvxBaseAcquisition::Camera
✰ lvx_DisplayConnectionDialog()
Setting Up a Connection
Image Acquisition
✰Lvx_SetDisplayWindow()
Specify Display Window
Image Acquisition
✰lvx_SetLive()✰lvx_SetGain()✰lvx_SetExposure()✰lvx_SetBlackLevel()
Showing the Live Image and Setting its Attributes
Image Acquisition
✰lvx_DisplaySnapSettingDialog()✰lvx_CreateDisplayableImageBitmap()
Making a Snap and Setting its Attributes
Image Acquisition
✰Select Compressor✰lvx_SaveAviSettings()✰lvx_LoadAviSettings()✰lvx_SetCaptureToAvi()
Recording to AVI File
Image Acquisition
✰lvx_SaveSettings()✰lvx_LoadSettings()
Save Setting
Image Acquisition
✰lvx_SetLoadWindowEnable()✰lvx_SetOptoOutput()
Other Functionality
Image Acquisition
✰ Hardware: Direct to VGA Memory✰ Software: to CPU Memory✰ DirectX(Visible)✰ Hardware/Software Transition✰ MDI✰ Command: Window List Add / Window List Clear
Hardware Live V.S. Software Live
Image Acquisition
✰Open Format✰Codec Issue✰lvx_DisplayAviSettingDialog()✰lvx_SaveAviSettings()
Create AVI File
Image Acquisition
✰Frame Rate
✰Image Size
✰Can’t Resize
Creat AVI File
Indeo Version 4 - Quick Compress Option
LvxLive Module - Divided by 8
Image Acquisition
✰lvx_OpenAviFile()✰lvx_CloseAviFile()✰lvx_SaveImageToAviFile()
AVI Functions
Image Acquisition
✰ Sequences and Frames✰ Check Point✰ Module Type✰ More Initial Setting✰ Initializing the Module✰ Run-Time Settings✰ Grabbing✰ Specify Display Window✰ Live
Understanding the Functionality of Real-Time Modules
Image Acquisition
✰ Accessing Grabbed Images✰ Storing Grabbed Images to File✰ Saving and Loading the Settings✰ I/O Settings✰ Other Functions✰ Advanced Functions
Understanding the Functionality of Real-Time Modules
Image Acquisition
✰Circular Buffer✰Analog Grabber : Sub-Sequence✰Digital Grabber : Historical Reason
✰lvx_GetSubsequences()
Sequences and Frames
Image Acquisition
✰Grabbing / Circular Buffer✰Check Control Value✰Continue Flag✰lvx_GrabContinue()✰Attribute: AsynchronousGrab
Check Points
Image Acquisition
✰LvxRT✰LvxRtAr
Module Type
Image Acquisition
✰lvx_Initialize()✰lvx_GrabContinue()
Initialize the Module
Image Acquisition
✰LvRT
✰LvRtAr
Run Time Setting
LvxRT::ExternalTriggerLvxBaseAcquisition::SetGain()LvxBaseAcquisition::SetExposure()
LvxRtAr::ShutterTimeLvxRtAr::CameraRestartDelayLvxRtAr::FlashModeLvxRtAr::FlashEnable
Image Acquisition
✰lvx_GrabContinue()✰wait for Triggerwait for Next Frame
✰lvx_SetNotifyCallBack()
Grabbing
Image Acquisition
✰Handle✰lvx_SetTileImages()✰lvx_DisplayImage()/lvx_DisplayImageEX()
✰lvx_CreateDisplayableImageBitmap()
Specify Display Window
Image Processing
✰Convert Color Format✰Preprocessing Filter✰Overlay Text
Image Processing
✰Lvx_OpenTask(lvx_Task_Preprossor)
✰Attach to Acquisition Module✰lvx_SetOwnerTask()✰lvx_PreprocessImage()
Using the Preprocessor
Image Processing
✰ Lvx_SetOwnerTask()✰ • Create the acquisition module and the preprocessor module.
✰ • Configure the acquisition module.✰ • lvx_Initialize() method.✰ 。 Lvx_SetOwnerTask()✰ 。 Configure Filters and Overlays
Sequences of initialize
Image Processing
✰ The Color Format Conversion✰ Filters✰ Overlays✰ Text Shadow by the WriteTextToOverlay Method
Configuring the Preprocessor
Image Processing
✰Color format Conversion
Configuring the Preprocessor
Lvx_SetImageBitsPerPixel()
Image Processing
✰Filters
Configuring the Preprocessor
Bayer Array DecodingNoise ReductionWhite BalanceColor Space CorrectionShading Correction
Image Processing
✰Filters
Configuring the Preprocessor
lvx_AddFilter()lvx_AddFilterRect()lvx_Command()
Image Processing
✰Noise Reduction Filter
Configuring the Preprocessor
Pixel by Pixel
DestPixel=((100-Factor)*AcquiredPixel + Factor*AccumulatorPixel)/100
Image Processing
✰White Balance
Configuring the Preprocessor
[R` G` B`] = [p1* R p2*G p3*B]
Image Processing
✰Color Space Correction
Configuring the Preprocessor
Image Processing
✰ ABSOLUTE_WHITE = (white_image_pixel - offset)* factor
✰ 0 = (black_image_pixel - offset)*factor✰ new_pixel_value = (acquired_image_pixel -
offset)* factor
Image Processging
✰lvx_CreatOverlay()✰lvx_SetOverlayVisible()✰lvx_SetoverlayOffset()✰lvx_WipeOverlay()✰lvx_GetOverlayDc()✰lvx_ReleaseOverlayDc()
Overlays
Image Processing
✰lvx_WriteTextToOverlay()✰lvx_PutBitmapToOverlay()
Overlays
Image Processing
✰TextShadowOverlays
lvx_TextAttr_ShadowRBlvx_TextAttr_ShadowRTlvx_TextAttr_ShadowLBlvx_TextAttr_ShadowLTlvx_TextAttr_ShadowBlvx_TextAttr_ShadowTlvx_TextAttr_ShadowLlvx_TextAttr_ShadonR
Image Processing
✰Preprocessing RunApplication Controlled PreprocessingAutomatic Preprocessing
Image Processing
✰Application Controlled Preprocessing
Preprocessing Run
lvx_PreprocessImage()lvx_SetNotifyCallBack()lvx_OnCheckPoint()
Image Processing
✰Automatic Preprocessing
Preprocessing Run
LvxRealTime::PreprocessingLimitation:• Only single preprocessor can be used.• It is applied when a checkpoint is reached, always only to the last image.• The preprocessing is done in-place, so the output color format must be the same as the input.
Image Processing
✰Preprocessing in the LvxLive Module
Image Processing
✰DirectX Display of Image
Reduce CPU LoadDirectDraw