Examples - 2D Scanner Setup
This section provides example for setting up 2DScanner
Example 6 - Scorpion 3D Venom mirror image split setup
The configuration file splits a Venom camera’s two mirrors into separate resampled images. The two calibrators origin (0,0) is centered in each mirror. Note that the physical camera’s image is set active and the two resampled images inactive.
[Config]
CameraDriver=PylonAreaCamera_pylon5_1_5_2_40.dll
FilterDLL=ScorpionOpenCV.dll
ResampleDLL=SVLResample.dll
ResampleMode=1
Verbose=0
[Scanner0001]
Cameras=1
Scans=1
MinScans=0
ActiveGrabTimeout=0
Overlap=0
Scale_x=1
Scale_y=1
TopLeft_x=-12
TopLeft_y=-10
Size_x=24
Size_y=20
Pitch_x=0.02
Pitch_y=0.02
PassThru=1
Active=0
Threaded=1
[Scanner0001.Camera1]
Port=0
Prefilter=
PrefilterOptions=-g1.0-o0
Calibfile=..\Calibration\2D\CalibrationCam1.ini
[Scanner0002]
Cameras=1
Scans=1
Overlap=0
Scale_x=1
Scale_y=1
TopLeft_x=-12
TopLeft_y=-10
Size_x=24
Size_y=20
Pitch_x=0.02
Pitch_y=0.02
PassThru=
Active=0
[Scanner0002.Camera1]
Port=0
Prefilter=
PrefilterOptions=-g1.0-o0
Calibfile=..\Calibration\2D\CalibrationCam2.ini
Example 7 - Two camera ‘linescan’ setup
This configuration file uses two cameras mounted at a conveyor stitching 50 narrow images to one long image for each camera.
It passes thru first and last image to Scorpion.
this is for debugging only - PassThru=1,-1
requires that images in Scorpion is set to receive the images
performance is reduced and affected
set PassThru= #to empty for runtime operation
It uses calibration files from two ExternalReference tools.
Notes:
that the physical camera images are inactive while the scanner images are active.
that the system has multiple calibration files on different calibration heights.
both cameras has the threaded resampling turned off.
[Config]
CameraDriver=PylonAreaCamera_pylon5_1_5_2_40.dll
FilterDLL=
ResampleDLL=SVLResample.dll
ResampleMode=1
Verbose=0
[Scanner0001]
Cameras=1
Scans=50
MinScans=0
ActiveGrabTimeout=0
Overlap=0
Scale_x=1
Scale_y=1
TopLeft_x=100
TopLeft_y=0
Size_x=100
Size_y=329
Pitch_x=0.5
Pitch_y=0.5
PassThru=1,-1
Active=1
Threaded=0
[Scanner0001.Camera1]
Port=0
Prefilter=
PrefilterOptions=-g1.0-o0
CalibFile=..\Calibration\2D\ExtRefCam1_0mm.ini
[Scanner0001.Camera1.Calib1]
Prefilter=
PrefilterOptions=-g1.0-o0
CalibFile=..\Calibration\2D\ExtRefCam1_25mm.ini
[Scanner0001.Camera1.Calib2]
Prefilter=
PrefilterOptions=-g1.0-o0
CalibFile=..\Calibration\2D\ExtRefCam1_50mm.ini
[Scanner0002]
Cameras=1
Scans=50
Scale_x=1
Scale_y=1
TopLeft_x=100
TopLeft_y=0
Size_x=100
Size_y=329
Pitch_x=0.5
Pitch_y=0.5
PassThru=1,-1
Active=1
Threaded=0
[Scanner0002.Camera1]
Port=1
Prefilter=
PrefilterOptions=-g1.0-o0
CalibFile=..\Calibration\2D\ExtRefCam2_0mm.ini
[Scanner0002.Camera1.Calib1]
Prefilter=
PrefilterOptions=-g1.0-o0
CalibFile=..\Calibration\2D\ExtRefCam2_25mm.ini
[Scanner0002.Camera1.Calib2]
Prefilter=
PrefilterOptions=-g1.0-o0
CalibFile=..\Calibration\2D\ExtRefCam2_50mm.ini
Example 8 - 3D Stereo Vision - grab two images with timeout
In this example the 2DScanner is used to ensure that both stereo images are acquired at the same time.
Setting
Scans=1 and
ActiveGrabTimeout>0
ensures the second image arrives less than n ms after the first image, order don’t care.
If timeout occurs,
MinScans=0
discards received image silently,
MinScans=1 the returned image
is padded ‘black’, the missing pixels are all set to 0.
Each image is calibrated with a Calibrator, origin (0,0) at image center, and ROI size of 440x600.
The resulting image from this configuration is a ‘single stripe’ of 440x1200 pixels.
[Config]
CameraDriver=HVGrab_1_0_4_41.dll
FilterDLL=SVLImageFilter.dll
ResampleDLL=SVLResample.dll
ResampleMode=1
Verbose=0
[Scanner0001]
Cameras=2
Scans=1
Overlap=0
ActiveGrabTimeout=300
MinScans=0
Scale_x=1
Scale_y=1
Pitch_x=1
Pitch_y=1
PassThru=
Active=0
Threaded=1
[Scanner0001.Camera1]
Port=0
TopLeft_x=-220
TopLeft_y=-300
Size_x=440
Size_y=600
CalibFile=..\Calibration\2D\CalibrationCam1.txt
[Scanner0001.Camera2]
Port=1
TopLeft_x=-220
TopLeft_y=-300
Size_x=440
Size_y=600
CalibFile=..\Calibration\2D\CalibrationCam2.txt
Note
Typically, when timeout occures,
the second image may be delayed due to network delays.
When the delayed second image arrives, a ‘false’ timeout will occure waiting for the never arriving first image.
In this case, if MinScans=1, 2DScanner returns two images, each missing part padded ‘black’.
Example 9 - 2D Shading Correction for multiple heights
The following example configures a single camera for shading correction in 2 different heights. Note that targetvalue of 92 is used instead of max pixelvalue in calibration image.
Changing between calibration heights runtime is done by
GetCamera(‘Scanner0001’).setProperty(‘camera1.calib’, 0)
GetCamera(‘Scanner0001’).setProperty(‘camera1.calib’, 1)
[Config]
CameraDriver = PylonAreaCamera2_pylon5_1_5_3_52.dll
FilterDLL = SVLImageFilter.dll
ResampleDLL = SVLResample.dll
ResampleMode = 1
Verbose = 1
[Scanner0001]
Cameras = 1
Scans = 1
Overlap = 0
Scale_x = 1
Scale_y = 1
TopLeft_x = 0
TopLeft_y = 0
Size_x = 1200
Size_y = 1920
PassThru = 1
Active = 1
ActiveGrabTimeout = 0
MinScans = 0
Threaded = 1
Pitch_x = 1
Pitch_y = 1
[Scanner0001.Camera1]
Port = 0
PreFilter = ..\Calibration\2D\color\20210212-190300_SP-0160-SN4564-MEL3-RightTop2D-Calib_(02E16700514)_Gain17_Gamma750_Expo1200_BlackLevel240_brRed2033_brGreen1024_brBlue2022.bmp
PrefilterOptions = -t92
CalibFile =
[Scanner0001.Camera1.Calib1]
PreFilter = ..\Calibration\2D\color\20210212-190300_SP-0160-SN4564-MEL3-RightTop2D-Calib_(02E16700514)_Gain17_Gamma750_Expo1200_BlackLevel240_brRed2033_brGreen1024_brBlue2022.bmp
PrefilterOptions = -t92
CalibFile =