New features of version 3.70 (August 24, 2002)
The command PREGISTER is improved (planetary images registration): more precision and full original format image after registration.
Bug corrected into the Frame command, and add of a grid option:
" TTools" are command sets which simplify and accelerate the tricolor images processing. This set is very productive in particular when one works with images resulting from Webcam camera (AVI films).
All the interest of the TTOOLS commands comes from the simultaneous processing of the three color planes. These commands relates to traditional functions in image processing (addition, subtraction, division, normalization, ...), and are very useful for the preprocess and for create master calibration frames (offset, dark, flatfield).
The processing relate to three sequences of images having obligatorily for name " R", "G" and " B", respectively for the plans red, green and blue. On the disc you must thus have series of images such as:
R1, R2..., R10,... Rn
G1, G2..., G10..., Gn
B1, B2..., B10..., Bn
where n is the numbers of images in the sequences.
With Webcam AVI, the production of these series is natural at the time of conversion of AVI file into PIC or FITS format images. From the File menu call the dialogue box AVI Conversion..., then for example:
Let us suppose that you want to add the images of the three colors plans and that the sequence contains 127 images. OK, run from the console the command:
T_ADD TR TG TB 127
Iris calculates:
Same manner you can calculate the median sum of the three colors plans while making:
T_SMEDIAN2 R G B 127
This time you produce on the disc 3 images having the names (if you work in FITS format): R.FIT, G.FIT, B.FIT. Command T_SMEDIAN2 is the equivalent of command SMEDIAN2 for the median sum of only one sequence images.
In the same family of function you can simultaneous stack the images by using command T_COMPOSIT (equivalent of COMPOSIT for one plane). See below the reference manual for details.
The T_TOOLS contain also functions which utilize operations with two images. It is the case for example of T_SUB. The syntax is:
T_SUB [R] [G] [B] [NUMBER]
This command which subtract respectively from the sequences R1... Rn, G1... Gn, B1... Bn the images [R], [G] and [ B ]. For example:
T_SUB darkr darkg darkb 127
Warning! The result is three sequences which replace the sequences R1... Rn, G1... Gn, B1... Bn. The original images are thus lost. Command T_COPY however makes it possible to carry out a backup of the three sequences before a processing if you are not sur of the result. Syntax is:
T_COPY [in R] [in G] [in B] [out R] [out G] [out B] [NUMBER]
For example:
T_COPY R G B RR GG BB 127
duplicate the original sequences R1... Rn, G1... Gn, B1... Bn in sequences RR1... RRn, GG1... GGn, BB1... BBn.
You can then restore the original sequence:
T_COPY RR GG BB R G B 127
A function as T_SUB is very practical to subtract the offset signal (or bias siganl) or the dark signal of raw sequences. In the same spirit, command T_DIV makes it possible for example to divide the 3 colors plans by 3 flatfield acquired in the corresponding colors. The equivalent commands for only one plan are SUB2 and DIV2.
Some TTOOLS operations utilize constant values. Thus the command:
T_OFFSET [offset R] [offset G] [offset B] [NUMBER]
add at the sequences R1... Rn, G1... Gn, B1... Bn respectively the constants [offset R], [offset G], [offset B]. Just like with T_SUB or T_DIV the starting series are replaced by the result.
One finds also the equivalents of the normalization commands NGAIN2 and NOFFSET2 under names T_NGAIN and T_NOFFSET. For example T_NGAIN command is significant to harmonize the levels of flatfield images before carrying out a median sum. One will make for example:
T_NGAIN 1000 127
T_SMEDIAN2 FR FG FB 127
The first instruction brings the median level of all the images of the red, green and blue plans on level 1000. The second instruction produces three master flatfield for the three colors (images FR, FG and FB).
TTOOLS concern also the image registrations. For example:
T_PREGISTER 256 127
carry out the registration of the three sequence R1... R127, G1... G127, B1... B127 by using a method the crosscorrelation in Fourier space. The FFT is made on an subimage of 256x256 pixels for the example (first parameters). Just like with the command PREGISTER, you must select with the mouse a zone in which will be made calculation. In fact, T_PREGISTER calculates the shift of the images only for the green plan and applies these shifts in the same way to the red and green plan.
You have at your disposal in the same family of command: T_CREGISTER (equivalent with CREGISTER), T_REGISTER (equivalent with REGISTER, the ideal for the stellar images), T_PREREGISTER.
Command T_SELECT (without argument) sorts simultaneously the sequences R1... Rn, G1... Gn, B1... Bn of the image from the most resolved to the least solved after the application of command BESTOF.
Commands COMPUTE_TRICHRO1 and COMPUTE_TRICHRO2 introduced with version 3.54 of Iris remain well applicable in parallels to TTOOLS.
With final you can display the tricolor image and back up it by the usual means:
TR TR TG TB (or TRICHRO TR TG TB)
SAVEBMP RESULT (24bits
file)
Here the complete list of the TTOOLS commands:
T_ADD [R] [G] [B] [NUMBER]
Addition of the images of each color planes
(equivalent ADD2). Operation carried out:
(R1+R2+..+.Rn, G1+g2+... +Gn, B1+b2+... +Bn)  > [R], [G], [B]
T_ADD_NORM [R] [G] [B] [NUMBER]
Even operation that T_ADD but
standardizes the images on level 32000 with the need if this level is exceeded
(equivalent ADD_NORM).
T_COMPOSIT [R] [G] [B] [SIGMA] [NB ITER] [FLAG MAX] [NUMBER]
Produce three images [R] [G] and [B] by making an optimal
addition of the images of the sequences R1... Rn, G1... Gn, B1... Bn (equivalent
COMPOSIT). The procedure is iterative if [NB ITER] is higher than 1. The
threshold of rejection of the bad values is adjusted by the variable [ SIGMA ]
(typical real value between 2 and 3). Level 32000 after addition is not exceeded
if FLAG MAX = 1 (a normalization of the intensities is done). Limited to 19
input frames.
T_COPY [in R] [in G] [in B] [out R] [out V] [out B] [NUMBER]
Duplicate a trichromatic sequence. Carry out the operation:
(in R1... in Rn, G1... in Gn, B1... in Bn)  > (out R1... in Rn, out G1... out Gn, out B1... out Bn)
T_CREGISTER [THRESHOLD] [NUMBER]
Registration of planetary images by
adjusting a circle on level [THRESHOLD] around planet limb (equivalent to CREGISTER).
T_DIV [R] [G] [B] [NUMBER]
Divide the sequences R1... Rn, G1...
Gn, B1... Bn by the images [ R ], [ V ] and [ B ] (equivalent has DIV, but the
parameters of standardization is calculated automatically in T_DIV). Carry out
the operation:
(R1/[R]... Rn/[R], G1/[G]... Gn/[G], B1/[b]... Bn/[B])  > (R1... Rn, G1... Gn, B1... Bn)
T_NGAIN [NORM] [ NUMBER]
Multiply each images of the 3 sequences
by a constant calculated by Iris in manner what the median level of each image is equal
to [NORME] (equivalent with NGAIN2). This command is in particular used for
stack flatfield images before median composite.
T_NOFFSET [NORM] [NUMBER]
Add (or subtract) to each images of
the three sequences a constant calculated by Iris in manner what the median
level of each
image is equal to [STANDARD] (equivalent NOFFSET2). Useful to bring at the same
the
level the sky background on deepsky images.
T_MULT [coef R] [coef G] [coef B] [NUMBER]
Multiply each image
of the sequences R1... Rn, G1... Gn, B1... Bn by constants (equivalent with
MULT2). Carry out the operation:
(R1*[coef R]... Rn*[coef R ], G1*[coef G]... Gn*[coef G ], B1*[coef B]... Bn*[coef B ])  > (R1... RN, G1... Gn, B1... Bn)
T_OFFSET [offset R] [offset G] [offset B] [NUMBER]
Add a
constant to each images of the sequences R1... Rn, G1... Gn, B1... Bn (equivalent with OFFSET2). The constants can have negative values.
Carry out the operation:
(R1+[offset R]... +.Rn+[offset R ], G1+[offset G]+... +Gn+[offset G ], B1+[offset B]+... +Bn+[offset B ])  > (R1... RN, G1... Gn, B1... Bn)
T_PREGISTER [SIZE] [NUMBER]
Equivalent with PREGISTER for
the registration of the planetary images. Registration is calculated on the
sequence G1... Gn then is the parameters of translation are applied to the
sequences R1... Rn, B1... Bn. It is thus supposed that it is the green component
of the threecolour process which presents the best details and contrasts.
T_PREREGISTER [NUMBER]
Equivalent with command PREREGISTER.
T_REGISTER [NUMBER]
Equivalent with command REGISTER. Ideal for the
deepsky
images (uses the position of a reference star to be selected
in the first images of one of the series, image G1.FIT for example).
T_SELECT
Simultaneous sort by decreasing quality the images in
the red, green and blue planes (equivalent to SELECT). It is necessary to have
run before command BESTOF on one of the components trichromatic
(the green one for example).
T_SMEDIAN [R] [G] [B] [NUMBER]
Median stack
of the
sequences R1... Rn, G1... Gn, B1... Bn by producing the images [R] [G] and [B]
(equivalent with SMEDIAN). Algorithm fast but limited to 19
images.
T_SMEDIAN2 [R] [G] [B] [NUMBER]
Even function that T_SMEDIAN,
slightly slower but the number of images is unlimited (equivalent to
SMEDIAN2).
T_SUB [R] [G] [B] [NUMBER]
Subtract
the images [R], [G]
and [B] to the sequences R1... Rn, G1... Gn, B1... Bn
(equivalent with SUB2 or SOUST2). Carry out the operation:
(R1[R]... Rn[R ], G1+[G]... Gn+[G ], B1+[B]... Bn+[B ])  > (R1... Rn, G1... Gn, B1... Bn)
T_UNSHARP [SIGMA] [COEF] [FLAG] [NUMBER]
Calculate the unsharp
masking of each images of the three sequences (equivalent with UNSHARP2).
For applications examples of TTOOLS click here.
Command PREREGISTER
Command
for fast registering of a sequence image. The algorithm is fast (special cross
correlation in the spatial domain) but less precise compared to
REGISTER, PREGISTER,
or CREGISTER for example (PREREGISTER use a registration at the nearest pixel for minimal degradation of image
quality) . PREREGISTER is used as a first step registration for difficult
case (if traditional registration command are not applicable  situation
of large deregistration for example). Applied command like REGISTER or COREGISTER
for
a second pass (registration at a pixel fraction).
Syntax:
PREREGISTER [IN] [OUT] [NUMBER]
[IN]
generic name of the input sequence
[OUT] generic name of the output sequence
[NUMBER]
image number
Before run PREREGISTER select with the mouse a rectangle
around a contrasted details. For important deregistration do not hesitate to
select the whole image.
Command L_CORREL
Compute
the shift in pixel unit along the xaxis of the inmemory spectrum and the [name]
file spectrum.
The syntaxe is : L_CORREL [NAME]
Before running L_CORREL define with the mouse a rectangle for the crosscorrelation computation.
Command L_MERGE
Syntax: L_MERGE [FILE #1] [FILE #2] [x1] [x2]
Merge two spectra [FILE #1] and [FILE #2]. The point of at the coordinate [X1] (pixels unit) into the spectrum #1 correspond to the point [X2] into the spectrum #2. The intensity are normalized at around this point. Click here for an example.
Command L_MERGE2
Same as L_MERGE. The only difference: the spectra are not normalized at the common point.
Commands DISTOR & DISTOR2
Morphing is not just a special effect for artistic applications. Morphing techniques have various ranging from lens distortion correction, motion capture data interpolation, waves atmospheric turbulence correction, etc. This section describe the turbulence correction of planetary image (but the procedure is the same for correct optically distorted widefield CCD images for examples).
The goal of the processing is to resample a target image relative to a reference image for minimize geometrical difference between the two. So, the blurring effect of the turbulence in the Earth's atmosphere is now partially compensated: If you stack the two images (or more), the spatial resolution is increased.
The atmospheric distortion was calculated using DISTOR command.
The syntax is:
DISTOR [NAME1] [NAME2] [ORDER]
[NAME1] is the name of a good contrasted reference image
on the disk.
[NAME2] is the name to resample relative to the reference image.
[ORDER] is the order of a 2D quadratic equation used for fit the distortion.
Range is between 1 (linear correction) and 5 (complex distortion). The recommended
value is 3 or 4 for most the case. DISTOR use an iterative scheme for aberrant points elimination.
Before running the DISTOR command it is necessary to define point interactively with mouse in the reference image. If possible, this point mark contrasted detaisl (light/shadow region on the moon surface, planetary limb, stars, ...). The geomtric correction is only valid into the pointing area (outside this area Iris extrapolate).
STEP 1
First, one should necessary to register the image
at a pixel precision (it is a mean registration  remember the turbulence effect
of the atmosphere). You can use for this command PREGISTER, CREGISTER
(planetary applications) or REGISTER , REGISTER2, COREGISTER, ... (deepsky applications).
For the Moon processing examples (sequence of 72 webcam frames MOON1... MOON72, Celestron 8 telescope) we select a contrasted area with mouse, then:
PREGISTER MOON I 256 72
STEP 2
Select reference points into the reference image (MOON1 images for the example).
This point serve to create the transform model between reference and processed
image. The procedure fit polynomial equations using least squares criteria to
model distortion.
For points selection activate the option Select Objects of the Analysis menu.
For an optimal result it is necessary to select contrasted feature in the reference image:
Up to 100 points can be defined (more point = time consuming for the calculation). Try to distribute uniformly this points on the surface image.
If you like you can now deselect the Select Objets option of the Analysis menu.
STEP 3
Compute the polynomial equations and produce the corrected image.
The polynomial transform is a 1st to 5th order polynomial ([ORDER] parameter
of the DISTOR command).
Example:
DISTOR I1 I9 4
The image I9 is now registered relative to the I1 image. The result can now be saved on the disk:
SAVE R9
For check try some find like:
LOAD I1
SUB R9 5000
VISU 5100 4900
Normally
the difference is very near the 5000 level.
It is possible to process all the sequence images in one step by the use of the DISTOR2 command:
DISTOR2 [NOM1] [NOM2] [ORDER] [NUMBER]
The [NUMBER] parameters is the number of images in the sequence. Example:
DISTOR2 MOON R 4 72
The reference image is MOON1. The R1...R72 are now registered.
You can stop the processing by clicking the red button of the tool bar.
STEP4
You can add the registered images:
ADD_NORM R 72
or select the best ten resolved images before:
BESTOF R 72
SELECT R T
ADD_NORM T 10
Above: Left, stack of very bad aligned images. Right, stack of the same images after DISTOR.
Click here for a dynamic application of DISTOR command.

