OTB
9.0.0
Orfeo Toolbox
|
#include <otbSarSensorModel.h>
Classes | |
struct | LineSampleYZ |
struct | ZeroDopplerInfo |
Public Types | |
using | DurationType = MetaData::Duration |
using | OrbitIterator = std::vector< Orbit >::const_iterator |
using | Point2DType = itk::Point< double, 2 > |
using | Point3DType = itk::Point< double, 3 > |
using | TimeType = MetaData::TimePoint |
using | Vector3DType = itk::Point< double, 3 > |
Public Member Functions | |
bool | BurstExtraction (const unsigned int burst_index, std::pair< unsigned long, unsigned long > &lines, std::pair< unsigned long, unsigned long > &samples, bool allPixels=false) |
double | CalculateRangeTime (Point3DType const &ecefGround, Point3DType const &sensorPos) const |
bool | Deburst (std::vector< std::pair< unsigned long, unsigned long >> &lines, std::pair< unsigned long, unsigned long > &samples, bool onlyValidSample=false) |
bool | DeburstAndConcatenate (std::vector< std::pair< unsigned long, unsigned long > > &linesBursts, std::vector< std::pair< unsigned long, unsigned long > > &samplesBursts, unsigned int &linesOffset, unsigned int first_burstInd, bool inputWithInvalidPixels=false) |
LineSampleYZ | Doppler0ToLineSampleYZ (Point3DType const &ecefGround, ZeroDopplerInfo const &zdi, double rangeTime) const |
void | LineSampleHeightToWorld (const Point2DType &imPt, double heightAboveEllipsoid, Point3DType &worldPt) const |
void | LineSampleToWorld (const Point2DType &imPt, Point3DType &worldPt) const |
bool | LineToSatPositionAndVelocity (double line, Point3DType &satellitePosition, Point3DType &satelliteVelocity) const |
SarSensorModel & | operator= (const SarSensorModel &)=delete |
bool | Overlap (std::pair< unsigned long, unsigned long > &linesUp, std::pair< unsigned long, unsigned long > &linesLow, std::pair< unsigned long, unsigned long > &samplesUp, std::pair< unsigned long, unsigned long > &samplesLow, unsigned int burstIndUp, bool inputWithInvalidPixels=false) |
SarSensorModel (const ImageMetadata &imd, unsigned int polynomial_degree=8) | |
SarSensorModel (const SarSensorModel &)=delete | |
SarSensorModel (std::string productType, SARParam sarParam, Projection::GCPParam gcps, unsigned int polynomial_degree=8) | |
void | UpdateImageMetadata (ImageMetadata &imd) |
bool | WorldToAzimuthRangeTime (const Point3DType &inGeoPoint, TimeType &azimuthTime, double &rangeTime, Point3DType &sensorPos, Vector3DType &sensorVel) const |
void | WorldToLineSample (const Point3DType &inGeoPoint, Point2DType &outLineSample) const |
void | WorldToLineSampleYZ (const Point3DType &inGeoPoint, Point2DType &cr, Point2DType &yz) const |
bool | WorldToSatPositionAndVelocity (const Point3DType &inGeoPoint, Point3DType &satellitePosition, Point3DType &satelliteVelocity) const |
ZeroDopplerInfo | ZeroDopplerLookup (Point3DType const &inEcefPoint) const |
TimeType | ZeroDopplerTimeLookup (Point3DType const &ecefGround) const |
std::tuple< TimeType, OrbitIterator, OrbitIterator > | ZeroDopplerTimeLookupInternal (Point3DType const &ecefGround) const |
virtual | ~SarSensorModel ()=default |
Static Public Member Functions | |
static void | DeburstLineToImageLine (const std::vector< std::pair< unsigned long, unsigned long > > &lines, unsigned long deburstLine, unsigned long &imageLine) |
static bool | ImageLineToDeburstLine (const std::vector< std::pair< unsigned long, unsigned long > > &lines, unsigned long imageLine, unsigned long &deburstLine) |
Private Member Functions | |
double | ApplyCoordinateConversion (double in, const TimeType &azimuthTime, const std::vector< CoordinateConversionRecord > &records) const |
double | AzimuthTimeToLine (const TimeType &azimuthTime) const |
itk::Point< double, 3 > | EcefToWorld (const itk::Point< double, 3 > &ecefPoint) const |
const GCP & | findClosestGCP (const Point2DType &imPt, const Projection::GCPParam &gcpParam) const |
std::pair< Point3DType, Vector3DType > | interpolateSensorPosVel (TimeType azimuthTime) const |
std::pair< Point3DType, Vector3DType > | interpolateSensorPosVel (TimeType azimuthTime, OrbitIterator itrecord1) const |
TimeType | LineToAzimuthTime (double line) const |
void | OptimizeTimeOffsetsFromGcps () |
Point3DType | projToSurface (const GCP &gcp, const Point2DType &imPt, std::function< double(double, double)> heightFunction) const |
OrbitIterator | searchLagrangianNeighbourhood (TimeType azimuthTime) const |
double | SlantRangeToGroundRange (double slantRange, const TimeType &azimuthTime) const |
itk::Point< double, 3 > | WorldToEcef (const itk::Point< double, 3 > &worldPoint) const |
Private Attributes | |
DurationType | m_AzimuthTimeOffset |
otb::GeocentricTransform< otb::TransformDirection::INVERSE, double >::Pointer | m_EcefToWorldTransform |
TimeType | m_FirstLineTime |
Projection::GCPParam | m_GCP |
bool | m_IsGrd |
TimeType | m_LastLineTime |
LagrangianOrbitInterpolator | m_OrbitInterpolator |
unsigned int | m_polynomial_degree |
std::string | m_ProductType |
double | m_RangeTimeOffset |
SARParam | m_SarParam |
otb::GeocentricTransform< otb::TransformDirection::FORWARD, double >::Pointer | m_WorldToEcefTransform |
Definition at line 36 of file otbSarSensorModel.h.
Definition at line 47 of file otbSarSensorModel.h.
using otb::SarSensorModel::OrbitIterator = std::vector<Orbit>::const_iterator |
Definition at line 49 of file otbSarSensorModel.h.
using otb::SarSensorModel::Point2DType = itk::Point<double, 2> |
Definition at line 41 of file otbSarSensorModel.h.
using otb::SarSensorModel::Point3DType = itk::Point<double, 3> |
Definition at line 42 of file otbSarSensorModel.h.
Definition at line 46 of file otbSarSensorModel.h.
using otb::SarSensorModel::Vector3DType = itk::Point<double, 3> |
Definition at line 44 of file otbSarSensorModel.h.
otb::SarSensorModel::SarSensorModel | ( | std::string | productType, |
SARParam | sarParam, | ||
Projection::GCPParam | gcps, | ||
unsigned int | polynomial_degree = 8 |
||
) |
|
explicit |
|
virtualdefault |
|
delete |
|
private |
|
private |
Convert azimuth time to fractional line.
[in] | azimuthTime | The azimuth time to convert |
bool otb::SarSensorModel::BurstExtraction | ( | const unsigned int | burst_index, |
std::pair< unsigned long, unsigned long > & | lines, | ||
std::pair< unsigned long, unsigned long > & | samples, | ||
bool | allPixels = false |
||
) |
This method will perform an extraction of one burst. It will return the lines and samples to extract in the image file.
burst_index | Index of Burst. |
lines | A container for the lines to keep in the standalone burst. |
samples | A container for the samples to keep in the standalone burst. |
Referenced by otb::SarBurstExtractionImageFilter< TImage >::GenerateOutputInformation().
double otb::SarSensorModel::CalculateRangeTime | ( | Point3DType const & | ecefGround, |
Point3DType const & | sensorPos | ||
) | const |
Calculate range time from pre computed information. For user code that may or may not need range time information independently of other information related to the zero doppler.
[in] | ecefGround | ground point in XYZ cartesian coordinates |
[in] | sensorPos | sensor position associated to ecefGround |
sensorPos
shall match ground point. None |
bool otb::SarSensorModel::Deburst | ( | std::vector< std::pair< unsigned long, unsigned long >> & | lines, |
std::pair< unsigned long, unsigned long > & | samples, | ||
bool | onlyValidSample = false |
||
) |
Deburst metadata if possible and return lines to keep in image file
Referenced by otb::SarDeburstImageFilter< TImage >::GenerateOutputInformation().
bool otb::SarSensorModel::DeburstAndConcatenate | ( | std::vector< std::pair< unsigned long, unsigned long > > & | linesBursts, |
std::vector< std::pair< unsigned long, unsigned long > > & | samplesBursts, | ||
unsigned int & | linesOffset, | ||
unsigned int | first_burstInd, | ||
bool | inputWithInvalidPixels = false |
||
) |
This method will perform a deburst and concatenation operation, and return the vector of lines and the vector of samples to keep in the image file. The lines and samples represents start/size into each independent bursts. Note that the deburst operation has no effect if theBurstRecords contains a single burst. Otherwise it will merge burst together into a single burst, and update GCPs accordingly.
lines | A container for the lines ranges to keep in the deburst image. |
samples | A container for the samples ranges to keep in the deburst image. |
lines | A Boolean to indicate only valids samples are required. |
Referenced by otb::SarConcatenateBurstsImageFilter< TImage >::getDeburstLinesAndSamples().
|
static |
This is a helper function to convert deburst line to input image line
lines | The vector of lines range to keep |
imageLine | The input deburst line |
deburstLine | The output original image line |
Referenced by otb::SarDeburstImageFilter< TImage >::OutputRegionToInputRegion().
LineSampleYZ otb::SarSensorModel::Doppler0ToLineSampleYZ | ( | Point3DType const & | ecefGround, |
ZeroDopplerInfo const & | zdi, | ||
double | rangeTime | ||
) | const |
Compute input image point (col,row) and YZ frame from Doppler0 precomputed information.
Unlike WorldToLineSampleYZ
, this function starts from data already computed and cached by user code.
The main use case is when doppler0 information is already requested by user code as it could be directly injected to compute col/row/Y/Z instead of searching again for the doppler0 data related to ecefGround
point.
[in] | ecefGround | ground point in XYZ cartesian coordinates |
[in] | zdi | zero doppler information (azimuth time, sensor position + velocity) |
[in] | rangeTime | associated range time |
zdi
data and rangeTime| shall have been obtained with
ZeroDopplerLookupand
CalculateRangeTimeon the same
ecefGround` point.None |
WorldToLineSampleYZ
|
private |
Coordinate transformation from ECEF to geographic
|
private |
|
static |
This is a helper function to convert image line to deburst image line.
lines | The vector of lines range to keep |
imageLine | The input image line |
deburstLine | The output deburst line |
Referenced by otb::SarDeburstImageFilter< TImage >::GenerateOutputInformation().
|
private |
Interpolate sensor position and velocity at given azimuth time using lagragian interpolation of orbital records.
This overload will search (in O(N)) for the closest OrbitStateVector from ground point thanks to searchLagrangianNeighbourhood
. This overload is time consuming and best avoided is possible.
[in] | azimuthTime | The time at which to interpolate |
|
private |
Interpolate sensor position and velocity at given azimuth time using lagragian interpolation of orbital records.
This overload will exploit the last OSV sample known to be before the azimuthTime
. Prefer this overload when possible.
[in] | azimuthTime | The time at which to interpolate |
void otb::SarSensorModel::LineSampleHeightToWorld | ( | const Point2DType & | imPt, |
double | heightAboveEllipsoid, | ||
Point3DType & | worldPt | ||
) | const |
void otb::SarSensorModel::LineSampleToWorld | ( | const Point2DType & | imPt, |
Point3DType & | worldPt | ||
) | const |
|
private |
bool otb::SarSensorModel::LineToSatPositionAndVelocity | ( | double | line, |
Point3DType & | satellitePosition, | ||
Point3DType & | satelliteVelocity | ||
) | const |
Transform line index to satellite position (x,y,z) and satellite velocity
|
delete |
|
private |
bool otb::SarSensorModel::Overlap | ( | std::pair< unsigned long, unsigned long > & | linesUp, |
std::pair< unsigned long, unsigned long > & | linesLow, | ||
std::pair< unsigned long, unsigned long > & | samplesUp, | ||
std::pair< unsigned long, unsigned long > & | samplesLow, | ||
unsigned int | burstIndUp, | ||
bool | inputWithInvalidPixels = false |
||
) |
This method will estimate the overlap area between two bursts and return the vector of lines and the vector of samples (with two elements : Burst Up and Burst Low). Note that this operation has no effect if theBurstRecords contains a single burst.
linesUp | A container for the lines ranges to keep into the first Burst |
linesLow | A container for the lines ranges to keep into the second Burst |
samplesUp | A container for the samples ranges to keep into the first Burst. |
samplesDown | A container for the samples ranges to keep into the second Burst. |
burstIndUp | Index of the first Burst |
inputWithInvalidPixels | A Boolean to indicate if invalids pixels are into inputs. |
|
private |
|
private |
Linear search of the OrbitStateVector which is the closest from ground point.
This function is time consuming and best avoided is possible.
OrbitIterator
on the closest OSV (from the ground), with a supposition on the Lagrangian polynomial degree. None |
|
private |
void otb::SarSensorModel::UpdateImageMetadata | ( | ImageMetadata & | imd | ) |
Update a ImageMetadata object with the stored SarParam and GCPs, possibly modified from the original metadata by the SarSensorModel
imd | The ImageMetadata to be updated |
Referenced by otb::SarDeburstImageFilter< TImage >::GenerateOutputInformation(), otb::SarBurstExtractionImageFilter< TImage >::GenerateOutputInformation(), and otb::SarConcatenateBurstsImageFilter< TImage >::getDeburstLinesAndSamples().
bool otb::SarSensorModel::WorldToAzimuthRangeTime | ( | const Point3DType & | inGeoPoint, |
TimeType & | azimuthTime, | ||
double & | rangeTime, | ||
Point3DType & | sensorPos, | ||
Vector3DType & | sensorVel | ||
) | const |
Helper function that returns every zero doppler related information for the input ground point in WGS84 coordinates (lat, lon, hgt).
Actually, it returns everything but the ground point in ECEF coordinates.
Alternately, user code can chose to use the more fine grained functions
[in] | inGeoPoint | ground point in WGS84 (lat, lon, hgt) coordinates |
[out] | azimuthTime | azimuth time at zero doppler |
[out] | rangeTime | range time at zero doppler |
[out] | sensorPos | sensor position at zero doppler |
[out] | sensorVel | sensor velocity at zero doppler |
itk::ExceptionObject | if there aren't enough OrbitStateVector samples to search in the orbit. |
|
private |
Coordinate transformation from geographic to ECEF
void otb::SarSensorModel::WorldToLineSample | ( | const Point3DType & | inGeoPoint, |
Point2DType & | outLineSample | ||
) | const |
Transform world point (lat,lon,hgt) to input image point (col,row)
void otb::SarSensorModel::WorldToLineSampleYZ | ( | const Point3DType & | inGeoPoint, |
Point2DType & | cr, | ||
Point2DType & | yz | ||
) | const |
Transform world point (lat,lon,hgt) to input image point (col,row) and YZ frame.
Unlike Doppler0ToLineSampleYZ
, this function takes care of searching doppler 0 information related to the ground point inGeoPoint
. However, intermediary data will be hidden and lost. Any call to other WorldTo...
function will search for the same doppler0 information again and again...
As such, prefer using otb::Projection::WorldToEcef
, ZeroDopplerLookup
, and Doppler0ToLineSampleYZ
manually if you need several of these information.
[in] | inGeoPoint | ground point in WGS84 (lat, lon, hgt) coordinates |
[out] | cr | associated col+row |
[out] | yz | associated coordinates in YZ frame |
itk::ExceptionObject | if there aren't enough OrbitStateVector samples to search in the orbit. |
bool otb::SarSensorModel::WorldToSatPositionAndVelocity | ( | const Point3DType & | inGeoPoint, |
Point3DType & | satellitePosition, | ||
Point3DType & | satelliteVelocity | ||
) | const |
Transform world point (lat,lon,hgt) to satellite position (x,y,z) and satellite velocity.
WorldToAzimuthRangeTime
or the more fine grained ZeroDopplerLookup
function. itk::ExceptionObject | if there aren't enough OrbitStateVector samples to search in the orbit. |
ZeroDopplerInfo otb::SarSensorModel::ZeroDopplerLookup | ( | Point3DType const & | inEcefPoint | ) | const |
Computes Zero Doppler information. Given a ground position, looks for the associated azimuth time, and the associated position and velocity of the sensor.
[in] | inEcefPoint | Ground position in ECEF coordinates |
itk::ExceptionObject | if orbit record vector contains less than 2 elements. |
TimeType otb::SarSensorModel::ZeroDopplerTimeLookup | ( | Point3DType const & | ecefGround | ) | const |
Computes Zero Doppler information. Given a ground position, estimates the associated azimuth time of the zero doppler.
Internally, this function calls ZeroDopplerTimeLookupInternal()
but only return the azimuth time.
[in] | ecefGround | Ground position in ECEF coordinates |
itk::ExceptionObject | if orbit record vector contains less than 2 elements. |
std::tuple<TimeType, OrbitIterator, OrbitIterator> otb::SarSensorModel::ZeroDopplerTimeLookupInternal | ( | Point3DType const & | ecefGround | ) | const |
Internal function that looks for zero doppler. Given a ground position, estimates the associated azimuth time of the zero doppler.
This internal function also provides iterators to OrbitStateVector samples in between which the sensor has been the closest to the ground point. These iterators will then permit to directly interpolate the sensor position and velocity (without looking for the OSV sample which is the closest from ground point, a second time).
|
private |
Definition at line 423 of file otbSarSensorModel.h.
|
private |
Definition at line 434 of file otbSarSensorModel.h.
|
private |
Definition at line 420 of file otbSarSensorModel.h.
|
private |
Definition at line 417 of file otbSarSensorModel.h.
|
private |
Definition at line 427 of file otbSarSensorModel.h.
|
private |
Definition at line 421 of file otbSarSensorModel.h.
|
private |
Definition at line 431 of file otbSarSensorModel.h.
|
private |
Definition at line 432 of file otbSarSensorModel.h.
|
private |
Definition at line 416 of file otbSarSensorModel.h.
|
private |
Definition at line 424 of file otbSarSensorModel.h.
|
private |
Definition at line 418 of file otbSarSensorModel.h.
|
private |
Definition at line 435 of file otbSarSensorModel.h.