<commit_before>/*=========================================================================

  Program:   ORFEO Toolbox
  Language:  C++
  Date:      $Date$
  Version:   $Revision$


  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
  See OTBCopyright.txt for details.


     This software is distributed WITHOUT ANY WARRANTY; without even 
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#ifndef __otbHarrisFilter_h
#define __otbHarrisFilter_h

#include "itkImageToImageFilter.h"
#include "itkRecursiveGaussianImageFilter.h"
#include "itkHessianRecursiveGaussianImageFilter.h"
#include "itkSymmetricSecondRankTensor.h"
#include "otbHessianToScalarImageFilter.h"
#include "otbMultiplyByScalarImageFilter.h"

namespace otb
{

/** \class HarrisFilter
 *
 */

template <class TInputImage, class TOutputImage>
class HarrisImageFilter :  public itk::ImageToImageFilter< TInputImage, TOutputImage >
{
public:

  itkStaticConstMacro(		InputImageDimension,
  				unsigned int,
                      		TInputImage::ImageDimension);
  itkStaticConstMacro(		OutputImageDimension, 
  				unsigned int,
                      		TOutputImage::ImageDimension);

  typedef TInputImage InputImageType;
  typedef TOutputImage OutputImageType;

  typedef HarrisImageFilter Self;
  typedef itk::ImageToImageFilter< InputImageType, OutputImageType> Superclass;
  typedef itk::SmartPointer<Self> Pointer;
  typedef itk::SmartPointer<const Self>  ConstPointer;

  itkNewMacro(Self);

  itkTypeMacro(HarrisImageFilter, ImageToImageFilter);
  
  typedef typename InputImageType::PixelType  InputPixelType;
  typedef typename InputImageType::SizeType SizeType;

  typedef typename OutputImageType::PixelType OutputPixelType;<commit_msg>Documentation du détecteur de Harris.<commit_after>/*=========================================================================

  Program:   ORFEO Toolbox
  Language:  C++
  Date:      $Date$
  Version:   $Revision$


  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
  See OTBCopyright.txt for details.


     This software is distributed WITHOUT ANY WARRANTY; without even 
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#ifndef __otbHarrisFilter_h
#define __otbHarrisFilter_h

#include "itkImageToImageFilter.h"
#include "itkRecursiveGaussianImageFilter.h"
#include "itkHessianRecursiveGaussianImageFilter.h"
#include "itkSymmetricSecondRankTensor.h"
#include "otbHessianToScalarImageFilter.h"
#include "otbMultiplyByScalarImageFilter.h"

namespace otb
{

/** \class HarrisImageFilter
 *   \brief This filter performs the computation of the Harris measure as followed.
 *
 * The derivative computation is performed by a
 * convolution with the derivative of a Gaussian kernel of
 * variance $\sigma_D$ (derivation scale) and
 * the smoothing of the image is performed by convolving with a
 * Gaussian kernel of variance $\sigma_I$ (integration
 * scale). This allows the computation of the following matrix:
 * \begin{equation}
 * \mu(\mathbf{x},\sigma_I,\sigma_D) = \sigma_D^2 g(\sigma_I)\star
 * \left[\begin{array}{cc} L_x^2(\mathbf{x},\sigma_D) &
 * L_xL_y^2(\mathbf{x},\sigma_D)\\ L_xL_y^2(\mathbf{x},\sigma_D)&
 * L_y^2(\mathbf{x},\sigma_D) \end{array}\right] \end{equation}
 * The output of the detector is $$det(\mu) - \alpha trace^2(\mu)$$.
 *
 * The interest points can then be extracted with a thresholding filter.
 *
 */

template <class TInputImage, class TOutputImage>
class HarrisImageFilter :  public itk::ImageToImageFilter< TInputImage, TOutputImage >
{
public:

  itkStaticConstMacro(		InputImageDimension,
  				unsigned int,
                      		TInputImage::ImageDimension);
  itkStaticConstMacro(		OutputImageDimension, 
  				unsigned int,
                      		TOutputImage::ImageDimension);

  typedef TInputImage InputImageType;
  typedef TOutputImage OutputImageType;

  typedef HarrisImageFilter Self;
  typedef itk::ImageToImageFilter< InputImageType, OutputImageType> Superclass;
  typedef itk::SmartPointer<Self> Pointer;
  typedef itk::SmartPointer<const Self>  ConstPointer;

  itkNewMacro(Self);

  itkTypeMacro(HarrisImageFilter, ImageToImageFilter);
  
  typedef typename InputImageType::PixelType  InputPixelType;
  typedef typename InputImageType::SizeType SizeType;

  typedef typename OutputImageType::PixelType OutputPixelType;
{'fraction_non_alphanumeric': 0.13922155688622753, 'fraction_numerical': 0.0012831479897348161, 'mean_word_length': 5.00385109114249, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2484779', 'n_tokens_mistral': 1383, 'n_tokens_neox': 1293, 'n_words': 351}