gmlServiceCalibration Class Reference

Inherits from

Detailed Description

Manage 2D-2D geometric calibration for a client. Calibration cannot be concurrent (only one client at a time). Only one grabber can be used (it stays connected to the service). Previous calibration results are saved.

Service channels:

calibration (duplex)

Used to negotiate calibration with a GUI client, as follows:

  1. the client send a message containing a session identifier (8 hexadecimal digits), and the geometry (rectangle) of the area to calibrate.

    Calibrate 0A7B3C4D 0 0 1024 768

  2. the service sends a vector description of a calibration grid to display (the format is a list of rectangles):

    ``Display`` 0A7B3C4D l0 t0 r0 b0 l1 t1 r1 b1...
    
  3. the client displays the image with maximum contrast, and confirms this to the service by sending the following message:

    ``Done`` 0A7B3C4D
    
  4. the service finishes calibration and sends a confirmation to the client, and the mean error in display pixels:

    ``Done`` 0A7B3C4D 0.287
    

If an error occur at any point during the calibration process, the service sends back an error message on this channel and disconnects.

Sessions automatically timeout after 10 seconds without communication.

matrix (duplex)

Used to fetch the results of previous successful calibrations. Example accepted message:

Request 0A7B3C4D

Whenever a valid calibration token is received on this channel, it will send back the token, followed by a 14-element list of floating-point numbers. The first 9 elements constitute the display-to-camera calibration matrix, in row-major order. The 10th element is the mean error, in display pixels, reported during the calibration process. The last 2 elements are the width and height of the calibrated display area (in display dimensions). Example:

``Matrix``  0A7B3C4D  1 0 0 0 1 0 0 0 1  0.287  0 0 1024 768

Previous calibration results persist a long as the service exists.

grabber (input)
Should be connected to the "once" channel of a GML Frame Grabber service. It is used to fetch a frame before and after the client displays a calibration grid.

Public Member Functions

constructor args

destructor