cam2cam
Project a camera image to a different camera image
Each MATCH cube pixel with a valid LAT/LON is checked for a corresponding LAT/LON target body intercept in the FROM cube. If the corresponding FROM cube pixel either does not intercept the target body or is occluded, it is set to NULL in the TO cube. If the corresponding FROM cube pixel does intercept the target body, interpolation (as determined by INTERP) is applied to the FROM cube pixel to calculate the output TO cube pixel DN. This process employs the rigorous application of the FROM and MATCH cube camera distortion models and ray tracing from instrument to target body.
As an example, given overlapping Mars Global Surveyor MOC and Mars Odyssey Themis cubes, cam2cam can convert the MOC image to have the same geometric camera characteristics as the Themis cube (or vice versa). Another application is to align independent bands in a camera cube. For example, a raw Themis cube (after thm2isis) will not have aligned pixels. cam2cam can be used to align the pixels without going to a map projection. To prevent pixels from falling off the edge of the cube, run pad on the cube prior to cam2cam.
The OFFBODY parameter allows for the projection of off-body data using RA/DEC (right ascension/declination) coordinates in the MATCH image. OFFBODY is FALSE by default to preserve existing cam2cam behavior. If OFFBODY is TRUE and projection with LAT/LON coordinates fails, then it is reattempted with RA/DEC coordinates. If the RA/DEC in the MATCH image exists in the FROM image, interpolation is used to calculate the output TO cube pixel DN. It may occur that the FROM image RA/DEC coordinates will also intercept the target body in the FROM cube. This would result in the assignment of an invalid LAT/LON in the TO cube. OFFBODYTRIM=TRUE prevents this by instead assigning NULL to the output pixel.
The projection of off-body pixels has proven valuable for example in the analysis of particles in orbit around the asteroid 101955 Bennu. See for example...
Hergenrother, C.W. et al. (2020). Photometry of Particles Ejected from Active Asteroid (101955) Bennu, JGR Planets, 125, e2020JE006381 doi:10.1029/2020JE006381
Categories
Related Applications to Previous Versions of ISIS
This program replaces the following application existing in previous versions of ISIS:- lev1tolev1
Related Objects and Documents
Applications
History
Jeff Anderson | 2000-05-10 | Original version |
Jeff Anderson | 2004-01-19 | Converted to Isis 3.0 |
Jacob Danton | 2005-12-05 | Added an appTest. |
Elizabeth Miller | 2006-03-23 | Fixed appTest to reflect changes in all camera models |
Debbie A. Cook | 2007-06-21 | Corrected setting of output file labels so that the Spice comes from the match cube and not the input cube |
Steven Lambright | 2007-06-22 | Fixed typo in documentation |
Steven Lambright | 2008-01-23 | Fixed an access on an invalid pointer that caused segmentation faults on cubes in which the camera is band-dependant. |
Jeff Anderson | 2008-02-12 | Fixed problems with reference bands on band-dependent instruments |
Steven Lambright | 2008-05-12 | Removed references to CubeInfo |
Jesse Mapel | 2018-05-17 | Changed transform to use the local radius computed by the output camera instead of having the input camera re-compute it (sometimes incorrectly) from the latitude and longitude. Fixes #5425. |
Kris Becker | 2019-01-16 | Add option to also project off-body pixels |
Kris Becker | 2019-01-28 | Add option to also project off-body pixels as well as trim pixels in this mode that may result in duplicate views of the target body. See OFFBODY and OFFBODYTRIM. |
Sarah Sutton | 2024-01-05 | Incorporated Kris Becker's keyword additions OFFBODY and OFFBODYTRIM of 1/16/2019 and 1/28/2019 from UofA codebase to Astrogeology. Added examples and updated documentation. |
Kris Becker | 2024-10-28 | OFFBODYTRIM should default to true for proper behavior. Added a standalone mapper algorithm to more easily tests these changes. |
Ken Edmundson | 2024-12-08 | Updated examples and documentation addressing OFFBODY and OFFBODYTRIM parameters. Addresses #3602. |
Parameters
Files
Type | cube |
---|---|
File Mode | input |
Filter | *.cub |
Type | cube |
---|---|
File Mode | input |
Filter | *.cub |
Type | cube |
---|---|
File Mode | output |
Filter | *.cub |
Options
Type | integer |
---|---|
Internal Default | middle |
Minimum | 1 (inclusive) |
Type | string | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Default | CUBICCONVOLUTION | ||||||||||||
Option List: |
|
Type | boolean |
---|---|
Default | FALSE |
Type | boolean |
---|---|
Default | TRUE |
Example 1
Demonstrates Default Options with Apollo 15 Metric Camera Images
Command Line
cam2cam from=Sub4-AS15-M-1537.cub match=Sub4-AS15-M-0587_msk.cub
to=Sub4-AS15-M-1537_2_587.cub
GUI Screenshot
Example GUI
cam2cam gui with default options
The top of the GUI shows the filenames for FROM, MATCH, and TO cubes.
The bottom of the GUI shows the Options menu with default settings.
REFBAND, defaults to "middle", INTERP to CUBICCONVOLUTION, and
OFFBODY to "no". OFFBODYTRIM defaults to "yes." Note however that
OFFBODYTRIM is only utilized if OFFBODY is "yes."
Input Images
MATCH image
MATCH Apollo 15 Metric Camera image
Parameter Name:
MATCH
Apollo 15 Metric Camera image AS15-M-0587.
Output Image
Output image
Output of cam2cam run with default settings
Parameter Name:
TO
The result of projecting AS15-M-1537 into the geometry of AS15-M-0587.
Example 2
Demonstrates cam2cam OFFBODY and OFFBODYTRIM Options
The images were processed with cam2cam three times with the following OFFBODY and OFFBODYTRIM settings ...
- OFFBODY=FALSE (DEFAULT options)
- OFFBODY=TRUE; OFFBODYTRIM=TRUE
- OFFBODY=TRUE; OFFBODYTRIM=FALSE
Input Images
FROM image
FROM OSIRIS-REx Detailed Survey MapCam image 20190509T180552S020
Parameter Name:
FROM
OSIRIS-REx Detailed Survey MapCam image 20190509T180552S020.
MATCH image
MATCH OSIRIS-REx Detailed Survey MapCam image
Parameter Name:
MATCH
OSIRIS-REx Detailed Survey MapCam image 20190509T174620S424.
Output Images
Output image
Output image generated with default options (OFFBODY=FALSE)
Parameter Name:
TO
The result of projecting MapCam image 20190509T180552S020 into the geometry of MapCam image 20190509T174620S424 with default options (OFFBODY=FALSE).
Output image
Output image generated with OFFBODY=TRUE; OFFBODYTRIM=TRUE
Parameter Name:
TO
The result of projecting MapCam image 20190509T180552S020 into the geometry of MapCam image 20190509T174620S424 with OFFBODY and OFFBODYTRIM TRUE. Black regions are pixels set to NULL either through OFFBODY trimming or occlusion. The visible DTM misregistration along the limb at the left occurs because the example images are uncontrolled.
Output image
Output image generated with OFFBODY=TRUE; OFFBODYTRIM=FALSE
Parameter Name:
TO
The result of projecting MapCam image 20190509T180552S020 into the geometry of MapCam image 20190509T174620S424 with OFFBODY TRUE and OFFBODYTRIM FALSE. The red boundary was drawn by hand to differentiate valid from invalid surface. Surface to the right of the boundary is valid. Surface to the left of the boundary is invalid, resulting from RA/DEC coordinates in the FROM image that project to the surface in the MATCH image. These remain in the output because OFFBODYTRIM is FALSE.
Example 3
More on OFFBODY and OFFBODYTRIM Parameters
- OFFBODY=FALSE (DEFAULT options)
- OFFBODY=TRUE; OFFBODYTRIM=FALSE
- OFFBODY=TRUE; OFFBODYTRIM=TRUE
Input OSIRIS-REx MapCam Image 20190509T180552S020

Output from Projecting DTM Image to Ellipsoid Image

In the images above, yellow represents NULL DNs and black is sky/background. In NULL regions, LAT/LON coordinates on the ellipsoid are not visible (or are occluded) on the DSK shape model from this observer-to-target configuration.
Output from Projecting Ellipsoid Image to DTM Image

Again, NULL DNs are yellow and sky/background is black. There are no NULLs in the target body interior of these images as all Lat/Lons come from the DTM image geometry and map directly to the ellipsoid. The NULLs in the rightmost image where OFFBODYTRIM=TRUE are portions of the ellipsoid that do not map to Bennu's surface. These off-limb regions between the ellipsoid boundary and DTM surface are actually sky/background data. More specifically, the MATCH image pixel coordinates here a) did not intersect Bennu's surface in MATCH/TO, b) the RA/DEC coordinates in MATCH/TO did map into the FROM image FOV, and c) the look direction vector from the FROM pixel to the RA/DEC also intersects Bennu's surface in the ellipsoid model. And so, NULL is assigned to the TO image at those pixels.
Without the use of OFFBODYTRIM, portions of FROM image surfaces could be propagated to the output TO image erroneously. Often, these are indistinguishable from valid surface and may lead to incorrect interpretation.
See noproj for a more practical use for this example and the importance of the OFFBODYTRIM parameter.
To Reproduce This Example
Download the shell script and ray tracer preference files linked here. The preference file sets the ray trace library to Bullet rather than NAIF DSK (default for shape models with a ".bds" file extension) as Bullet will detect occlusions. Before running the script, place the preference file in $ISISROOT. Download and install the OSIRIS-REx kernel into $ISISDATA. See the ISIS documentation for instructions on downloading $ISISDATA for a specific mission.