OTB  9.0.0
Orfeo Toolbox
Classes | Typedefs | Functions
GapFilling Namespace Reference

Classes

class  BinaryFunctorImageFilterWithNBands
 
struct  doy_multi_year
 
class  IdentityGapFillingFunctor
 
class  LinearGapFillingFunctor
 
struct  MultiComponentTimeSeriesFunctorAdaptor
 
class  SplineGapFillingFunctor
 

Typedefs

using DateVector = std::vector< std::tm >
 
using PrecisionType = double
 
using VectorType = vnl_vector< PrecisionType >
 

Functions

int delta_days (std::tm t1, std::tm t2)
 
unsigned int doy (const std::tm &d)
 
std::tm make_date (const std::string &d)
 
std::string pad_int (int x)
 
std::vector< std::string > string_split (const std::string &s, const std::string &sep)
 
template<typename ValueType >
itk::VariableLengthVector< ValueType > vectorToPixel (const std::vector< ValueType > &v)
 
template<typename ValueType , typename VectorType >
itk::VariableLengthVector< ValueType > vectorToPixel (const VectorType &v)
 

Typedef Documentation

◆ DateVector

using GapFilling::DateVector = typedef std::vector<std::tm>

Definition at line 31 of file otbDateUtils.h.

◆ PrecisionType

using GapFilling::PrecisionType = typedef double

Definition at line 29 of file otbDateUtils.h.

◆ VectorType

using GapFilling::VectorType = typedef vnl_vector<PrecisionType>

Definition at line 30 of file otbDateUtils.h.

Function Documentation

◆ create_tmp_data_interlace_dates()

template<typename PixelType >
std::tuple<PixelType, PixelType, PixelType > GapFilling::create_tmp_data_interlace_dates ( const PixelType  pix,
const PixelType  mask,
const PixelType  idv,
const PixelType  odv,
typename PixelType::ValueType  valid_value 
)
inline

Generate a new pixel and a corresponding mask after interlacing input and output dates. The resulting pixel values for the dates which were not available in the input have a nundefined value and are masked.

Definition at line 133 of file otbTemporalGapFilling.h.

Referenced by GapFilling::LinearGapFillingFunctor< PixelType >::operator()(), and GapFilling::SplineGapFillingFunctor< PixelType >::operator()().

◆ delta_days()

int GapFilling::delta_days ( std::tm  t1,
std::tm  t2 
)

Returns the difference in days between 2 time structures.

◆ doy()

unsigned int GapFilling::doy ( const std::tm &  d)

◆ extract_output_dates()

template<typename PixelType >
PixelType GapFilling::extract_output_dates ( const PixelType  pix,
const PixelType  dv,
const PixelType  odv 
)
inline

Return 2 vectors containing, for each date, the position of the last (resp next) valid date and a bool which is true if there are no valid dates

Definition at line 178 of file otbTemporalGapFilling.h.

Referenced by GapFilling::LinearGapFillingFunctor< PixelType >::operator()(), and GapFilling::SplineGapFillingFunctor< PixelType >::operator()().

◆ find_valid_bounds()

template<typename PixelType >
std::tuple<std::vector<typename PixelType::ValueType>, std::vector<typename PixelType::ValueType>, bool> GapFilling::find_valid_bounds ( const PixelType  mask,
int  nbDates,
typename PixelType::ValueType  valid_value 
)
inline

Return 2 vectors containing, for each date, the position of the last (resp next) valid date and a bool which is true if there are no valid dates

Definition at line 104 of file otbTemporalGapFilling.h.

Referenced by GapFilling::LinearGapFillingFunctor< PixelType >::operator()(), and GapFilling::SplineGapFillingFunctor< PixelType >::operator()().

◆ gapfill_time_series()

template<typename ImageType , typename FunctorType , typename MultiComponentFunctorType = MultiComponentTimeSeriesFunctorAdaptor<typename ImageType::PixelType, FunctorType>>
void GapFilling::gapfill_time_series ( typename ImageType::Pointer  inIma,
typename ImageType::Pointer  maskIma,
typename BinaryFunctorImageFilterWithNBands< ImageType, ImageType, ImageType, FunctorType >::Pointer  filter,
typename BinaryFunctorImageFilterWithNBands< ImageType, ImageType, ImageType, MultiComponentFunctorType >::Pointer  filter_mc,
vcl_size_t  components_per_date = 1,
typename ImageType::PixelType  dv = typename ImageType::PixelType{},
typename ImageType::PixelType  odv = typename ImageType::PixelType{} 
)

The gapfill_time_series function takes 2 input time series files (the image data and the mask data) and produces an output file (the gapfilled image data). The number of components (spectral bands, for instance) per date can be provided (default is 1) so that the different components are processed as individual time series. A file containing the dates of the acquisition can be provided. It should contain one date per line in YYYMMDD format.

The mask time series is supposed to contain 0s for the valid dates. The function is templated over the ImageType (typically an otb::VectorImage<double,2>) and on the interpolating functor.

Definition at line 653 of file otbTemporalGapFilling.h.

◆ get_csv_profiles()

std::vector<VectorType> GapFilling::get_csv_profiles ( const std::string &  fname,
int  pos,
int  ndates 
)

Extracts the profiles from a csv file (MAISEO format). Returns a vector of profiles. Gets as parameters the file name, the starting position of the dates (column) and the number of availble dates in the file.

◆ get_sirhyus_profiles()

std::vector<std::pair<long int, VectorType> > GapFilling::get_sirhyus_profiles ( const std::string &  df,
unsigned int  nbDates 
)

Extracts the profiles from a csv file (Sirhyus format). Returns a vector of pairs where each pair is <field id, profile> Gets as parameters the file name.

◆ make_date()

std::tm GapFilling::make_date ( const std::string &  d)

Makes a date (std::tm struct) from a string with format YYYYMMDD.

◆ months()

int GapFilling::months ( const std::string &  m)

Map to convert months from text to int.

◆ pad_int()

std::string GapFilling::pad_int ( int  x)

return a string with a 0 at the front if the int is < 10

◆ parse_date_file()

DateVector GapFilling::parse_date_file ( const std::string &  df)

Parses an ASCII file containing a date per line (string with format YYYYMMDD) and returns an std::vector< std::tm > containing the dates in the order of reading

◆ parse_dates_csv_file()

std::pair<DateVector, int> GapFilling::parse_dates_csv_file ( const std::string &  df,
int  year 
)

Parses the first line of a csv file looking for dates like 4-Feb and returns an std::vector< std::tm >. The year is passed as parameter. Returns a pair containing a vector of dates and the starting position (column) of the dates in the file.

◆ parse_dates_sirhyus()

DateVector GapFilling::parse_dates_sirhyus ( const std::string &  fname)

Parses the first line of a cvs file with this format: parcelle;f090215;f090317;f090321;f090603;f090623;f090701;f090712;f090726;f090805;f090814;f090830;f090906;f090924;f090930;f091016;f091225 and returns a DateVector

◆ string_split()

std::vector<std::string> GapFilling::string_split ( const std::string &  s,
const std::string &  sep 
)

Split a string using a given separator.

◆ vectorToPixel() [1/2]

template<typename ValueType >
itk::VariableLengthVector<ValueType> GapFilling::vectorToPixel ( const std::vector< ValueType > &  v)
inline

Definition at line 47 of file otbTemporalGapFilling.h.

◆ vectorToPixel() [2/2]

template<typename ValueType , typename VectorType >
itk::VariableLengthVector<ValueType> GapFilling::vectorToPixel ( const VectorType v)
inline

Definition at line 37 of file otbTemporalGapFilling.h.