Video/Graphics Workstation
OVERVIEW
The bass.open.dal.ca video workstation is a SUN
SPARCstation 1+ equipped with a 24-bit graphics display board from
IMS. It operates SunOS 4.1.3 and OpenWindows 3.2
(a.k.a. Solaris 1.1) with an X11R5 server supplied by IMS.
This video workstation and its software is capable of the following
image/video processing tasks:
This video workstation is also equipped with a local hard disk drive for
storing data to be used on this workstation, mounted on /data.
Commands described in this text are stored in /export/bin.
Before using any of the commands outlined in this document, it is suggested
that your PATH is altered to include /export/bin using the
following:
bass$ export PATH = /export/bin:$PATH
24-BIT GRAPHICS DISPLAY
What is it?
The IMS 1000/1001 video boards are used to display and
compress 24-bit (or "True Color") images. What this means is that the number
of colors used to display images is about 16.7 million colors,
which results in a better looking display of 24-bit images. Standard
8-bit ( or "Pseudo Color") displays rely on color palettes that limit
the number of colors
displayed. This basically means that images look more realistic when
displayed on bass.open.dal.ca.
How is it different?
This workstation uses a unique X-server (supplied by IMS), and therefore
some software might not work as expected. Some programs might require you
to tell it that you are working with a 24-bit display, such as
mpeg_play. To use it, type:
mpeg_play -dither color filename.mpg
Other programs may also require you to set options either on the command line
or in a configuration file.
VIDEO INPUT
The Hardware
The IMS 1000 is used to input live video into the computer. This board is
located at the far right of the workstation base (when looking at it
from behind).
It has 3 video ports numbered left to right, which you
can use to plug in video sources. All of these ports are of an s-video type.
You can also use composite video (from a normal VCR or camera) by using a
custom made RCA to s-video cable.
Simply plug the RCA end into the video out of your video
source, and the other end into the IMS 1000 board (port 1,
if unoccupied) on the computer. If you are using S-VHS equipment, then
plug either end of and s-video cable (4 pins and slightly crimped) into
port 1 of the IMS board, and the other end into the
video out of your video source (VCR or camera).
DISPLAYING VIDEO
To start, type init in an xterm window. This initializes the video hardware.
You should soon see a window pop
up. This is the Live Video window. This window is the display for data that
comes in and goes out of the IMS hardware (see
Displaying Images). Click the left mouse button twice inside this window to get
the controls window (seen below).
Next, click on the VTR button in the bottom left
corner. Then click on the appropriate Format button (ntsc-composite
for normal video sources like video cameras or normal VCR's, or ntsc-svideo
for S-VHS VCR's).
The source can be from any of three video input ports, depending upon what video sources
you have plugged into the back. ExpBus is the expansion bus, which
shows you what is coming out of the IMS1001 board (see
Displaying Images). Normally port 1 is used, but it doesn't
really matter, as long as you have the appropriate one selected from the
Source menu (on the left of the controls window).
The size of the window can be changed by either grabbing the corner of the
window and pulling it in the usual way, or by using the buttons located near
the top of the contols window. It is recommeded that you use the buttons
to keep the correct aspect
ratio. For the best display, use Full Size because
Largest or Max Size distorts the picture.
The Pixel Offset and Row Offset move the image up/down and
left/right in the Live Video window only, not the output to the
VCR or monitor.
Other video contols are located at the right of the window for fine tuning
the picture. These are Gain, Hue, and Bias. You
can experiment with these for the best looking picture for you, but
default values will usually look fine.
SINGLE FRAME CAPTURE
This will capture a single still image of whatever is being displayed in the
Live Video window (see Displaying Video).
Type the following commands:
init (see Displaying Video for explaination)
getstill filename (.cjp will be added automatically)
The image is now saved as filename.cjp, and can be viewed using
showstill. (see Displaying Still Images).
MULTIPLE FRAME CAPTURE
This will capture a sequence of images of whatever is being displayed in the
Live Video window (see Displaying Video).
Type the following commands:
init (see Displaying Video for explaination)
getmovie numframes Qfactor filename (.sjp will be added automatically)
where
-numframes is the number of frames you want to capture.
-Qfactor is the compression factor (smaller means better resolution,
while larger means more frames per second).
A file showing the times of the captures will also be written to disk as a file named
capture_times (thanks to Dan Kelley).
To play back this file, use showmovie
(see Displaying Animations).
DISPLAYING IMAGES
When displaying any image or series of images, you must have the ExpBus
selected as the Source on the Live Video
window in order to see what is being outputted. Also, refer to
Displaying Video for instructions on setting
up the necessary video parameters.
Displaying Still Images
To display a still image (.cjp) on the monitor or in the Live Video
window, you must first input that image into the framebuffer. This can be
done by using the showstill command.
showstill filename.cjp
If you instead want to view the image directly on the screen using a standard
image viewer, you must convert the .cjp file to a .jpg file (see converting images).
Displaying Animations
Animations in the IMS format (.sjp) can be viewed using
showmovie.
To display .sjp files, type:
showmovie filename.sjp [delay_time]
delay_time (time between frames) defaults to zero, but the
playback can be slowed down by specifying a number of milliseconds
between 0 and 1000.
VIDEO OUTPUT
Hardware
The ims 1001 board uses a framebuffer and a JPEG compression routine to
output images to the VCR or monitor.
Setup
The IMS 1001 board is located at the far left
(when looking from the back of the computer).
It has 2 ports. The one on
the left is for composite video (VCR or monitor) and the one to its right
is for s-video (S-VHS VCR's). To use the composite video port, you must
use the supplied rca to S-VHS cable (shouldn't be far from the workstation).
Output to VCR or Other Devices
Anything that is inputed to the framebuffer by using showstill or showmovie
(see Displaying Images
will be immediately outputed through these 2 ports. this means that anything
you can see in the Live Video window will go to a
VCR or other device, assuming correct connection (see Setup).
Advise on Creating Images
Images created on the computer will not look as good when put on
video. This is because videotape does not have the same resolution (sharpness)
as computer monitors. This means that care must be taken when creating the
images in the first place.
Some things you can do to improve output are:
- make objects within your image as large as possible (within 640x480 pixels)
- leave a border around your image so that it doesn't get cut off at the
edges (35 pixels from each side, 45 pixels from the top, 20 pixels from
the bottom)
- use large and thick typefaces for words
- use yellow or white lettering on dark backgrounds
- use dark blue or black on light backgrounds
- outline letters in colors that contrast the background (black background,
blue typeface outlined in white)
- use contrasting colors to make things distinct
- use colors that aren't extremely bright (such as the brightest red, white,
or yellow)
- check to see that colors translate to video properly (usually they don't)
- don't try to put too much information in a small area
- use thick lines (at least 2 pixels wide) instead of thin ones
- outputting to S-VHS looks much better than normal VHS, although you can
use normal VHS tapes in an S-VHS machine, you cannot put S-VHS tapes in
normal VHS machines
CONVERTING IMAGES
Images can be converted using NetPBM, or by using
ImageMagick's convert program. Also, for converting
to/from IMS format, the
ppmtoims and
imstoppm programs are used.
NetPBM is a set of programs of the form ppmto??? or ???toppm.
ImageMagick's convert
program uses many of the existing programs such as
NetPBM, ghostscript, but has an easier command line
structure that allows converting in one step.
IMS format conversions
.ppm -> .cjp
To convert from .ppm to IMS format(.cjp),
do the following:
init (see Displaying Video for explaination)
ppmtoims filename.ppm
getstill filename (.cjp will be added automatically)
.cjp -> .sjp
To convert a series of single frame images into a single movie-type file,
use the following:
cjp2sjp starting_frame ending_frame filename_prefix.sjp [output_filename]
The starting and ending frames should both have 4 digits (use leading zero's).
The filename_prefix is the path and beginning part of the names of all of the
files. The default output_filename is outfile.sjp.
Here is an example:
cjp2sjp 0001 0100 /data/frame /data/movie
will concat files from frame0001.cjp through frame0100.cjp into /data/movie.sjp.
.sjp -> .cjp
To convert a movie-type file (.sjp) into a series of single images files (.cjp),
use the following:
sjp2cjp filename.sjp [frame]
Frame is optional, and the default is 1. By specifing a number other
than 1, only every nth frame will be written.
The filenames of the single frame images will be saved as filenameframe_number.cjp
.cjp -> .ppm
The imstoppm program is what you need to convert the images. This program uses
the internal image buffer to convert the image. An example of
how to use this program to save images in PPM format is as follows:
init (see Displaying Video for explaination)
showstill filename (.cjp will be added automatically)
imstoppm filename.jpg (to save the file in PPM format)
Other Notes
Some colors in the original image may not turn out to be the
correct colors when put to video. You generally have to experiment with your
images colors to get the desired ones.
Another problem with colors being different may be caused by different color
maps on different X-windows sessions. This can be corrected by converting the original
images to a more general format on the same machine which they were originally
created. this is because of a problem with the xwd
program.
Image Manipulation Systems (IMS)
17595 Partridge Street Northwest
Andover, MN 55304-1456
techsup@imageman.com
techq@imageman.com
(612) 753-5602
I have been in contact with Larry Lindy from IMS about the IMS 1000/1001 boards, and he
tells me that they no longer support them. The above e-mail addresses are
valid, but any reply has yet to be received. Their phone and fax support may
prove to be different. (Doubtful)
I have been told by Dennis Dingeldein (see Other Users) that someone at IMS named Chris Meier has hacked most of the
software. You should probably ask for Chris if you have software problems.
They don't really supply software, more like example programs that give
you pointers on how to write your own programs, so don't expect any major
program advancements.
NOTE: The support software (X11R5 server and sample programs)
only work under SunOS4.1.x and OpenWindows 3.x (a.k.a. Solorais 1), and
therefore the video workstation (bass.open.dal.ca) will not be
upgraded to Solaris 2.x.
OTHER USERS
After requesting information about the IMS boards
on the net in comp.graphics, I
received only one response. It was from Dennis
Dingeldein of ZGDV
Computer Graphics Center in Germany.
He is currently working on a multimedia project called Theseus++, which uses
the IMS 1000/1001 boards. Theseus++ is freely distibutable but since
it requires Motif libraries it will not be installed on this
workstaion (bass.open.dal.ca).
Dennis Dingeldein
dingelde@igd.fhg.de
ZGDV Computer Graphics Center
Wilhelminenstr. 7
D-64283 Darmstadt, Germany
Phone: +49/6151/155-112
Fax: +49/6151/155-450
He has generously supplied the programs jf2cc and
cc2jf, which convert between JPEG
and IMS format.
IMAGEMAGICK
This is an image processing package ftp'd from ftp.x.org in
/contrib. It will display, convert, animate, scale, rotate, color
reduce, and many other functions. It may be useful when processing images
to output to video.
These commands are located in the /export/bin directory, and
documentation about ImageMagick is available in the /export/docs directory,
as well as the /export/man directory.
APPENDIX I, Command Summary
Instructions on how to use these commands can be found in the /export/man directory, or by clicking on
the appropriate one here.
- init initializes the video hardware.
- getstill record single image in framebuffer to disk.
- showstill put single image from disk into framebuffer.
- getmovie record series of images and stores it to disk as a single file.
- showmovie playback series of images from disk recorded with jpshrec.
- cjpeg compress pnm files into jpeg.
- djpeg decompress jpeg files into pnm or gif.
- ppmtoims put a PPM file into framebuffer.
- imstoppm take image in framebuffer and output to a PPM file.
- convert program
that converts just about any standard file format to another (except
IMS .cjp format) This program is from the ImageMagick package
- sjp2cjp will convert IMS movie files (.sjp) to IMS still images (.cjp)
- cjp2sjp will convert a series of IMS still images (.cjp) to an IMS movie (.sjp)
- display display
almost any standard file format to the computer screen (except IMS
.cjp format). This program is from the ImageMagick package
- maketitle will
make a .ppm title screen from a text file
- changenamecjp
will change the number of digits in a .cjp file from three to
four. It will also add a number to the filename number (if specified)
APPENDIX II, Examples
Converting gmeta frames
This is an example of how to convert a gmeta file into a movie.
bass$ med gmeta
gmeta with 500 frames
med> split 500
split into 500 separate frames
med> quit
bass$ init
script to initialize IMS hardware
bass$ for file in med*.cgm
> do
> gplot -dPSC $file temp.ps
convert from .cgm into postscript
> convert temp.ps temp.ppm
convert from postscipt into .ppm format
> pnmcut 18 190 558 425 temp.ppm > temp2.ppm
truncate unneeded sides and top / bottom
Different for every image
> pnmpad -black -l21 -r61 -t38 -b17 temp2.ppm > temp3.ppm
add borders to sides and top to make images 640x480
Different for every image
> ppmtoims temp3.ppm
put image from .ppm to IMS framebuffer
> getstill `basename $file .cgm`
save image in framebuffer to .cjp IMS format (must be on bass.open.dal.ca)
> changenamecjp `basename $file .cgm`.cjp
this will output the number in the filename with 4 digits instead of 3
necessary because most animations will have more than 1000 frames
> done
At this point all of the files are in .cjp format, and all that needs to
be done is to combine all of them into a single movie.
bass$ cjp2sjp 0001 0500 med my_movie
Which will save all of the frames into one movie file called "my_movie.sjp"
that can be played using "showmovie my_movie"
MATLAB animation
This is an example of how to convert a MATLAB animation into a movie.
When starting MATLAB, invert the video for output to the screen by typing:
>> set(gcf,'inverthardcopy','off')
Then to save the current image.
>> print -dpsc frame.ps
,save a series of frames from within a loop.
>> for i = 1:10
plot ....
eval(['print -dpsc frame',int2str(i)])
end
Then convert those frames into a movie.
bass$ init
script to initialize IMS hardware
bass$ for file in frame*.ps
> do
> convert $file temp.ppm
convert from postscipt into .ppm format
> pnmcut 18 190 558 425 temp.ppm > temp2.ppm
truncate unneeded sides and top / bottom
Different for every image
> pnmpad -black -l21 -r61 -t38 -b17 temp2.ppm > temp3.ppm
add borders to sides and top to make images 640x480.
Different for every image
> ppmtoims temp3.ppm
put image from .ppm to IMS framebuffer
> getstill `basename $file .ps`
save image in framebuffer to .cjp IMS format (must be on bass.open.dal.ca)
> changenamecjp `basename $file .ps`.cjp
this will output the number in the filename with 4 digits instead of 3
necessary because most animations will have more than 1000 frames
> done
At this point all of the files are in .cjp format, and all that needs to
be done is to combine all of them into a single movie.
cjp2sjp 0001 0500 med my_movie
Which will save all of the frames into one movie file called "my_movie.sjp"
that can be played using "showmovie my_movie"
PPMtoIMS example of transparent colors
The ppmtoims program can be used very simply by just typing
the "ppmtoims filename.ppm" to put an image into the
framebuffer.
If you want to overlay titles, or images, on top an existing
images in the framebuffer, you can use the "-val rr gg bb" option to
mask out the background color.
First you need to put an image into the framebuffer. This
can be done using any image, for example the Dalhousie logo.
ppmtoims dal_logo.ppm
Then you need a suitable title image. One can be made using
the maketitle script
(see title making example).
Finally, to overlay the title type:
ppmtoims -val 0 0 255 title.ppm
( 0, 0, 255 means no red, no green, and 255 blue, which is the background
color used by maketitle)
Title Making
This is an example of how to use the maketitle program.
Create a text file of up to 10 lines with the desired text be want for the
title. For example, this file called title.txt:
Physical Oceanography
OPEN larval tracking cruise
Nov. to Dec. 1992
David Griffin
Keith Thompson
Dalhousie University
March 1994
Then use the maketitle script to convert this text file into a
PPM file.
maketitle title.txt
Now we have a PPM file with our title in yellow lettering with a blue
background, and every line centered.
Document by Luke Blaikie
blaikie@phys.ocean.dal.ca
April 1994, co-op workterm