iterm - the interactive tool for Prima::IPA library
iterm is a mostly command-line tool for basic image processing. It has terminal representation, where the main window is capable of viewing the image and accepting commands. The command syntax is pure perl, plus all functions available in the Prima::IPA library ( see Prima::IPA ) and Prima toolkit ( see Prima), and some specific iterm commands.
iterm defines several scalars for the user needs. The main window shows the content of the scalar $i, if it is an image. If the additional windows are opened, they correspond to images in array @i. The array @i is filled automatically, and the index is shown on the additional new window titles. The additional windows are stored in array @windows, under same indexes. The main window is stored in scalar $w.
The input line is used to enter perl code. If the code returns and newly created image, it is stored into $i, and the old value of $i is discarded. If the code returns more than on image, the additional windows opened automatically. If the code throws an exception, its first line is shown on the status line, and the whole message is printed to stderr.
To see pixel value under mouse cursor, hold the Shift key.
There are several interactive commands, present on the window menus.
The main and the additional windows have different sets of interactive commands.
Presents a file selection dialog, where the image file is to be selected and its content loaded into variable $i and displayed in the main window.
Opens a file save dialog, where the content of $i can be stored on disk.
Creates a new additional window and copies $i into it. The newly created image is stored into @i array, and the new window into @windows array. The indexes of these are equal and shown on the window's title.
Note: only for additional windows
Copies the content of the image into $i
Copies content of $i into the image.
These are commands, specific to iterm.
Assigns new variable $VAR to an empty image
Assigns IMAGE to $i and displays it.
Flushes the command history
Loads image FILE into $i and displays the image. FILE must be a quoted string.
Reverses image
Stretches image data to fit the whole range. For the histogram equalization see Prima::IPA::Point::equalize
Stores IMAGE object into FILE.
Exits iterm.
Selects zoom for window $w. There are no shortcuts for selecting zoom for the additional windows, but this can be achieved by entering the following code:
$windows[$NUM]-> Image-> zoom($SCALE)
Opens a new, empty additional window.
See Duplicate
Reverts $i to its last value
Declare lexical VARIABLE and assign VALUE to it.
To load an image:
load 'image.gif'
Convert to 8-bit grayscale:
$i-> type( im::Byte)
Perform dilation:
dilate $i
Copy to new window
dup
Erode the new image
erode $i[0]
Display the difference
subtract $i, $i[0]
Note: iterm never asks if the changed images are to be saved.
~/.iterm-list - the command history
Prima::IPA - the image processing library
Prima - perl graphic toolkit
Dmitry Karasik <dmitry@karasik.eu.org>
To install Prima::IPA, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Prima::IPA
CPAN shell
perl -MCPAN -e shell install Prima::IPA
For more information on module installation, please visit the detailed CPAN module installation guide.