Skip to content
Snippets Groups Projects
Commit 67fb5b90 authored by Julien Michel's avatar Julien Michel
Browse files

MRG

parents b2bb8eba 5c6991f2
Branches
Tags
No related merge requests found
......@@ -92,7 +92,7 @@ namespace otb
itkExceptionMacro(<<"TransformPoint(): Invalid Model pointer m_Model == NULL !");
}
this->m_Model->worldToLineSample(ossimGPoint, ossimDPoint); //"worldToLineSample" appelle la m�thode "lineSampleHeightToWorld" pour prendre en compte l'�l�vation.
this->m_Model->worldToLineSample(ossimGPoint, ossimDPoint); //"worldToLineSample" call "lineSampleHeightToWorld" method for take in care elevation information.
OutputPointType outputPoint;
......
......@@ -43,117 +43,116 @@ namespace otb
*
*/
template <class TInputImage, class TOutputImage, class TMapProjection, class TInterpolatorPrecision=double>
class ITK_EXPORT OrthoRectificationFilter :
public StreamingResampleImageFilter<TInputImage, TOutputImage, TInterpolatorPrecision>
{
public :
/** Standard class typedefs */
typedef StreamingResampleImageFilter<TInputImage,
TOutputImage,
TInterpolatorPrecision> Superclass;
typedef OrthoRectificationFilter Self;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
typedef typename TInputImage::IndexType IndexType;
typedef typename TInputImage::SizeType SizeType;
typedef typename TInputImage::SpacingType SpacingType;
typedef typename TInputImage::PointType PointType;
typedef typename TInputImage::RegionType RegionType;
template <class TInputImage, class TOutputImage, class TMapProjection, class TInterpolatorPrecision=double>
class ITK_EXPORT OrthoRectificationFilter :
public StreamingResampleImageFilter<TInputImage, TOutputImage, TInterpolatorPrecision>
{
public :
/** Standard class typedefs */
typedef StreamingResampleImageFilter<TInputImage,
TOutputImage,
TInterpolatorPrecision> Superclass;
typedef OrthoRectificationFilter Self;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
typedef typename TOutputImage::PixelType OutputPixelType;
typedef typename TInputImage::IndexType IndexType;
typedef typename TInputImage::SizeType SizeType;
typedef typename TInputImage::SpacingType SpacingType;
typedef typename TInputImage::PointType PointType;
typedef typename TInputImage::RegionType RegionType;
typedef TMapProjection MapProjectionType;
typedef typename TMapProjection::Pointer MapProjectionPointerType;
typedef typename TOutputImage::PixelType OutputPixelType;
typedef InverseSensorModel<double> SensorModelType;
typedef typename SensorModelType::Pointer SensorModelPointerType;
typedef TMapProjection MapProjectionType;
typedef typename TMapProjection::Pointer MapProjectionPointerType;
typedef CompositeTransform< MapProjectionType,SensorModelType> CompositeTransformType;
typedef typename CompositeTransformType::Pointer CompositeTransformPointerType;
typedef InverseSensorModel<double> SensorModelType;
typedef typename SensorModelType::Pointer SensorModelPointerType;
/** Method for creation through the object factory. */
itkNewMacro( Self );
typedef CompositeTransform< MapProjectionType,SensorModelType> CompositeTransformType;
typedef typename CompositeTransformType::Pointer CompositeTransformPointerType;
/** Run-time type information (and related methods). */
itkTypeMacro( OrthoRectificationFilter, StreamingResampleImageFilter );
/** Method for creation through the object factory. */
itkNewMacro( Self );
/** Accessors */
virtual void SetMapProjection (MapProjectionType* _arg)
{
if (this->m_MapProjection != _arg)
{
this->m_MapProjection = _arg;
m_CompositeTransform->SetFirstTransform(_arg);
m_IsComputed = false;
this->Modified();
}
}
/** Run-time type information (and related methods). */
itkTypeMacro( OrthoRectificationFilter, StreamingResampleImageFilter );
itkGetObjectMacro(MapProjection, MapProjectionType);
/** Specify where are DEM files, and load useful ones */
virtual void SetDEMDirectory(const std::string& directory)
/** Accessors */
virtual void SetMapProjection (MapProjectionType* _arg)
{
if (this->m_MapProjection != _arg)
{
m_SensorModel->SetDEMDirectory(directory);
this->Modified();
this->m_MapProjection = _arg;
m_CompositeTransform->SetFirstTransform(_arg);
m_IsComputed = false;
this->Modified();
}
}
/** Methods to enable DEM */
virtual void EnableDEM()
{
m_SensorModel->EnableDEM();
this->Modified();
}
itkGetObjectMacro(MapProjection, MapProjectionType);
/** Methods to desable DEM */
virtual void DisableDEM()
{
m_SensorModel->DisableDEM();
this->Modified();
}
/** Specify where are DEM files, and load useful ones */
virtual void SetDEMDirectory(const std::string& directory)
{
m_SensorModel->SetDEMDirectory(directory);
this->Modified();
}
/** Methods to enable DEM */
virtual void EnableDEM()
{
m_SensorModel->EnableDEM();
this->Modified();
}
/** Specify average elevation.*/
virtual void SetAverageElevation(double elevation)
{
m_SensorModel->SetAverageElevation(elevation);
this->Modified();
}
/** Methods to desable DEM */
virtual void DisableDEM()
{
m_SensorModel->DisableDEM();
this->Modified();
}
/** Specify average elevation.*/
virtual void SetAverageElevation(double elevation)
{
m_SensorModel->SetAverageElevation(elevation);
this->Modified();
}
protected:
OrthoRectificationFilter();
~OrthoRectificationFilter();
void PrintSelf(std::ostream& os, itk::Indent indent) const;
virtual void GenerateInputRequestedRegion();
virtual void GenerateOutputInformation( void );
protected:
OrthoRectificationFilter();
~OrthoRectificationFilter();
void PrintSelf(std::ostream& os, itk::Indent indent) const;
virtual void GenerateInputRequestedRegion();
virtual void GenerateOutputInformation( void );
private:
OrthoRectificationFilter(const Self&); //purposely not implemented
void operator=(const Self&); //purposely not implemented
private:
OrthoRectificationFilter(const Self&); //purposely not implemented
void operator=(const Self&); //purposely not implemented
/** Calculate transformation model from sensor model and map projection composition */
void ComputeResampleTransformationModel();
/** Calculate transformation model from sensor model and map projection composition */
void ComputeResampleTransformationModel();
/** Boolean used to know if transformation model computation is needed */
bool m_IsComputed;
/** Boolean used to know if transformation model computation is needed */
bool m_IsComputed;
/** Sensor Model used to transform geographic coordinates in image sensor index */
SensorModelPointerType m_SensorModel;
/** Sensor Model used to transform geographic coordinates in image sensor index */
SensorModelPointerType m_SensorModel;
/** Map Projection used to transform cartographic coordinates in geographic coordinates */
MapProjectionPointerType m_MapProjection;
/** Map Projection used to transform cartographic coordinates in geographic coordinates */
MapProjectionPointerType m_MapProjection;
/** Composite Transform of Sensor Model and Map Projection, used for Resampler */
CompositeTransformPointerType m_CompositeTransform;
/** Composite Transform of Sensor Model and Map Projection, used for Resampler */
CompositeTransformPointerType m_CompositeTransform;
};
};
} // namespace otb
......
......@@ -29,7 +29,6 @@
#include "otbImageFileReader.h"
#include "otbStreamingImageFileWriter.h"
#include "otbInverseSensorModel.h"
#include "otbStreamingResampleImageFilter.h"
#include "otbOrthoRectificationFilter.h"
#include "otbMapProjections.h"
......@@ -94,6 +93,7 @@ int otbOrthoRectificationFilter( int argc, char* argv[] )
utmMapProjection->SetZone(atoi(argv[9]));
utmMapProjection->SetHemisphere(argv[10][0]);
orthoRectifFilter->SetMapProjection(utmMapProjection);
orthoRectifFilter->SetAverageElevation(10);
writer->SetInput(orthoRectifFilter->GetOutput());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment