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

noproj

Removes camera distortions in a raw level 1 cube creating an ideal version of the cube.

Noproj reprojects a level1 cube to correct for camera distortion. The result is a level1 cube of the undistorted image in "Ideal" camera space.

Both cubes (FROM and MATCH) must see the same target. Each requires SPICE data and should be processed with spiceinit prior to running noproj.

The Ideal camera geometry is derived from the MATCH cube. If the coordinate (lat/long) at each pixel in the MATCH cube maps to a lat/long coordinate in the FROM cube, then the pixel value at the mapped coordinate in the FROM cube is projected into the TO cube, with some interpolation due to the distortion correction. The default behavior is that any offbody pixels in the MATCH and the FROM cube are set to null in the TO cube. See OFFBODY and OFFBODYTRIM for alternative options for mapping offbody data. Also see cam2cam as noproj parameters are passed to cam2cam.

This program will modify the cube labels for the Ideal camera. The original Instrument group is renamed OriginalInstrument and a new instrument group is created for the Ideal Camera. The cube data is modified when this program runs cam2cam, creating the noproj'ed output cube with camera distortions removed.

Note that noproj will not propagate AlphaCube groups from the MATCH cube into the TO cube since noproj is resampling the image.


Categories


Related Applications to Previous Versions of ISIS

This program replaces the following application existing in previous versions of ISIS:
  • noproj

Related Objects and Documents

Applications


History

Debbie A. Cook2006-11-14 Original version
Debbie A. Cook2007-02-13 Corrected for case where original instrument has negative affine coefficients
Debbie A. Cook2007-04-24 Added INTERP option, fixed SPECS parameter to allow user to override the default and enter a file, and updated the documentation
Debbie A. Cook2007-05-21 Changed category to Cameras
Debbie A. Cook2007-06-12 Corrected order of SetInputCube calls to set the MATCH cube first if is entered so that the labels on the cube to match are propagated from it and not the from cube
Debbie A. Cook2007-08-31 Turned off propagation of the polygon blobs because the file name contains "/" from the serial number and unix does not allow "/". Also added a remove of the match file OriginalInstrument group written by cam2cam before writing the input OriginalInstrument. hijitreg reads the input CcdId from this group.
Steven Lambright2008-05-13 Removed references to CubeInfo
Debbie A. Cook2009-01-26 Completed applying summing mode to ideal camera by applying it to the sample/line translations.
Debbie A. Cook2009-03-25 Fixed setting of et to correspond to first line of parent (Alpha cube)
Debbie A. Cook2012-07-06 Updated Spice members to be more compliant with Isis coding standards. References #972.
Steven Lambright2012-09-10 This program will now modify the NaifKeywords object, if it exists, instead of the instrument group with the following keywords: TransX (becomes IDEAL_TRANSX), TransY (becomes IDEAL_TRANSY), TransS0 (becomes IDEAL_TRANSS), TransL0 (becomes IDEAL_TRANSL), PixelPitch (becomes IDEAL_PIXEL_PITCH), and FocalLength (becomes IDEAL_FOCAL_LENGTH). Fixes #1094.
Ian Humphrey2017-08-19 No longer propagates AlphaCube group to output cube. Fixes #4907.
Kris Becker2019-01-28 Add OFFBODY option to also project off-body pixels. Added the OFFBODYTRIM option to not propagate target intersections in the FROM image into the projection when they don't intersect into the MATCH view. Added use of unique temporary name creation for the match file template to avoid file name collisions (e.g., when run in parallel in same directory)
Kaitlyn Lee2021-03-31 Refactored app to be callable and converted its tests to GTests.
Kris Becker2021-05-06 Added checks for ray tracing options in UofA OSIRIS-REx ISIS code base. The keywords needed for Bullet to operate properly are RayTraceEngine, BulletParts, and Tolerance. These parameters must be included in the output label in order for cam2cam to run and subsequent use is consistent.
Kris Becker2021-09-22 Rework how temporary external files are identified in UofA OSIRIS-REx ISIS code base after use by cam2cam and ensure they are all deleted. Fixes #4813.
Ken Edmundson2023-12-14 Incorporated Kris Becker's 2021-05-06 bug fix above into USGS code base.
Ken Edmundson2024-01-09 Incorporated Kris Becker's 2021-09-22 bug fix above into USGS code base.
Ken Edmundson2024-08-07 Additional bug fix to address persistent temporary lbl file after running noproj. Fixes #5577.
Sarah Sutton2025-04-30 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. Addresses #3602.

Parameters

Files

This cube will have the camera distortions removed based on the correction for the MATCH file and output to the TO file.
Type cube
File Mode input
Filter *.cub

This is the level 1 cube whose labels will be converted to the Ideal instrument and used as the cube to match. It must have only one band so use the input attributes to select the band to match. For example, themis.cub+5
Type cube
File Mode input
Internal Default Match cube
Filter *.cub

This file contains the specifications for the "ideal" camera based on the original instrument. If no value is entered, the default specs file will be read from "$ISISROOT/appdata/templates/noproj/noprojInstruments.pvl"
Type filename
File Mode input
Default Path $ISISROOT/appdata/templates/noproj/
Internal Default SystemDefault
Filter *.pvl

This file will be a copy of the input cube with the labels modified for the Ideal Camera cubes.
Type cube
File Mode output

Output Summing Mode

This parameter is used to specify how the summing mode is obtained for the output noproj'd cube. The pixel pitch of the output file will be set to the summing mode times the pixel pitch of the input file. The output pixel pitch is written to the labels of the noproj'd cube. Note:: The user can override the default using the USER parameter.
Type string
Default FROMMATCH
Option List:
Option Brief Description
FROMMATCHGet from input MATCH cube This option will automatically determine the output summing mode from the cube to match specified using the MATCH parameter

Exclusions

  • SUMMINGMODE
FROMINPUTGet from input FROM cube This option will automatically determine the output summing mode from the cube to match specified using the FROM parameter

Exclusions

  • SUMMINGMODE
FROMUSER Get summing mode from user This option allows the user to specify the summing mode to be applied to the input file pixel pitch (mm/pix) to determine the output pixel pitch.

Specifies the summing mode to multiply times the input file (FROM) camera pixel pitch (mm/pix) to determine the output noproj'd file pixel pitch (pixel size in mm). This value is written to the output file labels
Type double
Minimum 1.0 (inclusive)

Options

This is the type of interpolation to be performed on the input in cam2cam.
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 expands the size of the output file in samples beyond the default size to prevent cropping of the undistorted image. The undistorted image may be larger than the raw distorted image.
Type double
Default 0.0

This parameter expands the size of the output file in lines beyond the default size to prevent cropping of the undistorted image. The undistorted image may be larger than the raw distorted image.
Type double
Default 0.0

This parameter is provided to allow the user to selectively keep data in the FROM image that is off the target body. When OFFBODY is FALSE (the default), pixels off the target body in the FROM cube will be NULL in the resulting TO cube. When OFFBODY is TRUE, 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 FROM cube, the output pixel DN value is interpolated from the FROM cube to the TO cube. See also OFFBODYTRIM.
Type boolean
Default FALSE

When using OFFBODY mode, there are situations where the coordinates in the MATCH do not intersect the target body (i.e., the pixel does not have a latitude and longitude). In that case, the MATCH RA/DEC coordinate is mapped into the FROM image field of view. 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

Demonstrate the effects of the OFFBODY and OFFBODYTRIM parameters

In this example, noproj is used to remove camera distortions from two images acquired by the OSIRIS-REx NavCam during a particle ejection event at Bennu (Lauretta et al., 2019). Example images are 20190106T205618S792_ncm_L0 (long exposure) and 20190106T205611S433_ncm_L0 (short exposure). The images are imported from FITS files and converted to ISIS cubes with tagcams2isis. Both cubes are initialized with spiceinit using the bennu_g_00880mm_alt_obj_0000n00000_v020.bds global shapemodel found in the OSIRIS-REX SPICE KERNEL bundle.

Input images

Command Line for running noproj on long exposure image

Here, OFFBODY=TRUE and OFFBODYTRIM=FALSE to preserve the pixels in the space around Bennu, including the ejected particles. Note that the same cube is used for both FROM and MATCH parameters.

Command Line for running noproj on short exposure image

Here, OFFBODY and OFFBODYTRIM are FALSE. OFFBODY is set to FALSE to set all pixels off the target body to null. The noproj'ed long exposure output is used as the MATCH cube. The specifications file (specs.pvl) is required because the MATCH cube has been run through noproj and is now identified as an "Ideal" camera in the label. The specifications file contains the undistorted (Ideal camera) detector dimensions. In this case:

            Object = IdealInstrumentsSpecifications
  
              Group = "IdealSpacecraft/IdealCamera"
                DetectorSamples = 3050
                DetectorLines = 2404
              End_Group
  
            End_Object
            End
          

Output images

Null pixels are shown in yellow to illustrate the undistorted image outline.

Mosaic the noproj'ed long and short exposures

To see the ejected particles and the surface of Bennu in the same scene, we mosaicked the short exposure cube on top of the long exposure cube using handmos. In the image shown, both noproj'ed cubes have been contrast-stretched, but only at a rudimentary level. This example does not reproduce the full processing required to generate the figure in the article referenced above, but it does illustrate a case where it is necessary to preserve off-body pixels.

Particle ejection observations mosaic

OSIRIS-REx NavCam image 20190106T205611S433_ncm_L0 combined with 20190106T205618S792_ncm_L0.

To Reproduce This Example

Download the shell script, the ray tracer preference file, and the Ideal camera specifications file linked here. The ray trace 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. The specifications file defines the size of the distortion-corrected NavCam image, which after running noproj is identified as the "Ideal" camera model. Before running the script, place the preference and specification files in $ISISROOT. The script will download and move the OSIRIS-REx DSK (shapemodel) kernel into $ISISDATA. See the ISIS documentation for instructions on downloading $ISISDATA for a specific mission.