Up | Sick IVP Ranger E | Microsoft Kinect | GCPS

Release Notes - GCPS
 

  

 
GCPS

GCPS - Grey Code Phase Stepping, instrument is used to generate 3D images or point clouds with Scorpion Vision Software.

A GCPS instrument consists of the following:

  • A Video Projector certified for GCPS operation
  • One to four cameras with lenses
  • A chess board calibration object

Before generating a 3D Images the GCPS Instrument must be calibrated. The 3D Image is generated by processing multiple images with different stripe pattern projected. Typical number of images is from 15 to 21.  The concept is often described as stripelight. The 3D model generating is divided into to parts. Image Aquisition projecting and capturing stripelight images. This typically performance is 3 images / seconds. A typical capture time is from 5 to 10 seconds. After capturing images the system processing time is typically 2 seconds. In a multicamera system Scorpion process the different images in different threads thus in a multi-core the image processing time is not affected by adding cameras.

The 3D Images has one point for each pixel in the camera. In Scorpion 3D points from different cameras can be merged into on 3D image.

Installations

Some installation must be done: The contents of the folder: GCPS must be placed under Program Files/ Tordivel AS/ Scorpion #/GCPS

The run time library for the Visual Studio 2005 SP2 is recommended to install.

The GCPSGrab.dll, is the first 3D camera driver in Scorpion. The GCPSGrab.dll may be found in the release notes of GCPS.

 License

To enable GCPS, you will need a Scorpion license with GCPS, and in addition you must place a GCPS.lic file in the Scorpion directory (Program Files/Tordivel AS/Scorpion/)   If you don't have such a file, please contact Tordivel AS.

 Adding GCPS camera

 

In order to enable GCPS for 3D inspection of physical objects a GCPS Camera must be added in the camera list as shown in Figure 1. A GCPS driver supports several "cameras", see the table below.

Camera name Image type
GCPS1 Default point cloud. If multiple cameras the point cloud may be configured to be all
GCPS1.CAM1..4 Individual point cloud from available camera 1 to 4 (as configured)
GCPS1.CAM1..4.1 Individual greyscale image #1 from camera 1 to 4 (as configured), the projector maximum illuminated image
GCPS1.CAM1..4.2 Individual greyscale image #2 from camera 1 to 4 (as configured), the projector minimum illuminated image

We have named the camera GCPS1.  The Figure also shows that by right clicking the camera, we may access the camera properties. Then the GCPS Instrument  setup dialog will appear.

 

Figure 1: Camera settings GCPS

GCPS Instrument Setup

Figure 2: GCPS Instrument Setup

Multiple cameras may mounted to increase the field of view due to shadow and reflection limitations.

Instrument

Parameter Default Description
Camera driver Firegrab.dll Camera driver for the cameras connected to the GCPS instrument, may be any standard Scorpion cameradriver. A camera 'Reset All' is necessary for changes to take effect.
GCPS configuration GCPS\Gcps.conf GCPS configuration file for structured light processing. A camera 'Reset All' is necessary for changes to take effect.
Projector delay 120 ms Delay between projector pattern and the camera grab-command is given.
The delay is projector and camera dependent. If this delay is too short the projected pattern may not be stable during image exposure.

Camera

Parameters Default Description
Camera 1..4 <empty> Name of connected camera. Click the right side button '...' to browse for available cameras. Click the 'Setup' button to configure the selected camera. The left side checkbox indicates connected/unconnected state of the camera.
Port 1..4 1..4 Virtual internal port number (ID) for actual camera. If multiple GCPS instruments (projectors), the next projector must use port 5..8. The 'View' button shows a 'live' viewer window for the camera. The viewer is useful when adjusting the shutter/exposure parameters to get maximum grey scale dynamics for the image. Pixels in overflow (pixel value 255) is indicated in pink color and should be avoided in the ROI.

ROI

Parameters Default Description
Camera 1..4 (checkbox) unchecked Check/uncheck to enable/disable ROI's
Camera 1..4 (readonly text) <empty> To reduce processing time ROI's may be defined for the individual cameras. The ROI's is defined using by clicking in the viewer window.

Click the four ROI corners in the viewer while pressing <ctrl> (std. Scorpion ROI operation).

Press <ctrl A> to add current ROI to existing ROI's (if any), press <ctrl Z> to replace all ROI's (if any) with current ROI or press <ctrl D> to delete last ROI.

Press 'Clear' button to remove ROI's for actual camera.

Pointcloud output

Parameters Default Description
XYZ unordered checked creates an unordered point cloud of 'YYZ' points satisfying filter conditions below. Each point contains 3 float values and are the less memory consuming format.
XYZCI unordered unchecked creates an unordered point cloud of 'YYZCI' points satisfying filter conditions below. Each point contains 5 float values, in addition to the x, y and z values, each point contains a 'contrast value indicating the quality of the point.
XYZCI unordered unchecked creates an ordered point cloud matrix of 'YYZCI' points ignoring filter conditions below
Min contrast (C) 5 minimum acceptable contrast value of points in output unordened point cloud
Min height (Z) 0 minimum acceptable height value of points in output unordened point cloud
Max height (Z) 150 maximum acceptable height value of points in output unordened point cloud

Image logging

Parameters Default Description
Save images unchecked saves all images used in GCPS processing
Directory Images main image directory, the images are saved at subdirectories named by camera index, CAM1, CAM2..CAMn

GCPS calibration

The calibration of the GCPS instrument is done by measuring at a calibration plate in different heights and angles. The calibration plate must be a hard and stiff plate painted with a "chess pattern" of at least 10x10 white and black squares. It is important that the calibration plate is large enough in order to achieve a valid calibration. This means that the whole volume seen by the 2 cameras and the projector light must be covered by the calibration plate.

The calibration of the GCPS instrument must be valid for a volume in 3D. This is done by calibrating a sequence of 2D pictures. Each 2D picture account for lens distortion and camera perspective in one particular 2D plane. With interpolation techniques it is then possible to account for lens distortion and camera perspective in the 3D Volume covered by the sequence of 2D pictures.

Calibration of the instrument covers camera intrinsics, extrinics and height calibration and is done by measuring at the calibration plate at at least 3 heights with the calibration plate in a horizontal plane and at least 3 different horizontal planes.

 

The calibration process consists of 3 steps, recording of calibration images, generation of calibration files and the calibration.

Recording of calibration images.

In order to retrieve calibration images the video projector must be set up to to give a GCPS pattern. In Figure 2 (above on this page) the instrument => GCPS configuration input field points to a GCPS configuration file called gcps.conf, which holds the pattern setup. The contents of this file is shown in figure 3.

Figure 3: GCPS configuration file

The .conf file is structured as follows:
1: Parameters to modify how to display the light gray code pattern with the projector.
2: The file path to the surfaces.cof file for camera 1, which describes the height calibration
3: The file path to the extrinsics.dat and intrinsics.dat file for camera 1, which describes the camera calibration for camera 1.
4: The file path to the surfaces.cof file for camera 2, which describes the height calibration
5: The file path to the extrinsics.dat and intrinsics.dat file for camera 2, which describes the camera calibration for camera 2.

 

To get the best calibration result, adjust the lens aperture/camera shutter so the pixel values in the white squares is as close to 255 as possible to get maximum contrast/dynamic in the 2D images. Show the 'live viewer' by clicking view for the camera as shown in Figure 4.

Figure 4: adjusting light conditions

The yellow area is the region of interest. To remove the ROI press Ctrl + z, and to add ROI press Ctrl + a. ROI is used to lower the computational time in processing the images to a 3D image. Click the 'Show pattern' checkbox to activate the projector while adjusting to get operating light conditions. Pixels with value of 255 will be indicated in pink colour to ease the camera adjustment. Note that the light conditions may vary at different heights so the calibration plate should be placed at different heights to verify settings There should not be any pink colour pixels on the calibration plate in the picture. Adjust the focus on the camera until you have achieved a good focus for the centre of the calibration volume you want to inspect. Use the zooming functionality for this purpose (Click and mark the area you want to zoom with the mouse). After applying appropriate values, you are ready to start the calibration process.

Start the calibration process by launching the calibration dialog by pressing the 'Calibrate' button and a date stamped calibration dialog box will appear.

Figure 5: Adding calibration planes for two cameras

Press the green "+" button to add a calibration plane.
The calibration plane is added and it may suffer from saturation problems. If so, remove the calibration plane by pressing the red "-" button, adjust the light conditions and try again.  Figure 5 shows a date stamped calibration dialogue when two calibration pictures has been added.

Generation of calibration files

Press the "generate calibration files" button to generate the calibration files. This button generates a point cloud in several files. The files must be post processed with MatLab to generate a proper calibration.

Calibration

Open the file c:Program Files\Tordivel AS\<Scorpion version>\GCPS\MCRInstaller.exe. This will install a MatLab runtime library. A MatLab calibration toolbox may now be run under MatLab, and will show as a MatLab Component Runtime in the list of programs on the computer. Now one must run GCPSCalibrationGui.exe. This will unpack MatLab files and place them in Scorpion 7\GCPS\GCPSCalibrationGUI_mcr. Afterwards a GUI application will open. This application is shown in Figure 6. It is important newer to close any windows generated by this application when calibrating. The console window in the back of Figure 6 must be watched the whole time, cause if you click wrong, messages will be displayed in the console window. All lot of user interaction happens through the console window during calibration.

Figure 6: Matlab calibration GUI

Click Select directory in the MatLab calibration GUI. (browse to <ProfileName>\Hardware\GCPS\GCPS1 \<dateStampedCatalogue>\cam1\CALIB)
Press OK

Click Camera Calibration in the MatLab GUI. It might be a good idea to organize the windows so that you may see the console window the Image window and the calibration GUI at the same time. You are now going to work your way through defining the calibration grid for all pictures for camera 1.
For each picture 4 pixels which determine the corner points of the calibration grid. Define a point in the picture simply by clicking in the window showing your calibration plate. Always start in the same corner point of the calibration plate, and click clockwise to define these points. If you click unintended or wrong, click 4 times anyway, and when the console window asks if you want to click again: simply press y and ENTER in the console window to confirm yes.
Figure 7 shows the resulting square and messages in the console window

Figure 7: Resulting square

In the console window press ENTER to confirm the pattern (the green square in figure 7. You are now asked to identify the Calibration grid size. In case you use a 50 mm grid, simply type 50 in the console window and confirm with ENTER. You are then shown the identified calibration points from the picture. Make sure that you zoom these points to verify that they are identified correctly. Press ENTER in the console window to confirm the calibration points for this picture. Once one calibration plane is defined, you are asked to define the calibration points for the next calibration plane. After completing all pictures for one camera the insintric calculations for the camera will be performed. You are now asked to specify picture for exentric calculations. This specifies which picture holds the origin. Click enter to use the default (first picture, first click gives the origin) PS: If multiple cameras are used, it is important that the origin is the same point for both cameras. Remember which image number you used for camera 1, so that the same image may be used for origin in camera 2.
A message is displayed in the console window: 'Extrinsics paramters saved as extrinsics.dat'

In the Matlab GUI window press the Height Calibration. After enter is pressed in the console window, give in the number of pixtures that is in the horizontal plane, without perspective. The console window will perform a lot of tasks and write out created files and results. The last line in the console window should be:
"writing coefficients to file: surfaces.conf"

A 3D image will display. Press the button rotate 3d. Click and drag in the picture to rotate, and verify that the e.g. 6 planes that you had as height calibration is present as shown in Figure 8.

Figure 8: 3D image of calibration planes

Close the application by pressing Exit in the Matlab GUI, and do Step 4 to Step 9 for the next camera. Remember to change the file path in step 4 to point to the correct camera calibration.

Run GCPSCalibrationGui.exe once more for the next camera. Remember to change the file path in step 4 to point to the correct camera calibration.

Open the GCPS.conf file located in the folder:
C:\Program Files\Tordivel AS\Scorpion 7\V-Stag\Hardware\GCPS
Change the file path DATE STAMP to the one you have for your calibration. This should be done for the file paths: surfaces.cof,
intrinsics.dat and extrinsics.dat for all cameras. These file paths is found at the end of the file GCPS.conf as shown in Figure 3.
Save the GCPS.conf.

Close Scorpion and open it again. Go to Camera and right click on GCPS1 and click reset all. This will reload all the cameradrivers. This will get you a proper initialization which you have changed by changing the date in the GCPS.conf file.

Additional tips

Your calibration is completed but we give some additional tips:

Use PointCloud output xyz ordered. This option will give point clouds which satisfy the Min contrast as shown in Figure 24.

If the installation should be moved to another machine, you must bring the GCPS folders with you.
C:\Program Files\Tordivel AS\Scorpion 7\<ProfileName>\Hardware\GCPS
C:\Program Files\Tordivel AS\Scorpion 7\GCPS

In GCPS1 properties. Show pattern 6 and choose view on both cameras to find the correct light conditions. If saturation is reached, no image will be displayed.

Some projectors (especially LED projectors) has a nonlinear response displaying grey levels. To account for this, a PROJECT.LUT file may be placed in the folder where gcps.conf is located. This file should contain 256 lines. Each line contains a number describing which grey level one must project for the camera to see it as grey level 1 - 255. Use a white paper and project different grey levels to find a correct mapping. PS: Make sure that the camera shutter is correct, so that white is displayed as 255 in the mapping.  

Scorpion Vision Version XII : Build 646 - Date: 20170225
Scorpion Vision Software® is a registered trademark of Tordivel AS.
Copyright © 2000 - 2017 Tordivel AS.