Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

ISIS Documentation

cam2cam

Project a camera image to a different camera image

The cam2cam program projects the FROM cube into the "camera space" (i.e. geometry) of the MATCH cube. Both cubes (ISIS level0 or level1) must see the same target. Each requires SPICE data and should be processed with spiceinit prior to running cam2cam.

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 Anderson2000-05-10 Original version
Jeff Anderson2004-01-19 Converted to Isis 3.0
Jacob Danton2005-12-05 Added an appTest.
Elizabeth Miller2006-03-23 Fixed appTest to reflect changes in all camera models
Debbie A. Cook2007-06-21 Corrected setting of output file labels so that the Spice comes from the match cube and not the input cube
Steven Lambright2007-06-22 Fixed typo in documentation
Steven Lambright2008-01-23 Fixed an access on an invalid pointer that caused segmentation faults on cubes in which the camera is band-dependant.
Jeff Anderson2008-02-12 Fixed problems with reference bands on band-dependent instruments
Steven Lambright2008-05-12 Removed references to CubeInfo
Jesse Mapel2018-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 Becker2019-01-16 Add option to also project off-body pixels
Kris Becker2019-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 Sutton2024-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 Becker2024-10-28 OFFBODYTRIM should default to true for proper behavior. Added a standalone mapper algorithm to more easily tests these changes.
Ken Edmundson2024-12-08 Updated examples and documentation addressing OFFBODY and OFFBODYTRIM parameters. Addresses #3602.

Parameters

Files

The camera cube which will be modified
Type cube
File Mode input
Filter *.cub

This is the camera cube which will be matched. It must be only one band so use the input attributes to select the band to match. For example, themis.cub+5.
Type cube
File Mode input
Filter *.cub

The resultant cube which will have the same camera geometry and image size as the match cube.
Type cube
File Mode output
Filter *.cub

Options

This is the reference band to be used in the MATCH cube. That is, all bands in the FROM cube will be matched to this band. The default is to use the middle band; however, the user can enter any band number which is valid for the instrument, regardless of whether the band is in the cube or not. This only applies to band dependent camera models such as Themis.
Type integer
Internal Default middle
Minimum 1 (inclusive)

This is the type of interpolation to be performed on the input.
Type string
Default CUBICCONVOLUTION
Option List:
Option Brief Description
NEARESTNEIGHBORNearest Neighbor Each output pixel will be set to the pixel nearest the calculated input pixel.
BILINEARBi-Linear interpolation Each output pixel will be set to the value calculated by a bi-linear interpolation of the calculated input pixel.
CUBICCONVOLUTIONCubic Convolution interpolation Each output pixel will be set to the value calculated by a cubic convolution interpolation of the calculated input pixel.

This parameter is provided to allow the user to selectively keep data in the FROM image that is off the target body. Output pixels in MATCH geometry are tested for target body intersection. For pixels that are off the target body, the RA/DEC coordinates in MATCH are mapped to FROM. If the RA/DEC is within the FOV of FROM, the output pixel is interpolated from the FROM image. See also OFFBODYTRIM.
Type boolean
Default FALSE

When using OFFBODY mode, there are situations where the pixel in the MATCH do not intersect the target body, the MATCH RA/DEC coordinate is mapped into the FROM image FOV. If the RA/DEC maps to a FROM sample/line and OFFBODYTRIM=TRUE, the sample/line is checked for intersection with the target body. Pixels that intersect the body will result in a NULL output pixel value. Otherwise, the FROM pixel value is interpolated and propagated to the output pixel.
Type boolean
Default TRUE

Example 1

Demonstrates Default Options with Apollo 15 Metric Camera Images

In this example cam2cam is used to project a highly oblique Apollo 15 Metric Camera image (AS15-M-1537) into the geometry of a nadir-looking Apollo 15 Metric Camera image (AS15-M-0587). Both images target Rima Hadley and the Apollo 15 landing site.

Command Line

Command line for this example.
cam2cam from=Sub4-AS15-M-1537.cub match=Sub4-AS15-M-0587_msk.cub to=Sub4-AS15-M-1537_2_587.cub

GUI Screenshot

cam2cam gui with default options

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

FROM Apollo 15 Metric Camera image

FROM image

FROM Apollo 15 Metric Camera image

Parameter Name: FROM

FROM image AS15-M-1537.

MATCH Apollo 15 Metric Camera image

MATCH image

MATCH Apollo 15 Metric Camera image

Parameter Name: MATCH

Apollo 15 Metric Camera image AS15-M-0587.

Output Image

Output of cam2cam run with default settings

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

To illustrate OFFBODY and OFFBODYTRIM options, cam2cam is used to project OSIRIS-REx OCAMS image 20190509T180552S020 into the geometry of OCAMS image 20190509T174620S424. Both images were acquired by the MapCam instrument in the mission's (Detailed Survey: Baseball Diamond) phase. They were initialized with the 80cm global DTM found in the OSIRIS-REx SPICE Kernel Archive Bundle.

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 OSIRIS-REx Detailed Survey MapCam image 20190509T180552S020

FROM image

FROM OSIRIS-REx Detailed Survey MapCam image 20190509T180552S020

Parameter Name: FROM

OSIRIS-REx Detailed Survey MapCam image 20190509T180552S020.

MATCH OSIRIS-REx Detailed Survey MapCam image

MATCH image

MATCH OSIRIS-REx Detailed Survey MapCam image

Parameter Name: MATCH

OSIRIS-REx Detailed Survey MapCam image 20190509T174620S424.

Output Images

Output image generated with default options (OFFBODY=FALSE)

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 generated with OFFBODY=TRUE; OFFBODYTRIM=TRUE

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 generated with OFFBODY=TRUE; OFFBODYTRIM=FALSE

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.

Blink Comparison

Blink comparison

Blink Comparison

Parameter Name: TO

Blink comparison of cam2cam output with OFFBODY=FALSE vs output with OFFBODY=TRUE; OFFBODYTRIM FALSE. Surface to the left of the red boundary is invalid

Example 3

More on OFFBODY and OFFBODYTRIM Parameters

We further illustrate OFFBODY and OFFBODYTRIM by projecting OSIRIS-REx MapCam image 20190509T180552S020 initialized with the Bennu ellipsoid into the same image initialized with the 80cm global DTM and vice versa. The ellipsoid is defined in the PCK kernel and the DTM is found in the OSIRIS-REx SPICE Kernel Archive Bundle. As in Example 2, cam2cam is run three times with the following options...
  • OFFBODY=FALSE (DEFAULT options)
  • OFFBODY=TRUE; OFFBODYTRIM=FALSE
  • OFFBODY=TRUE; OFFBODYTRIM=TRUE

Input OSIRIS-REx MapCam Image 20190509T180552S020

MapCam Image 20190509T180552S020

Output from Projecting DTM Image to Ellipsoid Image

MapCam Image 20190509T180552S020

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

MapCam Image 20190509T180552S020

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.