Skip to content
Snippets Groups Projects
Commit 25dca5e6 authored by Cyrille Valladeau's avatar Cyrille Valladeau
Browse files

STYLE : add latex comments in SFS

parent 024303e4
No related branches found
No related tags found
No related merge requests found
......@@ -26,10 +26,28 @@
namespace otb
{
/** \class LineDirectionFunctor
* \brief This functor first computes the spectral angle according to a reference pixel.
* \brief Then multiplies the result by a gaussian coefficient
* \brief And reverse the pixel values.
* \brief This functor computes textures based on line direction analysis through the central pixel.
*
* Directions are computed using NumberOfDirection, used to compute a constant step angle.
* A direction is defined as : $\mathit{d_{i} = \sqrt{(m^{e1}-m{e2})^{2}+(n^{e1}-n{e2})^{2}}}$
* From $\mathit{d_{i}}, histograms are defined :
* $\mathit{H(c) : \{c \in I \mid \lbrack d_{1}(c), \ldots , d_{i}(c), \ldots , d_{D}(c)\rbrack \}}$
* Thus, 6 textures are defined :
* $\mathit{length = \max_{i \in \lbrack1;D\rbrack}(d_{i}(c)}$
* $\mathit{width = \min_{i \in \lbrack1;D\rbrack}(d_{i}(c)}$
* $\mathit{PSI = \frac{1}{D}\sum_{1=1}^{D}d_{i}(c)}$
* $\mathit{\omega-mean = \frac{1}{D}\sum_{1=1}^{D}\frac{\alpha.(k_{i}-1)}{st_{i}}d_{i}(c)}$
* $\mathit{ratio = \arctan{\frac{\sum_{j=1}^{n}{sort_{min}^{j}(H(c))}}{\sum_{j=1}^{n}{sort_{max}^{j}(H(c))}}}}$
* $\mathit{SD = \frac{1}{D-1}\sqrt{\sum_{1=1}^{D}(d_{i}(c)-PSI)^{2}}}$
*
* For more details, please refer to refer to Xin Huang, Liangpei Zhang and Pingxiang Li publication,
* Classification and Extraction of Spatial Features in Urban Areas
* Using High-Resolution Multispectral Imagery.
* IEEE Geoscience and Remote Sensing Letters,
* vol. 4, n. 2, 2007, pp 260-264
*/
namespace Functor
{
template<class TIter,class TOutputValue>
......@@ -53,7 +71,6 @@ public:
typedef typename TIter::OffsetType OffsetType;
typedef TOutputValue OutputValueType;
typedef std::vector<OutputValueType> OutputType;
//typedef typename TOutputValue::ValueType InternalOutputPixelType;
void SetSpatialThreshold( unsigned int thresh ){ m_SpatialThreshold=thresh; };
void SetSpectralThreshold( InternalPixelType thresh ){ m_SpectralThreshold=thresh; };
......@@ -98,9 +115,6 @@ public:
std::vector<double>::iterator itVector;
OutputType out(6, 0);
//TOutputValue out;
//out.SetSize(6);
//out.Fill(0);
OffsetType off;
off.Fill(0);
......
......@@ -26,17 +26,31 @@ PURPOSE. See the above copyright notices for more information.
namespace otb
{
/** \class LineDirectionImageFilter
* \brief This functor computes water, ndvi and spectral index of an image
*/
/** \class LineDirectionImageFilter
* \brief This functor computes the texture describes in the following publication
* It is based on line direction estimation.
*
* Please refer to Xin Huang, Liangpei Zhang and Pingxiang Li publication,
* Classification and Extraction of Spatial Features in Urban Areas
* Using High-Resolution Multispectral Imagery.
* IEEE Geoscience and Remote Sensing Letters,
* vol. 4, n. 2, 2007, pp 260-264
*
* The texture is computaed for each pixel using its neighborhood.
* User can set the spatial threshold taht is the max line length, the spectral threshold
* that is the max difference authorized between a pixel of the line and the center pixel
* of the current neighborhood. Alpha and RationMaxConsideration are used to compute
* the \omega -mean value. Finally, The number of direction can be precised with
* NumberOfDirections.
* You can choose the computed textures using SetTextureStatus method (1:length, 2:width,
* 3:PSI, 4:w-mean, 5:ratio, 6:SD).
*
* \sa LineDirectionFunctor
*/
template <class TInputImage, class TOutputImage>
class ITK_EXPORT LineDirectionImageFilter :
public itk::ImageToImageFilter<TInputImage,TOutputImage>
/*UnaryFunctorNeighborhoodImageFilter< TInputImage,
TOutputImage,
Functor::LineDirectionFunctor< ITK_TYPENAME itk::ConstNeighborhoodIterator<TInputImage>,
ITK_TYPENAME TOutputImage::InternalPixelType> >*/
{
public:
/** Standard class typedefs. */
......@@ -54,22 +68,18 @@ public:
itkTypeMacro(UnaryFunctorNeighborhoodImageFilter,ImageToImageFilter);
/** Some convenient typedefs. */
typedef typename InputImageType::ConstPointer InputImagePointerType;
typedef typename InputImageType::RegionType InputImageRegionType;
typedef typename InputImageType::PixelType InputImagePixelType;
typedef typename InputImageType::SizeType InputImageSizeType;
typedef typename OutputImageType::Pointer OutputImagePointerType;
typedef typename OutputImageType::RegionType OutputImageRegionType;
typedef typename OutputImageType::PixelType OutputImagePixelType;
//typedef typename OutputImageType::InternalPixelType OutputInternalImagePixelType;
typedef itk::ConstNeighborhoodIterator<TInputImage> NeighborhoodIteratorType;
typedef typename NeighborhoodIteratorType::RadiusType RadiusType;
////////////////////////////////////////////
// CHANGE THE OUTPUTINTERNAZL INTO OUTPUTPIXE/////////////
///////////////////////////////////////////
typedef typename InputImageType::ConstPointer InputImagePointerType;
typedef typename InputImageType::RegionType InputImageRegionType;
typedef typename InputImageType::PixelType InputImagePixelType;
typedef typename InputImageType::SizeType InputImageSizeType;
typedef typename OutputImageType::Pointer OutputImagePointerType;
typedef typename OutputImageType::RegionType OutputImageRegionType;
typedef typename OutputImageType::PixelType OutputImagePixelType;
typedef itk::ConstNeighborhoodIterator<TInputImage> NeighborhoodIteratorType;
typedef typename NeighborhoodIteratorType::RadiusType RadiusType;
typedef Functor::LineDirectionFunctor< NeighborhoodIteratorType,OutputImagePixelType > FunctorType;
typedef typename FunctorType::OutputType FunctorOutputType;
typedef itk::ProcessObject ProcessObjectType;
typedef typename FunctorType::OutputType FunctorOutputType;
typedef itk::ProcessObject ProcessObjectType;
/**Set/Get the radius of neighborhood.*/
itkGetMacro(Radius,unsigned int);
......
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