User Guide

This section provide a simple guide to usage of Scorpion camera driver ScorpionCamera.

The ScorpionCamera is a shared memory camera driver for Scorpion, where Scorpion profiles may share acquired camera images, but also share dynamically created images like 3D point clouds, 3D height maps, 3D intensity maps, filtered or resampled images etc.

Installation

The ScorpionCamera camera driver is installed by the Scorpion Vision Installer and needs no further action.

Configuration

Server side configuration

Images may be shared by SharedMemoryWriter tool, ShareImage command or by python, SetSharedMemory methods or SharedBag class.

SharedMemoryWriter setup

Sharing images in a SharedBag secures all images and metadata to arrive in client applications.

_images/sharedmemorywriter.png

SharedMemoryWriter setup, sharing images and metadata in SharedBag.

Command Syntax

ShareImage; Image=<name> | ImageNo=<1..n>; Camera=<name>

Camera parameter is optional and equals image if omitted.

Python Syntax

  • SetSharedImage(<sharename>, image) #image is either image name, arrlib matrix or numpy image.

  • GetSharedImage(<sharename>)

sharename is name to be used in ScorpionCamera driver.

image may be either a named image in current profile, or a temporary python created arrlib image matrix or point cloud, or a numpy image. Supported point clouds are float vectors and matrixes of XYZ, XYZW and XYZWV.

Client side configuration

The camera driver has no configuration. Default the camera driver will have no cameras until a Scorpion profile has shared an image. A shared image will appear as a camera in list of available cameras, where the camera name will consist of origin profile and the image name separated with dot ‘.’ - <profilename>.<imagename>. This applies for single image shares only.

For images in a SharedBag, the image name must be prefixed by share name + ::, <bagname>::<imagename>

_images/camerasetup_sharedbag.png

Camera and image configuration using SharedBag, note the ‘::’ separator.

_images/sharedmemorymonitor.png

The SharedMemoryMonitor utility showing bag content

Accessing meta data

Metadata may be shared to client applications by sharing images in a SharedBag containing a string named Meta. The metadata is copied into the image’s meta property, accessible by python

  • GetCameraImage(<name>).meta

  • GetCameraImages().get(<index>).meta

  • GetCameraImages().getImage(<name>).meta

Sending commands to server

Standard commands may be sent to server profile by the camera’s python method executeCmd(cmd,params).

GetCamera(name/no).executeCmd(cmd,params)

GetCamera(‘3DModel’).executeCmd(‘Start’) will send the ‘Start’ command to the server profile. Since this command is a standard Scorpion command, it is not nessesary to handle this in Central, Scorpion will execute the command as any other command. Any other command than Scorpion commands must be handled in Central as custom commands.

Client - Server profile configuration

Server side configuration

_images/server_name.png

Server side camera name prefix

All shared images from this profile will have this prefix as Name field, in this example SDP-0075 RPP Stereo.

_images/server_inspectexecute.png

Server side Actions.InspectExecute commands

During inspection, the profile creates 2D and 3D images, and the 3DModel and HeightMap are shared to the ScorpionCamera driver.

The image=<name> is the image source, the camera=<name> is the shared camera name in the camera driver, in this example SDP-0075 RPP Stereo.3DModel and SDP-0075 RPP Stereo.HeightMap

Server side client commands handling

Grab commands at client side will send a command to the server profile where the image name equals camera name, i.e if the server profile “SDP-0075 RPP Stereo.3DModel” shares an image by Python command SetSharedImage(‘3DModel’,pointcloud), the camera “SDP-0075 RPP Stereo.3DModel.3DModel” will appear in the client profile. When the client profile sends a grab command for this camera, the ‘3DModel’ typically will be a 3D image in the server profile. To map this camera command to an action at server side, the command must be handled in Central’s System.CameraCommand event.

_images/server_central_cameracommand.png

Command from client camera triggers a Grab command.

Note

Note the delay=1, this may speed up command duration at client side as commands are synchronous and will block the client while executing at server side.

Client side configuration

_images/client_camera.png

Client side camera configuration.

Notice cameranames given by server side. The cameras will not show up in ScorpionCamera until once shared by a server.

  • “SDP-0075 RPP Stereo.3DModel”

  • “SDP-0075 RPP Stereo.HeightMap”

Note

Once configured, the cameras will always present and opened successfully by the client profile regardless of server is running or not.

_images/client_beforestart.png

Client side Actions.BeforeStart commands

First both cameras are set in continous mode so shared images are processed as they are shared by the server, ie the server handles image aquisition.

Secondly, the server profile is started.

_images/client_afterstop.png

Client side Actions.AfterStop commands

Leaves continous mode and stops the server.

_images/client_grabexecute.png

Client side Actions.GrabExecute commands

Arms the two cameras and triggers server camera.

Note

Note the delayed Inspect command to allow cameras to grab new images before inspecting and share.

Example 1 - Grab image

GetCamera('0').executeCmd('grab')

This command is not nessesary to handle in Central as it is a standard
Scorpion command.

Example 2 - Custom command

GetCamera('0').executeCmd('SetupMaster','Name=SPIO;Value1=5.0;Value2=7.3')

This command must be handled in Central as it is not a standard
Scorpion command.