Home

User Documentation

Getting Started
Learn More
Explore in Detail
Get Inspired

Contributor Documentation

Getting Started
Learn More
Explore in Detail
Get Inspired

Quick Links

Software Manual
AstroDiscuss
GitHub
API Reference

Documentation Versions


ISIS 2

Documentation
Tutorials
Technical Documents
USGS

ISIS Application Documentation


warp

Printer Friendly View | TOC | Home

Warp an image using a Control Network

Overview Parameters Example 1 Example 2 Example 3

Description

This application applies a geometric warp to an image using a user supplied Control Network. The Control Network consists of the input (FROM) cube and a second cube for which image-to-image Control Points are measured. Programs, such as coreg, can be used to generate the Control Network file for level1 or level2 cubes.

The Control Measures of the FROM cube are fit to the corresponding Control Measures of the second cube in the Control Network file using a weighted or non-weighted least squares fit to a polynomial of degree N, where N is specified by the DEGREE parameter.

With weighted least squares fit, specific pixel movement (input to output location) is based on Control Point distances from a given pixel. That is, Control Points closest to a given input pixel will have greater weight (influence) on the computed output location than Control Points furthest from the input pixel. With non-weighted least squares fit, all Control Points will have equal weight toward influencing individual pixel movement.


Categories


Related Applications to Previous Versions of ISIS

This program replaces the following applications existing in previous versions of ISIS:
  • random
  • warp2

History

Kay Edwards1987-06-08 Original version
Jeff Anderson2004-06-18 Converted to Isis 3.0
Elizabeth Miller2005-10-11 Finished documentation and code
Elizabeth Miler2005-11-03 Added appTest
Jacob Danton2006-04-05 Added error checking for control networks
Steven Lambright2007-06-22 Fixed typo in user documentation
Steven Lambright2008-05-13 Removed references to CubeInfo
Stacy Alley2008-12-19 Updating documentation and adding examples
Janet Barrett2010-07-30 Changed CONTROL parameter name to CNET.
Kris Becker2011-10-07 Updated documentation with review and contributions from Chris Isbell and Annie Howington.
Jacob Cain2022-11-22 Changed CUBE type to cube. Fixes #4780.

Parameter Groups

Files

Name Description
FROM Input cube to warp
TO Output cube
CNET Control Network file

Warp parameters

Name Description
DEGREEOrder of polynomial
WEIGHTEDWeight the Control Points using distance
OSIZEOutput cube size
CUBEMatch Output cube to this Cube's Size
ONLOutput Lines
ONSOutput Samples

Interpolation

Name Description
INTERPType of interpolation
X

Files: FROM


Description

Specify the input cube to be warped. This can be a level1 or level2 cube. All bands within the cube will be warped unless a specific band is specified.

Type cube
File Mode input
Filter *.cub
Close Window
X

Files: TO


Description

This new output cube will contain the results of the warp processing. It will either be a single-band or multi-band cube based on the input bands specified in the FROM cube.

Type cube
File Mode output
Close Window
X

Files: CNET


Description

This input Control Network file contains image-to-image Control Points that will be used to apply the warp transformation. Exactly two images are allowed in this Control Network, one of which must be the FROM cube. This file is typically generated by the coreg application.

Type filename
File Mode input
Filter *.net
Close Window
X

Warp parameters: DEGREE


Description

The order of the polynomial to be used in the linear regression fit. Higher order polynomial requires more numerous Control Points.

Type integer
Default 1
Minimum 1 (inclusive)
Close Window
X

Warp parameters: WEIGHTED


Description

With this option selected (default), specific pixel movement (input to output location) is based on Control Point distances from the pixel. That is, Control Points closest to a given input pixel will have greater weight (influence) on the computed output location than Control Coints furthest from the input pixel. Without this selection, all Control Points will have equal weight toward influencing individual pixel movement.

Type boolean
Default true
Close Window
X

Warp parameters: OSIZE


Description

This option determines how the size of the output cube is determined. The choices are MATCH, COMPUTE, and USER. The MATCH option (default) matches the output cube size to the size of the cube provided in the CUBE parameter. The COMPUTE option calculates the output cube size from the Control Network file. The USER parameter allows the user to set the output cube size by entering sample and line values in the ONS and ONL parameters.

Type string
Default MATCH
Option List:
Option Brief Description
MATCHMatch size of cube This option will match the output cube to the size of the cube provided in the CUBE parameter.

Exclusions

  • ONL
  • ONS
COMPUTECompute size using Control Points Computes the size of the output file using the Control Network file. This is done by solving for output positions given input positions, then walk the edge of the input file to find the maximum output line and sample.

Exclusions

  • ONL
  • ONS
  • CUBE
USERUser specific output cube size The output cube size as provided by the ONS and ONL parameters.

Exclusions

  • CUBE

Inclusions

  • ONL
  • ONS
Close Window
X

Warp parameters: CUBE


Description

The output cube will have the same dimensions as the cube entered here.

Type cube
File Mode input
Filter *.cub
Close Window
X

Warp parameters: ONL


Description

Requested number of lines for the output cube.

Type integer
Minimum 1 (inclusive)
Close Window
X

Warp parameters: ONS


Description

Requested number of samples for the output cube.

Type integer
Minimum 1 (inclusive)
Close Window
X

Interpolation: INTERP


Description

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 that of the pixel nearest the calculated input pixel.
BILINEARBi-Linear interpolation Each output pixel value will be set as calculated by a bi-linear pixel value interpolation of an 2x2 pixel array about the calculated input pixel position.
CUBICCONVOLUTIONCubic Convolution interpolation Each output pixel value will be set as calculated by a cubic convolution pixel value interpolation of an 4x4 pixel array about the calculated input pixel position.
Close Window

Example 1

Warp Example 1

Description

Warp Example 1

Command Line

warp warp from=warp_from.cub to=warp_example1.cub cnet=warp_example1.net osize=user onl=1000 ons=1000
This warp command will warp the from cube (warp_from.cub) which is a 100Sx1000L image, to a 1000Sx1000L image and match the points from the Control Points in warp_example1.net. See the Control Network input file for more details.

Input Image

Input image

Input image for warp

Parameter Name: FROM

This is the input image for the warp examples.

Data File

Links open in a new window.
Control Network input file. This is the required input for the CNET parameter. In each control point there are two measures. Measure 1 is the point on the from cube you would like to map to measure 2.

Output Image

Output image showing results of the warp application.

Output image for warp

Parameter Name: TO

This is the output image for this example of warp. The Control Network file link below contains the points required to create this kind of a warp output.


Example 2

Warp Example 2

Description

Warp Example 2

Command Line

warp warp from=warp_from.cub to=warp_example2.cub cnetl=warp_example2.net osize=user onl=1000 ons=1000
This warp command will warp the from cube (warp_from.cub) which is a 100Sx1000L image, to a 1000Sx1000L image and match the points from the Control Points in warp_example1.net. See the Control Network input file for more details.

Input Image

Input image

Input image for warp

Parameter Name: FROM

This is the input image for the warp examples.

Data File

Links open in a new window.
Control Network input file. This is the required input for the CNET parameter. In each control point there are two measures. Measure 1 is the point on the from cube you would like to map to measure 2.

Output Image

Output image showing results of the warp application.

Output image for warp

Parameter Name: TO

This is the output image for this example of warp. The Control Network file link below contains the points required to create this kind of a warp output.


Example 3

Warp Grid Example 3

Description

This example shows the effect warm has on a grid. A 1000x1000 image with grid lines every 50 pixels was created. The control net file has 4 points where the upper right and lower left corners were held. The upper left and lower right points were move to 100,1 and 800,800, respectively.

Command Line

warp warp from=grid_raw.cub to=grid_warp_weight.cub cnet=warp_points.net osize=user onl=1000 ons=1000 interp=bilinear
This warp command will warp the from cube (grid_raw.cub) which is a 1000Sx1000L image, to a 1000Sx1000L image and match the points from the Control Points in warp_points.net. See the Control Network input file for more details.

Input Image

Input image

Input image for warp

Parameter Name: FROM

This input file is a 1000x1000 size image with grid lines at 50x50 increments.

Data File

Links open in a new window.
Control Network input file. This is the require input for the CNET parameter. In each control point there are two measures. Measure 1 is the point on the from cube you would like to map to measure 2.

Output Image

Output image showing results of the warp application.

Output image for warp

Parameter Name: TO

This is the output image for this example of warp. The Control Network file link below contains the points required to create this kind of a warp output.