ACOP Video

Description

AcopVideo is a an AcopBean which can display a video image. This bean implements ConnectionParametersReceiver. Upon setting the ConnectionParameters and after the start method is invoked a link to a remote property will be established and image data provided by the link will be drawn on the canvas.

Code examples

The following lines show an example how to use the features of the AcopVideo.

Connection to a remote property

AcopVideo is a single value displayer and can be connected to one remote connection point. The following code demonstrates how we can connect the AcopVideo bean to such point.

First we will create an instance of the bean

AcopVideo video = new AcopVideo();

To connect to a remote property we require ConnectionParameters, which describe the remote property

ConnectionParameters parameters = new ConnectionParameters("TINE", "context", "server", "device", "property", AccessMode.POLL, 1000);

These parameters describe a remote property 'context/server/device/property' in the TINE control system that delivers either a VSv2 video image blob or a VSv3 CF_IMAGE type back. Below are several example for the ConnectionParameters.

Examples for VSv2:

(1) scheduled transfer

context = "PITZ"
server = "ZNPPITZFG1F"
device = "device_0"
property = "FRAME.GET"
AccessMode = AccessMode.POLL
AccessRate = 1000 ms
usually general context of facility
usually server dns name in upper case plus "F"
always "device_0" for VSv2
scheduled property
constant monitoring
contract refresh time on scheduling
Note: This is a scheduled transfer mode, so any image should be seen even if the
      images are send out with a faster rate than the accessrate is. It is 
      the recommended mode for live viewing.

(2) nonscheduled transfer

context = "PITZ"
server = "ZNPPITZFG1F"
device = "device_0"
property = "NONSCHED.GET"
AccessMode = AccessMode.POLL
AccessRate = 1000 ms
usually general context of facility
usually server dns name in upper case plus "F"
always "device_0" for VSv2
current video image-property
constant monitoring
update data every second
Note: This is a NONscheduled transfer mode, so the maximum image update rate is
      one frame per second according to the AccessRate.

Examples for VSv3:

(1) scheduled transfer

context = "PITZ"
server = "SGP_PRSGE1"
device = "Output"
property = "Frame.Sched"
AccessMode = AccessMode.POLL
AccessRate = 1000 ms
usually general context of facility
TINE server name
usually "Output" is used for general output
scheduled property
constant monitoring
contract refresh time on scheduling
Note: This is a scheduled transfer mode, so any image should be seen even if the
      images are send out with a faster rate than the accessrate is. It is 
      the recommended mode for live viewing.

(2) nonscheduled transfer

context = "PITZ"
server = "SGP_PRSGR1"
device = "Output"
property = "Frame"
AccessMode = AccessMode.POLL
AccessRate = 1000 ms
usually general context of facility
TINE server name
usually "Output" is used for general output
current video image-property (non-scheduled)
constant monitoring
update data every second
Note: These parameters will use a NONscheduled transfer mode, so the maximum 
      image update rate is one frame per second according to the AccessRate.

Parameters are then attached to the Video bean.

try {
        video.setConnectionParameters(parameters);
} catch (CommonException e) {
        e.printStackTrace();
} catch (PropertyVetoException e) {
        e.printStackTrace();
}

Due to heavy-duty task the connection is not established automatically. Instead the user has to invoke the start method to establish a connection and start image rendering

video.start();

If no exception occurred, video bean should now show images from remote peer.

Visual properties

Other properties of the video bean can also simply be adjusted by calling the appropriate setter methods. Let's say that we want to display image metaproperties (connection data, width, height, ...) as overlay (like an on-screen-display). In this case one has to enable the overlay

video.setOverlayState(OverlayState.ON);

We can also change the color map of the image. There are several different type we can choose from: ColorMap.GRAYSCALE - basic linear gray scaling like B/W TV ColorMap.JET - MATLAB jet false colour ColorMap.PITZ - a False colour table invented at PITZ 1

video.setColorMap(ColorMap.JET);

Similarly we can enable AOIZoom of the image

video.setAOIZoom(true);

We can also activate histogram equalisation (aka normalisation, aka contrast enhancement) of the image. This can increase recognizability by eye significantly.

video.setHistogramEqualisation(true);

The window which displays the video might not have the same aspect ration as the image. Therfore the image will be stretched when drawn on the canvas. We can define the property which will force the video to keep the original aspect ratio of the image.

video.setKeepAspectRatio(true);

On special event or shutdown, one may want to stop the active transfer (which was activated earlier by start() method)

video.stop();

The currently visible image can also be saved to colour png file. Additional image metainformation are saved as a text file (dump of image header) Any image enhancement option (like false colour mode, normalisation) will be seen also in the png file (WYSIWYYG)

video.saveAsPNGImage("test.png");

Complete source code for examples

See the complete source code used in this examples.