httpcam.exe A camera server accessible by browser and/or ImageJ

httpcam.exe is in BIJ, the Bio-medical Imaging in Java site.
Version 1.0.


Description

httpcam.exe is a simple camera HTTP server. Currently only PVCAM (Roper Scientific) cameras can be controlled. It allows a Windows PC that is controlling a camera to be accessed over HTTP. Essentially you can use any browser to control the camera on the same or a different PC anyhwere on the network.

This is a very simple initial implementation. After starting, a viewer is opened that show the current CCD scene at the current exposuretime. pseudocolor allows you to view the grayscale image in pseudocolor, autoscaling turns on and off autoscaling of the viewer image (not the acquired image, which is never autoscaled!).

The camera is controlled using HTTP GET, and XML formatted commands. You can use a HTML FORM and put the required entries in there. You can simply edit the URL the browser is pointing to. If the camera server is running locally, you would point your browser at:

http://localhost:8080/?exposuretime=200&frames=10&directory=e:\&start

to set the exposure time to 200ms, and then to acquire 10 frames into directory e:.

Using ImageJ to access the server

You can now also use HTTP in bij.jar to control the camera, it does exactly the same thing.

Acquired sequences

Currently the name of the acquisition file is 'httpcam<date_time>.raw'. The widthxheight of this file depends on your PVCAM camera and binning setting, but is always 16-bit unsigned big-endian, and is the pixel data as obtained directly from the CCD in row-column format. So it is easily readable in ImageJ by doing Import -> Raw and setting these options.

The following parameters are supported:

exposuretime=n sets exposure time in ms
frames=n set the number of frames to be acquired
start=1 starts acquisition
stop=1 interrupts acquisition
binning=n sets the x and y binning to the required size.
directory=name where name is the directory where the image sequence will be saved. n=o sets parameter n (value derived from the PVCAM documentation) to value o.
info='<xml string> 'where xml string is an XML formatted string that is copied fully into the .xml settings file (see below).

After an acquisition, the image sequence is saved as a .raw file, 16-bit normal byte order, in row-column format. Also saved is an XML file with the extension .xml but the same name, that contains camera settings, camera status and the info string.

See pvcam.h that came with your camera for the values of any parameter.

By default the camera starts in frame transfer mode with the shutter open, and currently this can only be modified through setting another mode by hand.
It continuously clears the CCD if not acquiring images. After closing the server, the shutter also closes.

To do:

         Write better interface in ImageJ

         Allow to respond with an image instead of a webpage for 'frame' command for example

         Maybe allow to respond with ImageJ image sequence for acquisitions

         Allow parameters to be set in XML instead of with GET (I do not like programming in C)

If there is great interest, I may be willing to do this. For now, this server is released the way I use it.

Sources are available by request.

Michael Abramoff, University of Iowa, 2005


Last updated 2005/6/30.