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

MRG

parents 73d76e1d 6281a99f
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,7 @@ namespace Functor
/** \class TextureFunctorBase
* \brief This functor ius the base for all texture functors.
*
* It uses a neighborhood (radius : m_Radius) and an offset (m_Offset) to compute texture.
* It uses a neighborhood and an offset (m_Offset) to compute texture.
* It computes the mean, standard deviation of the two areas and the joint histogram using
* Scott formula for the bins lengths computation.
* TIterInput is an iterator, TOutput is a PixelType.
......
......@@ -16,17 +16,59 @@
=========================================================================*/
#include "itkExceptionObject.h"
#include "itkNeighborhood.h"
#include "otbImage.h"
#include "itkVariableLengthVector.h"
#include "itkConstNeighborhoodIterator.h"
#include "otbTextureImageFunction.h"
#include "otbFunctionWithNeighborhoodToImageFilter.h"
#include "otbEnergyTextureImageFunction.h"
#include "otbTextureFunctorBase.h"
template <class TIterInput1, class TIterInput2, class TOutput>
class TextureFunctorTest
{
public:
TextureFunctorTest()
{
m_Offset.Fill(1);
};
~TextureFunctorTest() {};
typedef TIterInput1 IterType1;
typedef TIterInput2 IterType2;
typedef TOutput OutputType;
typedef typename IterType1::OffsetType OffsetType;
typedef typename IterType1::InternalPixelType InternalPixelType;
typedef typename IterType1::ImageType ImageType;
typedef itk::Neighborhood<InternalPixelType, ::itk::GetImageDimension<ImageType>::ImageDimension> NeighborhoodType;
void SetOffset(OffsetType off){ m_Offset=off; };
inline TOutput operator()(const IterType1 &it, const IterType2 &itOff)
{
return static_cast<OutputType>(it.GetCenterPixel()[0]);
}
double ComputeOverSingleChannel(const NeighborhoodType &neigh, const NeighborhoodType &neighOff)
{
return 0.;
}
private:
OffsetType m_Offset;
};
int otbFunctionWithNeighborhoodToImageFilterNew(int argc, char * argv[])
{
const unsigned int Dimension = 2;
typedef double PixelType;
typedef otb::Image<PixelType,Dimension> ImageType;
typedef otb::EnergyTextureImageFunction<ImageType> FunctionType;
typedef otb::Image<PixelType,Dimension> ImageType;
typedef itk::VariableLengthVector<double> VectorType;
typedef itk::ConstNeighborhoodIterator<ImageType> IteratorType;
typedef TextureFunctorTest<IteratorType, IteratorType, VectorType> FunctorType;
typedef otb::TextureImageFunction<ImageType, FunctorType> FunctionType;
typedef otb::FunctionWithNeighborhoodToImageFilter<ImageType, ImageType, FunctionType> FilterType;
// Instantiating object
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment