Isis 3 Programmer Reference
Isis::RollingShutterCameraDetectorMap Class Reference

Convert between parent image coordinates and detector coordinates. More...

#include <RollingShutterCameraDetectorMap.h>

Inheritance diagram for Isis::RollingShutterCameraDetectorMap:
Inheritance graph
Collaboration diagram for Isis::RollingShutterCameraDetectorMap:
Collaboration graph

Public Member Functions

 RollingShutterCameraDetectorMap (Camera *parent, std::vector< double > times, std::vector< double > sampleCoeffs, std::vector< double > lineCoeffs)
 Constructs a RollingShutterCameraDetectorMap.
 
virtual ~RollingShutterCameraDetectorMap ()
 Destructor.
 
virtual bool SetParent (const double sample, const double line)
 Compute detector position from a parent image coordinate.
 
virtual bool SetParent (const double sample, const double line, const double deltaT)
 Compute detector position from a parent image coordinate.
 
virtual bool SetDetector (const double sample, const double line)
 Compute parent position from a detector coordinate.
 
std::pair< double, double > applyJitter (const double sample, const double line)
 Iteratively finds a solution to "apply" jitter to an image coordinate.
 
std::pair< double, double > removeJitter (const double sample, const double line)
 Remove the distortion from the image (parent) coordinates.
 
double AdjustedStartingSample () const
 Return the starting detector sample adjusted for summation.
 
double AdjustedStartingLine () const
 Return the starting detector line adjusted for summation.
 
double ParentSample () const
 Return parent sample.
 
double ParentLine () const
 Return parent line.
 
double DetectorSample () const
 Return detector sample.
 
double DetectorLine () const
 Return detector line.
 
void SetStartingDetectorSample (const double sample)
 Set the starting detector sample.
 
void SetStartingDetectorLine (const double line)
 Set the starting detector line.
 
void SetDetectorSampleSumming (const double summing)
 Set sample summing mode.
 
void SetDetectorLineSumming (const double summing)
 Set line summing mode.
 
virtual double SampleScaleFactor () const
 Return scaling factor for computing sample resolution.
 
virtual double LineScaleFactor () const
 Return scaling factor for computing line resolution.
 
virtual double LineRate () const
 Return the line collection rate (0 for framing cameras)
 
virtual double exposureDuration (const double sample, const double line, const int band) const
 This virtual method is for returning the exposure duration of a given pixel.
 

Protected Attributes

Camerap_camera
 Pointer to the camera.
 
double p_parentSample
 The parent sample calculated from the detector.
 
double p_parentLine
 The parent line calculated from the detector.
 
double p_detectorLine
 Detector coordinate line value.
 
double p_detectorSample
 Detector coordinate sample value.
 
double p_detectorSampleSumming
 The scaling factor for computing sample resolution.
 
double p_detectorLineSumming
 The scaling factor for computing line resolution.
 
double p_startingDetectorSample
 Detector start coordinate sample value.
 
double p_startingDetectorLine
 Detector start coordinate line value.
 
double p_ss
 Start sample.
 
double p_sl
 Start line.
 

Private Member Functions

void Compute ()
 Compute new offsets whenenver summing or starting sample/lines change.
 

Private Attributes

std::vector< double > m_times
 List of normalized [-1, 1] readout times for all the lines in the input image.
 
std::vector< double > m_sampleCoeffs
 List of coefficients for the n-order polynomial characterizing the jitter in the sample direction.
 
std::vector< double > m_lineCoeffs
 List of coefficients for the n-order polynomial characterizing the jitter in the line direction.
 

Detailed Description

Convert between parent image coordinates and detector coordinates.

This class is used to convert between parent dector coordinates (sample/line) and detector coordinates for a rolling shutter camera.

See also
Camera
Author
2018-04-02 Makayla Shepherd and Ian Humphrey

Definition at line 29 of file RollingShutterCameraDetectorMap.h.

Constructor & Destructor Documentation

◆ RollingShutterCameraDetectorMap()

Isis::RollingShutterCameraDetectorMap::RollingShutterCameraDetectorMap ( Camera * parent,
std::vector< double > times,
std::vector< double > sampleCoeffs,
std::vector< double > lineCoeffs )

Constructs a RollingShutterCameraDetectorMap.

Parameters
timesA std::vector of normalized readout times
coeffsA std::vector of the coefficients of the polynomial that fit the jitter. The coefficients are from highest degree to lowest degree.
parentThe parent camera that uses the detector map.

Definition at line 25 of file RollingShutterCameraDetectorMap.cpp.

References m_lineCoeffs, m_sampleCoeffs, and m_times.

◆ ~RollingShutterCameraDetectorMap()

Isis::RollingShutterCameraDetectorMap::~RollingShutterCameraDetectorMap ( )
virtual

Destructor.

Definition at line 39 of file RollingShutterCameraDetectorMap.cpp.

Member Function Documentation

◆ AdjustedStartingLine()

double Isis::CameraDetectorMap::AdjustedStartingLine ( ) const
inherited

Return the starting detector line adjusted for summation.

Returns
(double) The starting line

Definition at line 123 of file CameraDetectorMap.cpp.

References Isis::CameraDetectorMap::p_sl.

◆ AdjustedStartingSample()

double Isis::CameraDetectorMap::AdjustedStartingSample ( ) const
inherited

Return the starting detector sample adjusted for summation.

Returns
(double) The starting sample

Definition at line 113 of file CameraDetectorMap.cpp.

References Isis::CameraDetectorMap::p_ss.

◆ applyJitter()

std::pair< double, double > Isis::RollingShutterCameraDetectorMap::applyJitter ( const double sample,
const double line )

Iteratively finds a solution to "apply" jitter to an image coordinate.

Each iteration adds jitter to the original image coordinate until it finds an image coordinate that maps back to to the original image coordinate when jitter is removed. This is similar to how we handle applying radial distortion.

Note: If the jitter varies significantly (>1 pixel difference) then it is possible for there to be multiple solutions to the inverse problem and it is impossible to know which one to choose.

Parameters
sampleImage sample to apply jitter to.
lineImage line to apply jitter to.
Returns
std::pair<double,double> Returns the image coordinate with jitter applied to it.

Definition at line 128 of file RollingShutterCameraDetectorMap.cpp.

References removeJitter(), and Isis::IException::Unknown.

Referenced by SetDetector().

◆ Compute()

◆ DetectorLine()

double Isis::CameraDetectorMap::DetectorLine ( ) const
inherited

Return detector line.

Returns
(double) The detector line

Definition at line 163 of file CameraDetectorMap.cpp.

References Isis::CameraDetectorMap::p_detectorLine.

Referenced by Isis::Camera::SetImage(), and Isis::Camera::SetImage().

◆ DetectorSample()

double Isis::CameraDetectorMap::DetectorSample ( ) const
inherited

Return detector sample.

Returns
(double) The detector sample

Definition at line 153 of file CameraDetectorMap.cpp.

References Isis::CameraDetectorMap::p_detectorSample.

Referenced by Isis::Camera::SetImage(), and Isis::Camera::SetImage().

◆ exposureDuration()

double Isis::CameraDetectorMap::exposureDuration ( const double sample,
const double line,
const int band ) const
virtualinherited

This virtual method is for returning the exposure duration of a given pixel.

For framing cameras, exposure duration is not available so it throws an error.

Parameters
sampleThe sample of the desired pixel.
lineThe line of the desired pixel.
bandThe band of the desired pixel.
Returns
double The exposure duration for the desired pixel in seconds.
Exceptions
IException::Programmer"Exposure duration is only available for LineScan, VariableLineScan, and PushFrame Cameras."

Reimplemented in Isis::LineScanCameraDetectorMap, Isis::PushFrameCameraDetectorMap, Isis::VariableLineScanCameraDetectorMap, and Isis::NirsDetectorMap.

Definition at line 212 of file CameraDetectorMap.cpp.

References Isis::IException::Programmer.

Referenced by Isis::Camera::exposureDuration(), and Isis::Camera::exposureDuration().

◆ LineRate()

double Isis::CameraDetectorMap::LineRate ( ) const
virtualinherited

Return the line collection rate (0 for framing cameras)

Returns
(double) The line collection rate

Reimplemented in Isis::ApolloPanoramicDetectorMap, Isis::LineScanCameraDetectorMap, and Isis::RadarPulseMap.

Definition at line 193 of file CameraDetectorMap.cpp.

Referenced by Isis::LineScanCameraSkyMap::SetSky().

◆ LineScaleFactor()

double Isis::CameraDetectorMap::LineScaleFactor ( ) const
virtualinherited

◆ ParentLine()

double Isis::CameraDetectorMap::ParentLine ( ) const
inherited

Return parent line.

Returns
(double) The parent line

Definition at line 143 of file CameraDetectorMap.cpp.

References Isis::CameraDetectorMap::p_parentLine.

Referenced by Isis::Camera::RawFocalPlanetoImage(), and Isis::Camera::SetRightAscensionDeclination().

◆ ParentSample()

double Isis::CameraDetectorMap::ParentSample ( ) const
inherited

Return parent sample.

Returns
(double) The parent sample

Definition at line 133 of file CameraDetectorMap.cpp.

References Isis::CameraDetectorMap::p_parentSample.

Referenced by Isis::Camera::RawFocalPlanetoImage(), and Isis::Camera::SetRightAscensionDeclination().

◆ removeJitter()

std::pair< double, double > Isis::RollingShutterCameraDetectorMap::removeJitter ( const double sample,
const double line )

Remove the distortion from the image (parent) coordinates.

This is a helper function for the SetParent method.

Parameters
sampleInput (parent) image sample coordinate.
lineInput (parent) image line coordinate.
Returns
std::pair<double,double> Returns a pair of doubles corresponding to the de-jittered sample and line. This is in image coordinates.

Definition at line 167 of file RollingShutterCameraDetectorMap.cpp.

References m_lineCoeffs, m_sampleCoeffs, and m_times.

Referenced by applyJitter(), and SetParent().

◆ SampleScaleFactor()

double Isis::CameraDetectorMap::SampleScaleFactor ( ) const
virtualinherited

Return scaling factor for computing sample resolution.

Returns
(double) The scaling factor for sample resolution

Definition at line 173 of file CameraDetectorMap.cpp.

References Isis::CameraDetectorMap::p_detectorSampleSumming.

Referenced by Isis::Camera::ObliqueSampleResolution(), and Isis::Camera::SampleResolution().

◆ SetDetector()

bool Isis::RollingShutterCameraDetectorMap::SetDetector ( const double sample,
const double line )
virtual

Compute parent position from a detector coordinate.

This method will compute a parent sample/line given a detector coordinate

Parameters
sampleSample number in the detector
lineLine number in the detector
Returns
conversion successful

Reimplemented from Isis::CameraDetectorMap.

Definition at line 101 of file RollingShutterCameraDetectorMap.cpp.

References applyJitter(), Isis::CameraDetectorMap::p_detectorLine, Isis::CameraDetectorMap::p_detectorLineSumming, Isis::CameraDetectorMap::p_detectorSample, Isis::CameraDetectorMap::p_detectorSampleSumming, Isis::CameraDetectorMap::p_parentLine, Isis::CameraDetectorMap::p_parentSample, Isis::CameraDetectorMap::p_sl, and Isis::CameraDetectorMap::p_ss.

◆ SetDetectorLineSumming()

void Isis::CameraDetectorMap::SetDetectorLineSumming ( const double summing)
inlineinherited

Set line summing mode.

Use this method to specify if detector lines are summed/averaged. That is, one image lines represents the average of N detectors. If not set the default is 1.

Parameters
summingLine summing mode

Definition at line 123 of file CameraDetectorMap.h.

References Isis::CameraDetectorMap::Compute(), and Isis::CameraDetectorMap::p_detectorLineSumming.

Referenced by Isis::CrismCamera::CrismCamera().

◆ SetDetectorSampleSumming()

void Isis::CameraDetectorMap::SetDetectorSampleSumming ( const double summing)
inlineinherited

Set sample summing mode.

Use this method to specify if detector samples are summed/averaged. That is, one image sample represents the average of N detectors. If not set the default is 1.

Parameters
summingSample summing mode

Definition at line 108 of file CameraDetectorMap.h.

References Isis::CameraDetectorMap::Compute(), and Isis::CameraDetectorMap::p_detectorSampleSumming.

Referenced by Isis::ApolloPanoramicCamera::ApolloPanoramicCamera(), Isis::CrismCamera::CrismCamera(), Isis::DawnVirCamera::DawnVirCamera(), Isis::HrscCamera::HrscCamera(), and Isis::RosettaVirtisCamera::RosettaVirtisCamera().

◆ SetParent() [1/2]

bool Isis::RollingShutterCameraDetectorMap::SetParent ( const double sample,
const double line )
virtual

Compute detector position from a parent image coordinate.

This method will compute the detector position from the parent line/sample coordinate

Parameters
sampleSample number in the parent image
lineLine number in the parent image
Returns
conversion successful

Reimplemented from Isis::CameraDetectorMap.

Definition at line 55 of file RollingShutterCameraDetectorMap.cpp.

References SetParent().

Referenced by SetParent().

◆ SetParent() [2/2]

bool Isis::RollingShutterCameraDetectorMap::SetParent ( const double sample,
const double line,
const double deltaT )
virtual

Compute detector position from a parent image coordinate.

This method will compute the detector position from the parent line/sample coordinate and an offset from the currently set time in seconds. If the time has not already been set, the input offset is not applied.

Parameters
sampleSample number in the parent image
lineLine number in the parent image
deltaToption time offset from center of exposure in seconds
Returns
conversion successful

Reimplemented from Isis::CameraDetectorMap.

Definition at line 75 of file RollingShutterCameraDetectorMap.cpp.

References Isis::Spice::isTimeSet(), Isis::CameraDetectorMap::p_camera, Isis::CameraDetectorMap::p_detectorLine, Isis::CameraDetectorMap::p_detectorLineSumming, Isis::CameraDetectorMap::p_detectorSample, Isis::CameraDetectorMap::p_detectorSampleSumming, Isis::CameraDetectorMap::p_parentLine, Isis::CameraDetectorMap::p_parentSample, Isis::CameraDetectorMap::p_sl, Isis::CameraDetectorMap::p_ss, removeJitter(), Isis::Sensor::setTime(), and Isis::Spice::time().

◆ SetStartingDetectorLine()

void Isis::CameraDetectorMap::SetStartingDetectorLine ( const double line)
inlineinherited

Set the starting detector line.

Use this method to specify the starting detector that represents the first image line in the cube. If not set the default is 1.

Parameters
lineStarting detector line

Definition at line 93 of file CameraDetectorMap.h.

References Isis::CameraDetectorMap::Compute(), and Isis::CameraDetectorMap::p_startingDetectorLine.

◆ SetStartingDetectorSample()

void Isis::CameraDetectorMap::SetStartingDetectorSample ( const double sample)
inlineinherited

Set the starting detector sample.

Use this method to specify the starting detector that represents the first image sample in the cube. If not set the default is 1.

Parameters
sampleStarting detector sample

Definition at line 79 of file CameraDetectorMap.h.

References Isis::CameraDetectorMap::Compute(), and Isis::CameraDetectorMap::p_startingDetectorSample.

Referenced by Isis::ApolloPanoramicCamera::ApolloPanoramicCamera().

Member Data Documentation

◆ m_lineCoeffs

std::vector<double> Isis::RollingShutterCameraDetectorMap::m_lineCoeffs
private

List of coefficients for the n-order polynomial characterizing the jitter in the line direction.

Definition at line 67 of file RollingShutterCameraDetectorMap.h.

Referenced by removeJitter(), and RollingShutterCameraDetectorMap().

◆ m_sampleCoeffs

std::vector<double> Isis::RollingShutterCameraDetectorMap::m_sampleCoeffs
private

List of coefficients for the n-order polynomial characterizing the jitter in the sample direction.

Definition at line 62 of file RollingShutterCameraDetectorMap.h.

Referenced by removeJitter(), and RollingShutterCameraDetectorMap().

◆ m_times

std::vector<double> Isis::RollingShutterCameraDetectorMap::m_times
private

List of normalized [-1, 1] readout times for all the lines in the input image.

Definition at line 57 of file RollingShutterCameraDetectorMap.h.

Referenced by removeJitter(), and RollingShutterCameraDetectorMap().

◆ p_camera

◆ p_detectorLine

◆ p_detectorLineSumming

◆ p_detectorSample

◆ p_detectorSampleSumming

◆ p_parentLine

◆ p_parentSample

◆ p_sl

◆ p_ss

◆ p_startingDetectorLine

double Isis::CameraDetectorMap::p_startingDetectorLine
protectedinherited

◆ p_startingDetectorSample

double Isis::CameraDetectorMap::p_startingDetectorSample
protectedinherited

The documentation for this class was generated from the following files: