Skip to content
Snippets Groups Projects
Commit 4f2a7ee1 authored by Sanders, Austin Ray's avatar Sanders, Austin Ray
Browse files

Added General Processing Docs

parent af4ad35b
No related branches found
No related tags found
No related merge requests found
Showing
with 922 additions and 0 deletions
docs/assets/spatial_filters/lowpass_21x21.png

4.58 KiB

docs/assets/spatial_filters/lowpass_3x3.png

5.36 KiB

docs/assets/spatial_filters/lowpass_7x7.png

5.13 KiB

docs/assets/spatial_filters/lowpass_original.png

5.49 KiB

docs/assets/striping/high_pass.png

121 KiB

docs/assets/striping/low_pass.png

15.4 KiB

docs/assets/striping/striping.png

122 KiB

docs/assets/striping/striping_close_up.png

23.4 KiB

docs/assets/striping/sum.png

121 KiB

# Overview of Noise and Artifacts
-----
Noise and artifact are terms used to describe speckles, spikes, reseaus,
missing data, and other marks, blemishes, defects, and abnormalities in
image data created during the acquisition, transmission, and processing
of image data. The line between the definitions of artifact and noise is
fuzzy (and often subject to opinion), and often the terms are used
interchangeably. Some noise and artifacts are expected, even
purposefully added, and can be removed during the radiometric
calibration process.
## What is noise?
-----
In image processing, noise is a type of flaw or blemish in the image
caused by:
- Telemetry data dropouts or transmission errors
- Malfunctioning or dead detectors
- Read noise native to the CCD system
- Coherent noise caused by spurious electronic signals from the
operation of instruments onboard the spacecraft
Noise can take the appearance of speckling, missing data, random or
orderly patterns, and other variations that cause the image to have a
muddled appearance, or visually distracting blemishes or patterns. There
are three categories of noise:
- **Fixed-location noise** always exists at the same location in the
image array, with predictable positions. Fixed location noise can be
cosmetically corrected by replacing the bad pixels with the weighted
average of the unaffected neighborhood pixels. Fixed-location noise
can result from malfunctioning or dead detectors.
- **Randomly occurring noise** results from data transmission errors
causing data bits to be altered at random intervals in the image.
The random noise produces discrete, isolated pixel variations or
"spikes" and gives an image a "salt-and-pepper" appearance.
Additionally, telemetry drop-outs can cause portions of an image to
be completely missing. This type of noise is generally corrected
using filtering techniques that recognize missing or anomalous data
pixels and replaces these data points with a weighted average of the
unaffected neighborhood pixels.
- **Coherent noise** can be introduced by spurious electronic signals
produced by the operation of instruments onboard the spacecraft
during image observations. The spurious signals interfere with the
electronics of the imaging system, causing coherent noise patterns to
be electronically "added" to the images. For example, the shuttering
electronics of the Viking cameras introduced a spurious
"herring-bone" pattern at the top and bottom of the image.
Noise-removal algorithms are designed to correct specific coherent
noise problems such as this one.
## What are artifacts?
-----
Generally, image artifacts are a type of flaw or blemish in the image
introduced during processing, intentionally introduced due to the design
of system or unintentional introduction of debris or energy external to
the system. Examples of artifacts include:
- reseaus etched on the camera lens
- reseaus exposed on photographic film during pre-flight preparations
for a mission
- minute dust specks located in the optical path or on the focal plane
array
- cosmic rays and other charged particles impacting the sensor
(particularly CCDs)
- fringe, ring, or visible patterns created during filtering, ratio
analysis, and other enhancement processes
- quantization, checkerboarding, and other artifacts introduced by
image compression algorithms during conversion from Isis cube format
to a lossy image format or bit-type reductions that reduce the tonal
resolution of the data
Most artifacts fit neatly into the categories of noise listed earlier
and are corrected using many of the same processes. For example, dust
specks create fixed-location blemishes, and cosmic rays cause random
spikes. Reseaus are useful blemishes that are removed once they are
analyzed for their locations within an image and the information saved
for later processing.
### Reseaus, dropped data, and salt-and-pepper
This example shows a number of noise and artifact types. The large, regularly spaced black dots across the image are caused by the reseaus on the camera lens. The pattern of vertical black lines across the bottom of the image was caused by transmission data loss. The black and white speckles, called salt-and-pepper, are random noise.
<figure markdown>
![Noise\_Dropped\_Salt\_Pepper.png](../../assets/noise/Noise_Dropped_Salt_Pepper.png "Salt_Pepper")
<figcaption>An image with a "salt and pepper" artifact.</figcaption>
</figure>
### Instrument error
The black streak running down the right side of this image may have been caused by an unusual error in the line-scanner camera that acquired this image.
<figure markdown>
![Noise\_Instrument\_Error.png](../../assets/noise/Noise_Instrument_Error.png "Instrument_Error")
<figcaption>An image with noise from an instrument error.</figcaption>
</figure>
### Transmission error
A glitch during the transmission of this image caused the data to become garbled (upper right) and some data was completely lost (the black area across the middle).
<figure markdown>
![Noise\_Transmission\_Error.png](../../assets/noise/Noise_Transmission_Error.png "Transmission_Error")
<figcaption>An image with noise from a transmission error.</figcaption>
</figure>
### Image compression
Exporting the image to a lossy, compressed image format (using very high compression), the compression algorithm introduced a tiled pattern across the image.
<figure markdown>
![Noise\_Compression.png](../../assets/noise/Noise_Compression.png "Noise_Compression")
<figcaption>An image with compression</figcaption>
</figure>
# Overview of Radiometric Calibration
## Why perform radiometric calibration?
-----
Both vidicon cameras (such as those carried on-board the Viking and
Voyager missions), and charge coupled device (CCD) cameras (such as on
the Clementine, Mars Reconnaissance Orbiter, and other contemporary
missions) produce digital images with the inherent artifact known as
camera shading. Camera shading results from the non-uniform sensitivity
across the field-of-view of the imaging instrument.
This image (acquired during pre-flight calibration by a Mars Exploration
Rover Microscopic Imager) illustrates camera shading. Ideally, every
pixel in the image should have the same DN. Radiometric calibration
corrects this type of non-uniform brightness:
<figure markdown>
![Flat\_Field\_MERMI.png](../../assets/radiometric_calibration/Flat_Field_MERMI.png)
<figcaption>Flat Field Image</figcaption>
</figure>
Perhaps the best way to illustrate camera shading is to imagine
acquiring a digital image of a target of uniform brightness, say a
screen that has been painted a uniform shade of gray. If the camera
sensitivity across the fields-of-view were ideal (and the flat-field
target exactly the same brightness everywhere), then the acquired
digital image would have the same DN value for all the pixels in the
image. However, because of the non-uniform sensitivity of the camera,
the DN values of the resulting image will vary throughout the image
array (see the example to the right). A typical camera may have as much
as 20% variation across the field-of-view. Camera shading corrections
are applied to an image that correct for the non-uniform sensitivity so
that, in our flat-field observation example, the radiometrically
corrected image would contain pixels of identical value.
## What is radiometric calibration?
-----
Radiometric calibration recalculates the DNs in an image based on
numerous factors, such as the exposure time, known values for the camera
shading based on flat-field observations, dark current (output current
of a detector when no energy is incident on the detector, such as when
the shutter is closed), and other factors describing the unique
electronics design and characteristics of an imaging system. Camera
sensitivity may be time-dependent because of the drift of the camera
sensitivity throughout the course of the mission. The camera sensitivity
is also dependent on the filter, operating modes of the instrument, and
temperature of the cameras. Additionally, the camera response may be
non-linear at various brightness levels.
## How is the image changed by radiometric calibration?
-----
A radiometrically calibrated image has DNs in radiometric units that are
proportional to the brightness of a scene. Radiometric calibration
applications in Isis produce output values that represent either:
- **Radiance** - The amount of electromagnetic energy emitted or
reflected from an area of a planet, in units of µw/(cm2\*sr)
- **Reflectance** - The ratio of reflected energy to incoming energy
(i.e. irradiance/solar flux, often simply called **I/F** ). A
reflectance would be 1.0 for an ideal 100% reflector where the sun
and camera orientations are perpendicular to the reflecting surface.
Generally, Isis radiometric calibration applications that offer both
reflectance and radiance output will output reflectance (I/F) by
default. Due to the fact that radiometric calibration is mission
dependent, each mission supported by Isis has its own radiometric
calibration application. A few examples of radiometric calibration
applications in Isis are:
- [**vikcal**](https://isis.astrogeology.usgs.gov/Application/presentation/Tabbed/vikcal/vikcal.html)
: Viking Orbiter Visual Imaging System
- [**moccal**](https://isis.astrogeology.usgs.gov/Application/presentation/PrinterFriendly/moccal/moccal.html)
: Mars Global Surveyor Mars Orbiter Camera
See Also: [Mission Specific
Programs](http://isis.astrogeology.usgs.gov/Application/index.html)
\ No newline at end of file
# The Power of Spatial Filters
## What is an Image Filter?
In the most basic sense, a filter is a mechanism that removes something from whatever passes through it. An image filter blocks or passes through image data based on what kind of filter it is. A low pass filter allows low frequency data, or data that does not change much from pixel to neighboring pixel, to pass through, removing the high frequency data, or data that changes rapidly from pixel to neighboring pixel. Conversely, a high pass filter allows high frequency data to pass, removing low frequency data.
Image filters have a wide variety of uses, such as noise removal, edge enhancement, creating an embossed appearance, and making an image appear crisper and sharper.
This image shows a portion of the original image data (upper left),
and the results of three different filters applied to the original:
low pass (upper right), high pass (lower left), and sharpen (lower right)
<figure markdown>
![Image Filter](../../assets/spatial_filters/filter_comparison.png)
<figcaption>A Comparison of Spatial Filters</figcaption>
</figure>
## What is a Box Car?
In general, image filters operate by performing a mathematical operation on each pixel using the pixels surrounding it to generate the result. For instance, a low pass filter changes the value of each pixel in the image to the average of it and the pixels in its neighborhood.
The filter's box car size determines how big that neighborhood is. For instance, a 3x3 box car is 3 samples (pixels wide) by 3 lines (pixels high) with the target pixel in the center of the box car. The filter moves through every pixel in the image, performing the same mathematical operation using the surrounding pixels in its neighborhood, or box car, to determine the target pixel’s new value.
Changing the box car size determines how features in the image are affected. In general, small box cars affect small features, large box cars affect large features, tall and narrow box cars affect vertical features, and short and wide box cars affect horizontal features.
<figure markdown>
![Box Car](../../assets/spatial_filters/box_car.png)
<figcaption>Illustration of a Box Car Iterating Over an Image</figcaption>
</figure>
A filter processes each pixel in the image. The output pixel will be at the same location as the pixel of the center of the box car. The filter calculates the new output value of that pixel using all the input pixels in the box car. The animation (linked below) illustrates the movement of the filter application through the input image, and where the box car neighborhood is located.
## The Low Pass Filter
### Basics of the Low Pass Filter
A low pass filter allows low frequency data, or data that does not change much from pixel to neighboring pixel, to pass through, removing the high frequency data, or data that changes rapidly from pixel to neighboring pixel. The visible result is the image appears blurred or smoothed. The amount of blur depends on the size of the box car. Low pass filters affect features smaller than the box car size. A small box car will cause a slight blur and reduce the amount of difference between small areas and their surrounding regions. For an image that contains a lot of noise, such a filter would smooth out the image and reduce the noise with minimal effect on large features in the image. A low pass filter with large box car will affect large features in the image, and will reduce or eliminate the smaller features.
<figure class="inline" markdown>
![Lowpass Original](../../assets/spatial_filters/lowpass_original.png){width=250px}
<figcaption>Original</figcaption>
</figure>
<figure markdown>
![Lowpass 3x3](../../assets/spatial_filters/lowpass_3x3.png){width=250px}
<figcaption>3x3 Low Pass</figcaption>
</figure>
<figure class="inline" markdown>
![Lowpass 7x7](../../assets/spatial_filters/lowpass_7x7.png){width=250px}
<figcaption>7x7 Low Pass</figcaption>
</figure>
<figure markdown>
![Lowpass 21x21](../../assets/spatial_filters/lowpass_21x21.png){width=250px}
<figcaption>21x21 Low Pass</figcaption>
</figure>
!!! NOTE "Boxcar Size Effects Features"
As the size of the boxcar increases, the edges of features begin to soften and eventually lead to the destruction of features.
-----
### The Algorithm
The mathematical operation the low pass filter performs in order to achieve these effects is to replace each pixel in the image with the average of all the pixel values in the box car.
### Running ISIS3 lowpass
The ISIS3 lowpass application allows you to set what the low and high values that will be included in this operation are and which types of pixels will be changed by the operation. See the [lowpass](https://isis.astrogeology.usgs.gov/Application/presentation/Tabbed/lowpass/lowpass.html) documentation’s parameters section for a full list of parameters and their description.
### Uses of the Low Pass Filter
For remote sensing analysis, low pass filtering is useful for subduing or removing detail and enhancing large features or albedo. Choose the box car size based on the size of the details you wish to remove or subdue. In image processing, low pass filters can serve to remove noise, reduce resolution (without reducing the image size), or subdue details in one step of a procedure. In more complicated image processing procedures, the low pass filtered image can be used to return image hues and coloring to the resulting image after other processing procedures have removed them in the process of enhancing details.
### Fill-in NULL pixels
The lowpass application can be used to replace Special Pixels with the average of surrounding valid pixels. The average is computed based on the boxcar size (line X sample) that is specified.
!!! EXAMPLE "Filling-in NULL pixels:"
` lowpass from=input_with_nulls.cub to=output_fill.cub samples=3 lines=3 filter=outside null=yes hrs=no his=no lrs=no replacement=center `
- The average of valid pixels will be computed based on the size of the boxcar (line x sample)
- The larger the boxcar size, the 'smoother' the resulting average will be
- If the desired output is to fill with 'details', the approach would be to fill in with small boxcar sizes (3x3, 5x5) until the special pixel value areas are filled in.
- If any special pixels assigned to be replaced remain in the output, lowpass can be applied consecutively until the desired special pixels are completely filled with surrounding averages.
### Similar Filters
- [gauss](https://isis.astrogeology.usgs.gov/Application/presentation/Tabbed/gauss/gauss.html) uses a weighted average to compute the new value for the target pixel, with the weight based on the Gaussian distribution as a function of the distance of the boxcar pixel from the target
- [noisefilter](https://isis.astrogeology.usgs.gov/Application/presentation/Tabbed/noisefilter/noisefilter.html) determines what pixels are considered "noise" based on tolerances provided by the user, and replaces those noise pixels with either the average of the box car or a "null" value based on the user's choice
- [divfilter](https://isis.astrogeology.usgs.gov/Application/presentation/Tabbed/divfilter/divfilter.html) divides the original image values by the average of the boxcar, equivalent to dividing the original image by the low pass filter results of the same image using the ratio application
## The High Pass Filter
### Basics of the High Pass Filter
The high pass filter allows high frequency data to pass through, suppressing low frequency data. High pass filtering can be useful for finding edges, enhancing lines and edges, or sharpening an image. Small box cars will enhance small features and details. Large box cars will allow large features to pass through, suppressing or eliminating smaller features.
<figure class="inline" markdown>
![Highpass Original](../../assets/spatial_filters/lowpass_original.png){width=250px}
<figcaption>Original</figcaption>
</figure>
<figure markdown>
![Highpass 3x3](../../assets/spatial_filters/highpass_3x3.png){width=250px}
<figcaption>3x3 High Pass</figcaption>
</figure>
<figure class="inline" markdown>
![Highpass 7x7](../../assets/spatial_filters/highpass_7x7.png){width=250px}
<figcaption>7x7 High Pass</figcaption>
</figure>
<figure markdown>
![Highpass 21x21](../../assets/spatial_filters/highpass_21x21.jpeg){width=250px}
<figcaption>21x21 High Pass</figcaption>
</figure>
### The Algorithm
The mathematical operation the high pass filter performs in order to achieve these effects is to replace each pixel in the image with the difference between it and the average of all the pixel values in the box car. This filter can be viewed as a kind of slope filter, in that it highlights pixels that have values that are different from their neighboring pixels. The greater the difference, the higher or lower (visually: brighter or darker) the output value will be.
### Running ISIS3 highpass
The ISIS3 [highpass](https://isis.astrogeology.usgs.gov/Application/presentation/Tabbed/highpass/highpass.html) application allows you to set what the low and high values that will be included in the operation. You can also set the percentage of addback, which will add the original image (weighted by the percent addback chosen) to the high pass results. See the highpass documentation’s parameters section for a full list of parameters and their descriptions.
<figure class="inline" markdown>
![Highpass Original](../../assets/spatial_filters/lowpass_original.png){width=200px}
<figcaption>Original</figcaption>
</figure>
<figure class="inline" markdown>
![Highpass Original](../../assets/spatial_filters/highpass_3x3_50addback.png){width=200px}
<figcaption>3x3 High Pass with 50% addback</figcaption>
</figure>
<figure markdown>
![Highpass 3x3](../../assets/spatial_filters/highpass_3x3_100addback.png){width=200px}
<figcaption>3x3 High Pass with 100% addback</figcaption>
</figure>
### Uses of the High Pass Filter
For remote sensing analysis, high pass filtering is useful for reducing albedo features and enhancing structural details. Choose the box car size based on the size of the structural details you wish to enhance. In image processing, high pass filters can serve to sharpen a fuzzy image when used with addback. In more complicated image processing procedures, the high pass filtered image can be used to return image details to the resulting image after other processing procedures have removed them in the process of removing noise or artifacts.
### Similar Filters
- [sharpen](https://isis.astrogeology.usgs.gov/Application/presentation/Tabbed/lowpass/lowpass.html) is a specialized high pass filter that has a preset addback value of 100%, resulting in an image which looks similar to the original, but crisper and sharper
\ No newline at end of file
# General Utility with FX
## Introduction
-----
The suite of ISIS3 image processing applications perform a wide variety
of functions to manipulate the image data. Occasionally, there is a need
to apply a unique set of equations to correct or produce an image that
none of the existing programs will perform, such as applying a gamma
stretch or creating a cube file based on a mathematical equation. In
these instances, using the **fx** program may accomplish the task. The
application is still under development, so it may take multiple steps,
especially if the AND and/or OR logical operators are needed. The
modulus (%), AND, and OR operators are not implemented yet.
## String Parameters
-----
The command line parsing has been improved to handle escape sequences
and support arrays better. The equation parser is case-insensitive,
ignores whitespace, and converts all braces to parentheses.
The command line syntax changes are as follows (with TCSH/BASH
examples):
Parameter values, when quoted, no longer need the quotes escaped:
**TCSH/BASH**
Before:
crop from=\"some file.cub\" to=\"output file.cub\"
Now:
crop from="some file.cub" to="output file.cub"
Please note that dollar signs ($) still need to be backslashed for
batchlist variables.
Array values, for programs such as spiceinit, will be much the same.
**TCSH**
Before:
spiceinit from=input.cub ck='(file1.bc,file2.bc)'
Now:
spiceinit from=input.cub ck='(file1.bc,file2.bc)'
**BASH**
Before:
spiceinit from=input.cub ck='(file1.bc,file2.bc)'
Now:
spiceinit from=input.cub ck='(file1.bc,file2.bc)'
However, an escape has been added to differentiate a first parenthesis
from the beginning of an array sequence.
**TCSH**
Before:
fx equation='"(1+2)/2"'
Now:
fx equation='\(1+2)/2'
**BASH**
Before:
fx equation='"(1+2)/2"'
Now:
fx equation=\(1+2)/2
The equation string entered within a GUI interface may not work if the
entire string is copied, and executed at the command line. If the first
character in the equation is a "(" then it must be prefixed by a "\\" if
executing at the command line, but the remaining parentheses do not need
to be prefixed with a backslash.
For example:
Works inside **fx** GUI:
fx f1=BIFQF23N004_D218_T069S02_V02_I3.cub to=tt.cub equation=(f1*(f1>.004))
Fails on the command line:
fx f1=BIFQF23N004_D218_T069S02_V02_I3.cub to=tt.cub equation=(f1*(f1>.004))
fx f1=BIFQF23N004_D218_T069S02_V02_I3.cub to=tt.cub equation="(f1*(f1>.004))"
Works on the command line:
fx f1=BIFQF23N004_D218_T069S02_V02_I3.cub to=tt.cub equation="\(f1*(f1>.004))"
For additional information, see [**fx command
page**](http://isis.astrogeology.usgs.gov/Application/presentation/Tabbed/fx/fx.html)
Note: some instructions may be outdated.
## Input Data
-----
The input data can be a single band or multiple band cube file. Up to
five files can be entered for parameters *f1 to f5* , or an arbitrary
number of files can be included in a file list and entered for the
*fromlist* parameter. The other option is to only create an output file
based on a user defined equation. If the band number is not specified
for the multiple band cube files, then the equation is applied to all
the bands in the file.
**Example**
```
f1=file1.cub f2=file2.cub f3=file4.cub f5=file5.cub
```
or
ls *lev1.cub > files.lis
from=files.lis
## Requirements and result of operators
-----
The following operators return a "0" or "1" DN value when they are used
in the equations:
- <
- \>
- <=
- \>=
- ==
- \!=
The following operators require that the images be run through
**spiceinit** first, so that the necessary information can be extracted
based on the camera model information stored in the image labels:
- pha, phal, phac
- ina, inal, inac
- ema, emal, emac
- lat
- lon
- radius
- resolution
The following are used to convert between degrees and radians:
- rads
- degs
***Note: All trigonometric functions expect angles in radians, not
degrees. However, all camera functions return angles in degrees and
therefore should be converted to radians***
The following operators use the input image statistics to apply the
equations:
- linemin
- linemax
- cubemin
- cubemax
- cubeavg
- cubestd
The following are used to compare two input values (user entered and/or
from input files):
- min
- max
The following shifts the pixels left or right:
- <<
- \>\>
For example:
```
f1 << 10
```
```
S1 L1 = S10 L1
S2 L1 = S11 L1
...
SN-10 L1 = Null
SN-9 L1 = Null
```
Trigonometric functions:
- sin, cos, tan
- acos, atan, atan2
- sinh, cosh, tanh
- csc, sec, cot
Operators:
- \+ - \* / ^
- abs, sqrt, neg or --
- log10,log or ln
## Create only an output file
-----
The example below uses the line number (representing degrees) as input
into the cosine function to create a (100 lines by 100 samples) output
file. Input values representing *degrees* must be used with caution
because different results are produced if the input value is not
converted to radians first or the output not converted back to degrees:
Example 1:
fx to=test_cosrad.cub equation="cos(rads(line))" mode=outputonly lines=100 samples=100
<figure markdown>
![FX Cosine Radians](../../assets/fx/Fx_cosine_of_LineNum_radian.png)
<figcaption>Cosine Function of Line Numbers After Converting to Radians</figcaption>
</figure>
Example 2:
fx to=test_cos.cub equation=cos(line) mode=outputonly lines=100 samples=100
<figure markdown>
![FX Cosine](../../assets/fx/Fx_cosine_of_LineNum.png)
<figcaption>Cosine Function of Line Numbers Without Converting to Radians</figcaption>
</figure>
## Apply equations to existing cube files
-----
### Create an output cube that isolates all pixel values greater than .00015 for band 1:
fx f1=I10645014RDR.lev1crop.cub+1 to=mask1.cub equ="f1>.00015"
<figure markdown>
![Equation](../../assets/fx/Fx_mask_singleband_example.png)
<figcaption>Image Created with Equation "f1\>.00015"</figcaption>
</figure>
Note: The DN values are now "0" and "1"
### Create an output cube that isolates all pixel values greater than .00015 for band1 and retains the input DN values:
fx f1=I10645014RDR.lev1crop.cub+1 to=mask2.cub equ="f1*(f1>.00015)"
<figure markdown>
![Equation](../../assets/fx/Fx_mask_singleband_example2.png)
<figcaption>Image Created with Equation "f1* (f1\>.00015)"</figcaption>
</figure>
Note: The DN values are now "0" in the areas where the input values were
less than 0.00015
### Create an output cube that isolates all pixel values greater than .00015 for all bands:
fx f1=I10645014RDR.lev1crop.cub to=mask3.cub equ="f1*(f1>.00015)"
<figure markdown>
![Equation mask all bands](../../assets/fx/Fx_mask_allbands_example.png)
<figcaption>Image Created with Equation "f1* (f1\>.00015)"</figcaption>
</figure>
Note: The DN values are now "0" in the areas where the input values were
less than 0.00015 in all ten bands, and appears as green in the color
file.
Below is the image label of the multiple band cube used as input in the
example above. Notice there is no instrument information, so this
particular file cannot be run through spiceinit. In addition, none of
the functions requiring a camera model can be used on the 10 band cube
file.
```
Object = IsisCube
Object = Core
StartByte = 65537
Format = Tile
TileSamples = 320
TileLines = 500
Group = Dimensions
Samples = 320
Lines = 2500
Bands = 10 *** NOTE: multiple bands ***
End_Group
Group = Pixels
Type = Real
ByteOrder = Lsb
Base = 0.0
Multiplier = 1.0
End_Group
End_Object
Group = BandBin
Center = (6.78, 6.78, 7.93, 8.56, 9.35, 10.21, 11.04, 11.79, 12.57,
14.88)
Width = (1.01, 1.01, 1.09, 1.16, 1.20, 1.10, 1.19, 1.07, 0.81,
0.87)
OriginalBand = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
End_Group
Group = AlphaCube
AlphaSamples = 320
AlphaLines = 10768
AlphaStartingSample = 0.5
AlphaStartingLine = 2859.5
AlphaEndingSample = 320.5
AlphaEndingLine = 5359.5
BetaSamples = 320
BetaLines = 2500
End_Group
End_Object
Object = Label
Bytes = 65536
End_Object
```
### Apply a gamma stretch to an input file:
fx f1=B10_013516_1520_XN_28S285W_eo.cub to=B10_013516_1520_XN_28S285W_eo_gst.cub equation="{[cubemax(f1)-abs(cubemin(f1))]*{[f1-abs(cubemin(f1))]/[cubemax(f1)-abs(cubemin(f1))]}^(1.0/1.8)}
<figure markdown>
![Gamma Stretch](../../assets/fx/Fx_CTX_pre_post_gamma_stretch_example.png)
<figcaption>Image created with the equation="{\[cubemax(f1)-abs(cubemin(f1))\]"</figcaption>
</figure>
The CTX image has instrument information that can be used with some of
the functions that require camera model information. The following is a
partial list of the label contents to show as an example:
```
Object = IsisCube
Object = Core
StartByte = 65537
Format = Tile
TileSamples = 500
TileLines = 512 <br>
Group = Dimensions
Samples = 5000
Lines = 52224
Bands = 1
End_Group
Group = Pixels
Type = Real
ByteOrder = Lsb
Base = 0.0
Multiplier = 1.0
End_Group
End_Object
Group = Instrument
SpacecraftName = Mars_Reconnaissance_Orbiter
InstrumentId = CTX
TargetName = Mars
MissionPhaseName = PSP
StartTime = 2008-06-09T20:17:54.712
SpacecraftClockCount = 0897509894:216
OffsetModeId = 196/190/181
LineExposureDuration = 1.877 <MSEC>
FocalPlaneTemperature = 292.4 <K>
SampleBitModeId = SQROOT
SpatialSumming = 1
SampleFirstPixel = 0
End_Group
Group = Archive
DataSetId = MRO-M-CTX-2-EDR-L0-V1.0
ProductId = '''''P20_008770_1328_XI_47S308W'''''
ProducerId = MRO_CTX_TEAM
ProductCreationTime = 2009-01-20T23:37:21
OrbitNumber = 8770
End_Group
Group = BandBin
FilterName = BroadBand
Center = 0.65 <micrometers>
Width = 0.15 <micrometers>
End_Group
Group = Kernels
NaifFrameCode = -74021
LeapSecond = $base/kernels/lsk/naif0009.tls
TargetAttitudeShape = $base/kernels/pck/pck00009.tpc
TargetPosition = (Table, $base/kernels/spk/de405.bsp)
InstrumentPointing = (Table,
$mro/kernels/ck/mro_sc_psp_080603_080609.bc,
$mro/kernels/fk/mro_v14.tf)
Instrument = Null
SpacecraftClock = $mro/kernels/sclk/MRO_SCLKSCET.00046.65536.tsc
InstrumentPosition = (Table, $mro/kernels/spk/mro_psp7.bsp)
InstrumentAddendum = $mro/kernels/iak/mroctxAddendum004.ti
ShapeModel = $base/dems/molaMarsPlanetaryRadius0005.cub
InstrumentPositionQuality = Reconstructed
InstrumentPointingQuality = Reconstructed
CameraVersion = 1
End_Group
Group = Radiometry
FlatFile = /usgs/cpkgs/isis3/data/mro/calibration/ctxFlat_0002.cub
iof = 2.10004797011897e-04
End_Group
End_Object
```
### Create an output cube that divides the input pixel by the cosine of the incidence angle to perform a simple photometric correction:
fx f1=P20_008770_1328_XI_47S308W_eo.cub to=fx_cosi.cub equation="f1/cos(rads(ina(f1)))
<figure markdown>
![Cosine inc angle](../../assets/fx/Fx_cosine_inc_angle.png)
<figcaption>Image created with the equation="f1/cos(rads(ina(f1)))"</figcaption>
</figure>
Note: The brightness of the image on the right has been normalized
throughout the image.
## Other command line entry exles:
-----
Output data values in logarithmic form using three different options:
Option 1:
fx f1=BIF_I3.cub to=BIB_test.cub+Lsb+BandSequential+Attached+UnsignedByte+-20.05:5.35<br>
equation="max(-20.0,min{10.0*log10[max(0.01,f1)],5.0})"
Option 2:
fx f1=BIF_I3.cub to=BIB_test.cub+Lsb+BandSequential+Attached+UnsignedByte+-20.05:5.35
equation="max(min(10.0*log10(max(f1,0.01)),5.0),--20.0)"
Option 3:
fx f1=BIF_I3.cub to=BIB_test.cub+Lsb+BandSequential+Attached+UnsignedByte+-20.05:5.35
equation="max(neg (20.0),min{10.0*log10[max(0.01,f1)],5.0})"'
Other examples of applying algebraic equations:
fx f1=test1.cub f2=test2.cub equ="\(f1-f2)/(f1+f2)" to=result.cub
fx f1=test1.cub f2=test2.cub equ="f1-(f2*0.77)" to=result.cub
fx f1=test.cub to=new_test.cub equation="f1/cos(rads(pha(f1)))"
fx f1=test1.cub f2=test2.cub f3=test3.cub f4=test4.cub equation="\(sqrt(f2^2+f3^2+f4^2))/f1" to=test.cub
# Removing Striping Noise
## Summary of the Method
Destriping is a common procedure used on images to remove distracting horizontal or vertical noise in an image. This type of destriping involves running two filters on the original image creating two new images, a low pass filtered image and a high pass filtered image, and combining the results.
<figure markdown>
![Striping](../../assets/striping/striping.png)
<figcaption>Example of striping</figcaption>
</figure>
This Lunar Orbiter image contains horizontal striping noise due to the scanning, output, and transmission phases of its collection.
## Concepts
If both a low pass and a high pass filter of the same size are run on an image and then added together, the result will be the original image. If the filter sizes are not the same, the result will not be exactly the same as the original. The goal in choosing sizes for the two filters is to create an output for each without the unwanted striping. If this is accomplished, when the filter outputs are added together, the striping will have been removed or subdued. If the sizes of the two filters differ too much, artifacts may be introduced into the result. This type of procedure works very well on horizontal and vertical striping, but is not recommended for diagonal striping.
## Related ISIS3 Application
See the following ISIS3 documentation for information about the applications you will need to use to perform this procedure:
- [lowpass](https://isis.astrogeology.usgs.gov/Application/presentation/Tabbed/lowpass/lowpass.html) - low pass filter application
- [highpass](https://isis.astrogeology.usgs.gov/Application/presentation/Tabbed/highpass/highpass.html) - high pass filter application
- [algebra](https://isis.astrogeology.usgs.gov/Application/presentation/Tabbed/algebra/algebra.html) - used to add the results of the low and high pass filters
## Some general tips for choosing the filter sizes
- The boxcar shapes for both the low pass and high pass filters should be similar in shape to the striping. This is not a firm rule. The filter sizes can be opposite (i.e., long and short -vs- narrow and tall).
- The size of the low pass filter should be large enough to completely encompass the problem, plus enough extra pixels to keep the average of any boxcar from being overly effected by the striping. A good rule of thumb to start with is a low pass boxcar size twice the size of the striping.
- The size of the high pass filter should be small enough to completely fit inside the problem, minus enough pixels to keep the average of any boxcar from being overly effected by the striping. A good rule here is to make the high pass filter boxcar size less than one half the size of the striping.
<figure markdown>
![Image Filter](../../assets/striping/striping_close_up.png)
<figcaption>Striping Close-Up</figcaption>
</figure>
Enlarged view to show the height of the striping. The blocks in the scale bar along the left side of the image measure a 3 pixel by 3 pixel area. The stripes are roughly 7 to 10 pixels high.
## Destriping Example
The image used in this example is a sub-area of a Lunar Orbiter filmstrip. The scanning, output, and transmission phases introduced some striping noise.
<figure markdown>
![Striping](../../assets/striping/striping.png)
<figcaption>Example of striping</figcaption>
</figure>
This Lunar Orbiter image contains horizontal striping noise due to the scanning, output, and transmission phases of its collection
<figure markdown>
![Low Pass](../../assets/striping/low_pass.png)
<figcaption>Low Pass Filter</figcaption>
</figure>
This image is the result of running a low pass filter on the original image, with a boxcar shape that is very wide but not very tall
<figure markdown>
![High Pass](../../assets/striping/high_pass.png)
<figcaption>High Pass Filter</figcaption>
</figure>
This image is the result of running a high pass filter on the original image, with a boxcar shape that is very wide and very short
<figure markdown>
![Sum](../../assets/striping/sum.png)
<figcaption>Sum of High and Low pass filters</figcaption>
</figure>
......@@ -48,6 +48,8 @@ nav:
- SPICE Kernel Updates in ISIS: how-to-guides/Environment Setup and Maintenance/SPICE Kernel Updates in ISIS.md
- Image Processing:
- Map Projecting Images: how-to-guides/Image Processing/Map Projecting Images.md
- Removing Striping Noise: how-to-guides/Image Processing/Removing Striping Noise.md
- General Utility with FX: how-to-guides/Image Processing/General Utility with FX.md
- Software Management:
- ISIS Public Release Process: how-to-guides/Software Management/Public Release Process.md
- Software Support: how-to-guides/Software Management/Software Support.md
......@@ -63,6 +65,10 @@ nav:
- Camera Geometry and Projections:
- Camera Geometry: concepts/Camera Geometry and Projections/Camera Geometry.md
- Learning About Map Projections: concepts/Camera Geometry and Projections/Learning About Map Projections.md
- Image Processing:
- The Power of Spatial Filters: concepts/Image Processing/The Power of Spatial Filters.md
- Overview of Noise and Artifacts: concepts/Image Processing/Overview of Noise and Artifacts.md
- Overview of Radiometric Calibration: concepts/Image Processing/Overview of Radiometric Calibration.md
- Manuals: manuals/index.md
extra_css:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment