Differences between revisions 17 and 33 (spanning 16 versions)
Revision 17 as of 2016-01-13 15:46:19
Size: 11203
Editor: DianeLambert
Comment:
Revision 33 as of 2016-01-14 10:40:40
Size: 9944
Editor: DianeLambert
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
'''Purpose:''' Utility program for registering (adding and aligning) new images to existing maplets. '''Purpose:''' Program for registering (adding and aligning) new images to existing maplets.

Register cross-correlates an image with existing data to update the knowledge of the spacecraft position/attitude. Register is limited to 2 degrees of freedom.

=== Requires ===
 * [[IMAGEFILES]]/ - a directory containing the image .DAT files
 * [[NOMINALS]]/ - a directory containing the image .NOM files (starting solution image, S/C and camera information)
 * [[SUMFILES]]/ - a directory containing the image .SUM files (updated solution image, S/C and camera information; lmrks and limbs)
 * [[MAPFILES]]/ - required for comparison with a reference map
 * [[SHAPEFILES]]/ - required for comparison with a shape model

=== Optional ===
 * [[make_scriptR.seed]] - for batch processing

=== Output ===
 * [[NOMINALS]]/ - If the user selects the option to update the NOMINAL file, starting S/C and camera information will be updated (an option not typically selected).
 * [[SUMFILES]]/ - S/C and camera information are updated as image shifts are made. The user can discard these changes upon quit. ??Detected landmarks and limbs are added to the SUMFILE??.
 * TEMPFILE.pgm - A side by side view of the image (left) and the reference (right).
 * TEMPFILE.ppm - A red/cyan composite of the two items (red is image, cyan is reference).
Line 7: Line 25:
''(The following section is taken from [[http://sbib.psi.edu/wiki_ext/refman.pdf|SPOC v3.02A PDF]]/LITHOSPHERE/REGISTER.f File Reference.)'' ''(The following section is taken from [[http://sbib.psi.edu/wiki_ext/refman.pdf|SPOC v3.02A PDF]]/LITHOSPHERE/REGISTER.f File Reference, rearranged for convenience.)''
Line 9: Line 27:
REGISTER provides an initial estimate for the spacecraft state (camera pointing and s/c-object vector) by aligning an image with a known object - either the shape model, a high resolution map or another (already registered) image. The user enters the image name and the object to align with: REGISTER provides an initial estimate for the spacecraft state (camera pointing and s/c-object vector) by aligning an image with a known object - either the shape model, a high resolution map or another (already registered) image.

=== Input stdin ===

{{{
 input 12-character picture name. q to quit.
}}}

The user enters the image name as stored in [[IMAGEFILES]]. Some versions of [[process_img]] will make some changes to the filename, so it may not be the "original" name.
Line 17: Line 43:
If i or m is chosen, you will be prompted for an image name or a map name. If '0' is chosen for the map name, the program will search a set of "Zmaps" for the one most likely to oderlap the image. Zmaps are labeled Z(N/S)#### where the first two numbers are the latitude center divided by 5 (00-18) and the second pair is east longitude divided by 5 (00-71). Thus ZS0837 is a map with a center at 40 degrees south and 185 degrees east. Maps are only used after a detailed shape model and high-resolution maps have been constructed. At that time we are registering new images for navigation or improving the topography. The user enters the object to align with.
Line 19: Line 45:
A final entry is the scale in km. The basi!!display for REGISTER is 600x600 pixels. If the body in question is, say 500 m across, then if the scale is chosen to be 5 m (.005) the image will be 100 pixels across in the display.  * s = shape - to use the current shape model
 * i = image - select an already registered image; user will be prompted for an image name.
 * m = map - use a maplet/bigmap; user will be prompted for a map name. If '''0''' is chosen for the map name, the program will search a set of "Zmaps" for the one most likely to overlap the image. Maps are only used after a detailed shape model and high-resolution maps have been constructed. At that time we are registering new images for navigation or improving the topography.
Line 21: Line 49:
The display and the arrays of image and reference data are not the actual imaging data, but that data projected on a "substrate". When we are just starting processing and looking at low-resolution images of the body, the substrate is simply a plane through the body center oriented parallel to the camera's focal plane. This flat 'f' substrate is the default value. Once a decent shape model is obtained and our images cover a small fraction of the body's surface, the substrate is taken to be that surface itself, either in the form !! of the shape 's' or a high-resolution map 'm'. In this case, the topography is represented as a DTM whose reference plane is the same !! as the flat substrate with heights in the negative camera bore sight direction. Note that if the reference is also an image, this data is projected on the same substrate as the image being registered. {{{
 enter scale (km/px)
}}}
Line 23: Line 53:
The main menu looks like: A final entry is the scale in km. The basic display for REGISTER is 600x600 pixels. If the body in question is, say 500 m across, then if the scale is chosen to be 5 m (.005) the image will be 100 pixels across in the display.
Line 25: Line 55:
'''Output'''

{{{
 gc TEMPFILE.pgm
 gc TEMPFILE.ppm
}}}

 * TEMPFILE.pgm - A side by side view of the new image (left) and the reference (right).
 * TEMPFILE.ppm - A red/cyan composite of the two items (new is red, cyan is reference).

Example TEMPFILE.pgm:

{{attachment:exTEMPFILEpgm.png}}

Example TEMPFILE.ppm:

{{attachment:exTEMPFILEppm.png}}

The display and the arrays of image and reference data are not the actual imaging data, but that data projected on a "substrate". When we are just starting processing and looking at low-resolution images of the body, the substrate is simply a plane through the body center oriented parallel to the camera's focal plane. This flat 'f' substrate is the default value. Once a decent shape model is obtained and our images cover a small fraction of the body's surface, the substrate is taken to be that surface itself, either in the form of the shape 's' or a high-resolution map 'm'. In this case, the topography is represented as a DTM whose reference plane is the same as the flat substrate with heights in the negative camera bore sight direction. Note that if the reference is also an image, this data is projected on the same substrate as the image being registered.

The '''main menu''' looks like:

{{{
Line 41: Line 94:
Options 1, 5 and 8 allow you to change the scale, reference object and substrate, respectively. }}}
Line 43: Line 96:
Options 3, 4 and 6 make changes to the .SUM file in camera pointing and/or cross line-of sight scobj, camera twist and s/!!range, respectively. The 3 option is the one most used. There is an autocorrelate that, if chosen, will estimate the offset between the image and the reference. If the correlation is less than a preset limit it will ask for a manual input. That limit, initially set to 0.25 can be changed with option c. It should be noted that if the a batch or other automati!!run is being performed, then if the correlaton fails there is a provision for the procedure to end gracefully. If after 3 and then y are entered, the line XSTOP is input then if the correlation fails the .SUM data will be reset to the input values and the program stopped. If XSKIP# is input, the program will skip # lines of the script, reset the .SUM data and ask for the next image to be input. A recent make_scriptR.seed for a batch run registering 450 Vesta images to Zmaps was: '''Options 1''', '''5''' and '''8''' allow you to change the scale, reference object and substrate, respectively.
Line 45: Line 98:
         m <- reference = map
         0 <- Auto-choose Zmap
         1.0 <- Scale = 1 km
         a <- Turn off abckground
         3 <- Shift image
         y <- Autocorrelate
         XSTOP <- Stop on no correlation
         1 <- Change scale
         0.25 <- New scale = 250 m
         3 <- Shift image
         y <- Autocorrelate
         XSTOP <- Stop on no correlation
         0 <- Quit
         y <- Save new .SUM data
         n <- Don't save rotation history
         n <- Don't save nominal
         q <- Quit procedure
         END
The last two 'n' are "always" so. The rotation history file was introduced to keep track of pointing errors in Clementine data during Lunar orbits in an attempt to quantify systemati!!shifts and it is rare that we want to set the nominal file equal to the .SUM solution. The 'a' on the fourth line deserves some expalnation. When we are correlating small images to a nominal shape, we want to use all the data, so the space off the body counts just as much as the body itself. The procedure wakes up with a "background" turned on so that this correlation can be performed. By typing 'a', we toggle this background off, so it is only the common topography that is correlated between the image anf the Zmap.
'''Option 2''': Sometimes when we are trying to align an image to a reference, the entire display is off center. The '2' option moves both the image and reference displays by the same amount so that we can more conveniently align them, usually at smaller scale. This option only changes the user's point of view, not the image's location.
Line 65: Line 100:
Sometimes when we are trying to align an image to a reference, the entire display is off center. The '2' option moves both the image and reference displays by the same amount so that we can more conveniently align them, usually at smaller scale. '''Options 3''', '''4''' and '''6''' make changes to the .SUM file in camera pointing and/or cross line-of sight scobj, camera twist and s/c range, respectively.
Line 67: Line 102:
When an image shift has been determined, either manually or through autocorrelation, The camera pointing ans spacecraft-object (scobj) vector in the .SUM file are changed in a manner weighted by their respective sigmas in the nominals (.NOM) file. If we want to keep one or the other unchanged, we use the 'd' or 'e' option to fix it. '''Option 3''' is the one most used. The new image is on the left or in red. Values entered (delta x, delta y) are the number of pixels by which the image will be shifted (as per the current scale). Note, this isn't moving the "window" like in [[lithos]], but updating the image's camera position and pointing. The program first asks whether an autocorrelate should be attempted:
Line 69: Line 104:
The '7' option populates the working .SUM file. Thie is sometimes a baleout procedure after having screwed up the .SUM file in some way. However, we have now introduced a new option '9' that lets us save the current result as the nominal without changing the .SUM file from its original value. If for example, the spacecraft range is out to lunch (as it was on Hayabusa) the working .SUM file can be populated with the nominal, a change made to the range with option '6', and the new nominal saved with option '9'. {{{
 Autocorrelate? (y/n)
y
        0.00000 0.00000 0.27302
 Enter px/ln IMAGE shift
}}}
Line 71: Line 111:
There are two other options that are included in REGISTER for convenience. Option 'b' allows a flag to be set on the image that will enable its brightness variations to be used to determine topography but keeps it from participating in the geometry solution for the landmark vector. This is used to keep Mariner 10 images of Mercury, which have questionable nominals, from messing up the vector but still, with their sometimes unique sun angles, helping with the topography determination. The 't' option allows an image to be tucked so it will not participate in the SP!!process at all. It could be tucked from LITHOS, but it often happens that as REGISTER is used to cycle through new images, problems are easily seen and dealt with immediately. Autocorrelate estimates the offset between the image and the reference. If the correlation gives a good match (greater than a preset limit, default=0.25), autocorrelate will shift the image and go back to the menu. Otherwise autocorrelate will ask for a manual input. The preset limit can be changed with '''option c'''.
Line 73: Line 113:
'''Option 7''' populates the working .SUM file. Thie is sometimes a baleout procedure after having screwed up the .SUM file in some way. However, we have now introduced a new '''option 9''' that lets us save the current result as the nominal without changing the .SUM file from its original value. If for example, the spacecraft range is out to lunch (as it was on Hayabusa) the working .SUM file can be populated with the nominal, a change made to the range with '''option 6''', and the new nominal saved with '''option 9'''.
Line 74: Line 115:
'''Option a''': When we are correlating small images to a nominal shape, we want to use all the data, so the space off the body counts just as much as the body itself. The procedure wakes up with a "background" turned on so that this correlation can be performed. By typing 'a', we toggle this background off, so it is only the common topography that is correlated between the image and the reference object.
Line 75: Line 117:
'''Option b''' allows a flag to be set on the image that will enable its brightness variations to be used to determine topography but keeps it from participating in the geometry solution for the landmark vector. This is used to keep Mariner 10 images of Mercury, which have questionable nominals, from messing up the vector but still, with their sometimes unique sun angles, helping with the topography determination.
Line 76: Line 119:
'''Option c''' allows the user to change the autocorrelation limit (default=0.25).
Line 77: Line 121:
'''Options d''' and '''e''': When an image shift has been determined, either manually or through autocorrelation, The camera pointing and spacecraft-object (scobj) vector in the .SUM file are changed in a manner weighted by their respective sigmas in the nominals (.NOM) file. If we want to keep one or the other unchanged, we use the 'd' or 'e' option to fix it.
Line 78: Line 123:
'''Option t''' allows an image to be tucked so it will not participate in the SPC process at all. It could be tucked from LITHOS, but it often happens that as REGISTER is used to cycle through new images, problems are easily seen and dealt with immediately.
Line 79: Line 125:
Register allows the user to align a new image This allows you to compare two items: a new images and some reference (another image, the shape model or a bigmap) '''0. Quit''': This gives the user the chance to save or discard changes, and then register the next image. All toggle options will persist until the user quits register.
Line 81: Line 127:
=== Requires ===
 * [[MAPFILES]]/ - required for comparison with a reference map
 * [[SHAPEFILES]]/ - required for comparison with a shape model
 * [[IMAGES]]/ - the image .DAT files
 * [[NOMINALS]]/ - image .NOM files (starting solution image, S/C and camera information)
 * [[SUMFILES]]/ - image .SUM files (updated solution image, S/C and camera information; lmrks and limbs)
{{{
 Accept shift? (y/n)
 Update/Create rotation history file? (y/n)
 Update nominal file? (y/n)
}}}
Line 88: Line 133:
'''Accept shift?''': Note that the shift has already been applied (the SUMFILE is updated in real time), in order to undo all changes since the last quit, the user must select 'n'.
Line 89: Line 135:
=== Optional === '''Update/Create rotation history file?''': Always 'n'. The rotation history file was introduced to keep track of pointing errors in Clementine data during Lunar orbits in an attempt to quantify systematic shifts.
Line 91: Line 137:
'''Update nominal file?''': Usually 'n'. It is rare that we want to set the nominal file equal to the .SUM solution.
Line 92: Line 139:
=== Input stdin ===

 * Image name
    Note: The image name is the name that is stored in [[IMAGES]]. Some versions of [[process_img]] will make some changes to the filename, so it may not be the "original name.

 * Which reference you want
  1. shape - to use the current shape model
  1. image - select an already registered image
  1. map - use a maplet/bigmap
   . Type the reference name (6 characters)
   . Give it the scale that you want to start with. You can change the resolution to "see" more.

 * example:
== Examples ==
  
Line 143: Line 179:
=== Menu options ===
  . 1. Change scale - Let's you zoom in and out. Use km/pix
  . 2. Global shift - If the program starts with part of the image/reference on the edge, you can shift both of them. This only is changing your point of view, not the image's location.
  . 3. Shift unknown. The new image is on the left or in red. Changes you make (delta x, delta y) move that image by that many pixels. Note, this isn't moving the "window" like [[lithos]], but moving the image like you'd expect.
    . It first asks you to autocorrelate. If if finds a good match, it will make the change and go back to the menu. Otherwise, you have to give it a delta x, delta. Y
  . 0. Quit. This gives you the chance to save or discard your changes, and then start the next image.
    . Accept shift? (y/n) - this will update the [[SUMFILE]].
    . Update/Create rotation file? (y/n) - I assume that using autocorrelate, if will also detect a rotation. I am unsure if you should accept them.
    . Update nominal file? (y/n) - This would change the "original" values for the image. Typically, you will answer, no

=== Output ===
 * TEMPFILE.pgm - A side by side view of the new image (left) and the reference (right).
 * TEMPFILE.ppm - A red/cyan composite of the two items (new is red, cyan is reference).
 * [[SUMFILES]] - If you accept the changes, it will update the position of the image.

== Notes from PowerPoint ==

=== Alternative Description ===
 * Cross-correlates an image with existing data to update the knowledge of the spacecraft position/attitude
 * Can register an image to:
  * Shape model
  * Bigmap
  * Another image
 * Limited to 2D
 * REGISTER aligns new image with current shape model. Initial estimate of s/c state.
'''Registering an image with a shape:'''
Line 171: Line 183:
 * REGISTER aligns new image and bigmaps '''Registering an image with a bigmap:'''
Line 174: Line 186:

=== Inputs ===
 * SPC IMG
 * [[SUMFILES]]
 * [[NOMINALS]]
 * SPICE
 * BIGMAPS (ZMAPS)

=== Outputs ===
 * Updated SUMFILES

=== Example ===

register

Purpose: Program for registering (adding and aligning) new images to existing maplets.

Register cross-correlates an image with existing data to update the knowledge of the spacecraft position/attitude. Register is limited to 2 degrees of freedom.

Requires

  • IMAGEFILES/ - a directory containing the image .DAT files

  • NOMINALS/ - a directory containing the image .NOM files (starting solution image, S/C and camera information)

  • SUMFILES/ - a directory containing the image .SUM files (updated solution image, S/C and camera information; lmrks and limbs)

  • MAPFILES/ - required for comparison with a reference map

  • SHAPEFILES/ - required for comparison with a shape model

Optional

Output

  • NOMINALS/ - If the user selects the option to update the NOMINAL file, starting S/C and camera information will be updated (an option not typically selected).

  • SUMFILES/ - S/C and camera information are updated as image shifts are made. The user can discard these changes upon quit. ??Detected landmarks and limbs are added to the SUMFILE??.

  • TEMPFILE.pgm - A side by side view of the image (left) and the reference (right).
  • TEMPFILE.ppm - A red/cyan composite of the two items (red is image, cyan is reference).

Introduction

(The following section is taken from SPOC v3.02A PDF/LITHOSPHERE/REGISTER.f File Reference, rearranged for convenience.)

REGISTER provides an initial estimate for the spacecraft state (camera pointing and s/c-object vector) by aligning an image with a known object - either the shape model, a high resolution map or another (already registered) image.

Input stdin

 input 12-character picture name. q to quit.

The user enters the image name as stored in IMAGEFILES. Some versions of process_img will make some changes to the filename, so it may not be the "original" name.

 s = shape
 i = reference image
 m = reference map

The user enters the object to align with.

  • s = shape - to use the current shape model
  • i = image - select an already registered image; user will be prompted for an image name.
  • m = map - use a maplet/bigmap; user will be prompted for a map name. If 0 is chosen for the map name, the program will search a set of "Zmaps" for the one most likely to overlap the image. Maps are only used after a detailed shape model and high-resolution maps have been constructed. At that time we are registering new images for navigation or improving the topography.

 enter scale (km/px)

A final entry is the scale in km. The basic display for REGISTER is 600x600 pixels. If the body in question is, say 500 m across, then if the scale is chosen to be 5 m (.005) the image will be 100 pixels across in the display.

Output

 gc TEMPFILE.pgm
 gc TEMPFILE.ppm
  • TEMPFILE.pgm - A side by side view of the new image (left) and the reference (right).
  • TEMPFILE.ppm - A red/cyan composite of the two items (new is red, cyan is reference).

Example TEMPFILE.pgm:

exTEMPFILEpgm.png

Example TEMPFILE.ppm:

exTEMPFILEppm.png

The display and the arrays of image and reference data are not the actual imaging data, but that data projected on a "substrate". When we are just starting processing and looking at low-resolution images of the body, the substrate is simply a plane through the body center oriented parallel to the camera's focal plane. This flat 'f' substrate is the default value. Once a decent shape model is obtained and our images cover a small fraction of the body's surface, the substrate is taken to be that surface itself, either in the form of the shape 's' or a high-resolution map 'm'. In this case, the topography is represented as a DTM whose reference plane is the same as the flat substrate with heights in the negative camera bore sight direction. Note that if the reference is also an image, this data is projected on the same substrate as the image being registered.

The main menu looks like:

 0. Quit
 1. Change scale
 2. Global shift
 3. Shift unknown (LEFT/RED) image
 4. Rotate unknown (LEFT/RED) image
 5. Change reference
 6. Change RANGE of (LEFT/RED) image
 7. Revert to nominal
 8. Change substrate 
 9. Update nominal and quit
 a. Toggle bkg
 b. Toggle image for Vlm
 c. Change correlation limit
 d. Fix/Unfix scobj
 e. Fix/Unfix pointing
 t. Tuck picture

Options 1, 5 and 8 allow you to change the scale, reference object and substrate, respectively.

Option 2: Sometimes when we are trying to align an image to a reference, the entire display is off center. The '2' option moves both the image and reference displays by the same amount so that we can more conveniently align them, usually at smaller scale. This option only changes the user's point of view, not the image's location.

Options 3, 4 and 6 make changes to the .SUM file in camera pointing and/or cross line-of sight scobj, camera twist and s/c range, respectively.

Option 3 is the one most used. The new image is on the left or in red. Values entered (delta x, delta y) are the number of pixels by which the image will be shifted (as per the current scale). Note, this isn't moving the "window" like in lithos, but updating the image's camera position and pointing. The program first asks whether an autocorrelate should be attempted:

 Autocorrelate? (y/n)
y
        0.00000        0.00000        0.27302
 Enter px/ln IMAGE shift

Autocorrelate estimates the offset between the image and the reference. If the correlation gives a good match (greater than a preset limit, default=0.25), autocorrelate will shift the image and go back to the menu. Otherwise autocorrelate will ask for a manual input. The preset limit can be changed with option c.

Option 7 populates the working .SUM file. Thie is sometimes a baleout procedure after having screwed up the .SUM file in some way. However, we have now introduced a new option 9 that lets us save the current result as the nominal without changing the .SUM file from its original value. If for example, the spacecraft range is out to lunch (as it was on Hayabusa) the working .SUM file can be populated with the nominal, a change made to the range with option 6, and the new nominal saved with option 9.

Option a: When we are correlating small images to a nominal shape, we want to use all the data, so the space off the body counts just as much as the body itself. The procedure wakes up with a "background" turned on so that this correlation can be performed. By typing 'a', we toggle this background off, so it is only the common topography that is correlated between the image and the reference object.

Option b allows a flag to be set on the image that will enable its brightness variations to be used to determine topography but keeps it from participating in the geometry solution for the landmark vector. This is used to keep Mariner 10 images of Mercury, which have questionable nominals, from messing up the vector but still, with their sometimes unique sun angles, helping with the topography determination.

Option c allows the user to change the autocorrelation limit (default=0.25).

Options d and e: When an image shift has been determined, either manually or through autocorrelation, The camera pointing and spacecraft-object (scobj) vector in the .SUM file are changed in a manner weighted by their respective sigmas in the nominals (.NOM) file. If we want to keep one or the other unchanged, we use the 'd' or 'e' option to fix it.

Option t allows an image to be tucked so it will not participate in the SPC process at all. It could be tucked from LITHOS, but it often happens that as REGISTER is used to cycle through new images, problems are easily seen and dealt with immediately.

0. Quit: This gives the user the chance to save or discard changes, and then register the next image. All toggle options will persist until the user quits register.

 Accept shift? (y/n)
 Update/Create rotation history file? (y/n)
 Update nominal file? (y/n)

Accept shift?: Note that the shift has already been applied (the SUMFILE is updated in real time), in order to undo all changes since the last quit, the user must select 'n'.

Update/Create rotation history file?: Always 'n'. The rotation history file was introduced to keep track of pointing errors in Clementine data during Lunar orbits in an attempt to quantify systematic shifts.

Update nominal file?: Usually 'n'. It is rare that we want to set the nominal file equal to the .SUM solution.

Examples

 ~/bin/register 

 input 12-character picture name. q to quit.
N110751047R

REFERENCE MAP = ZS0426

 Input reference
 s. SHAPE
 i. IMAGE
 m. MAP
m
 Input REFNM
TSI003
 enter scale (km/px)
.6118483

 0. Quit
 1. Change scale
 2. Global shift
 3. Shift unknown (LEFT/RED) image
 4. Rotate unknown (LEFT/RED) image
 5. Change reference
 6. Change RANGE of (LEFT/RED) image
 7. Revert to nominal
 8. Change substrate (s)
 9. Change pole
 a. Turn off bkg
 b. Turn off image for Vlm
 c. Change correlation limit =   0.25
 d. Fix scobj
 e. Fix pointing
 t. Tuck picture
 Current picture   = N110751047R 
 Current reference = TSI003      

Registering an image with a shape:

register_AlignsNewImage.jpg

Registering an image with a bigmap:

register_AlignsNewBigmaps.jpg

register_example.jpg

CategoryPrograms CategoryPrograms

register (last edited 2018-11-19 11:37:23 by EricPalmer)