/usr/include/OTB-5.8/otbSinclairToCircularCovarianceMatrixFunctor.h is in libotb-dev 5.8.0+dfsg-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | /*=========================================================================
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 otbSinclairToCircularCovarianceMatrixFunctor_h
#define otbSinclairToCircularCovarianceMatrixFunctor_h
#include "vcl_complex.h"
#include "otbSinclairToCovarianceMatrixFunctor.h"
namespace otb
{
namespace Functor
{
/** \class SinclairToCircularCovarianceMatrixFunctor
* \brief Construct the fully polarimetric circular covariance matrix
* with Sinclair matrix information.
*
* Output value are:
* - channel #0 : \f$ S_{ll}.S_{ll}^{*} \f$
* - channel #1 : \f$ S_{ll}.S_{lr}^{*} \f$
* - channel #2 : \f$ S_{ll}.S_{rl}^{*} \f$
* - channel #3 : \f$ S_{ll}.S_{rr}^{*} \f$
* - channel #4 : \f$ S_{lr}.S_{lr}^{*} \f$
* - channel #5 : \f$ S_{lr}.S_{rl}^{*} \f$
* - channel #6 : \f$ S_{lr}.S_{rr}^{*} \f$
* - channel #7 : \f$ S_{rl}.S_{rl}^{*} \f$
* - channel #8 : \f$ S_{rl}.S_{rr}^{*} \f$
* - channel #9 : \f$ S_{rr}.S_{rr}^{*} \f$
*
* With:
* - \f$ S_{ll} = 0.5 * (S_{hh}+i*S_{hv}+i*S_{vh}-S_{vv}) \f$
* - \f$ S_{lr} = 0.5 * (i*S_{hh}+S_{hv}-S_{vh}+i*S_{vv}) \f$
* - \f$ S_{rl} = 0.5 * (i*S_{hh}-S_{hv}+S_{vh}+i*S_{vv}) \f$
* - \f$ S_{rr} = 0.5 * (-S_{hh}+i*S_{hv}+i*S_{vh}+S_{vv}) \f$
*
* Extract from Antennas for radar and communications Harold Mott p 317.
*
* The output pixel has 10 channels : the diagonal and the upper element of the matrix.
* Element are stored from left to right, line by line.
*
* \ingroup Functor
* \ingroup SARPolarimetry
*
* \sa SinclairImageFilter
* \sa SinclairToCoherencyMatrixFunctor
* \sa SinclairToCovarianceMatrixFunctor
* \sa SinclairToMuellerMatrixFunctor
* \sa SinclairToReciprocalCircularCovarianceMatrixFunctor
* \sa SinclairToReciprocalCoherencyMatrixFunctor
* \sa SinclairToReciprocalCovarianceMatrixFunctor
*
*
* \ingroup OTBPolarimetry
*/
template <class TInput1, class TInput2, class TInput3,
class TInput4, class TOutput>
class SinclairToCircularCovarianceMatrixFunctor
{
public:
/** Some typedefs. */
typedef double RealType;
typedef std::complex <RealType> ComplexType;
typedef typename TOutput::ValueType OutputValueType;
typedef SinclairToCovarianceMatrixFunctor<ComplexType, ComplexType, ComplexType, ComplexType, TOutput> SinclairToCovarianceFunctorType;
inline TOutput operator ()(const TInput1& Shh, const TInput2& Shv,
const TInput3& Svh, const TInput4& Svv)
{
TOutput result;
const ComplexType S_hh = static_cast<ComplexType>(Shh);
const ComplexType S_hv = static_cast<ComplexType>(Shv);
const ComplexType S_vh = static_cast<ComplexType>(Svh);
const ComplexType S_vv = static_cast<ComplexType>(Svv);
result.SetSize(m_NumberOfComponentsPerPixel);
const ComplexType jS_hv = S_hv * ComplexType(0., 1.);
const ComplexType jS_vh = S_vh * ComplexType(0., 1.);
const ComplexType jS_hh = S_hh * ComplexType(0., 1.);
const ComplexType jS_vv = S_vv * ComplexType(0., 1.);
const ComplexType coef(0.5);
const ComplexType Sll = coef*( S_hh+jS_hv+jS_vh-S_vv );
const ComplexType Slr = coef*( jS_hh+S_hv-S_vh+jS_vv );
const ComplexType Srl = coef*( jS_hh-S_hv+S_vh+jS_vv );
const ComplexType Srr = coef*( -S_hh+jS_hv+jS_vh+S_vv );
//const ComplexType conjSll = vcl_conj(Sll);
//const ComplexType conjSlr = vcl_conj(Slr);
//const ComplexType conjSrl = vcl_conj(Srl);
//const ComplexType conjSrr = vcl_conj(Srr);
SinclairToCovarianceFunctorType funct;
return ( funct( Sll, Slr, Srl, Srr ) );
}
unsigned int GetNumberOfComponentsPerPixel()
{
return m_NumberOfComponentsPerPixel;
}
/** Constructor */
SinclairToCircularCovarianceMatrixFunctor() : m_NumberOfComponentsPerPixel(10) {}
/** Destructor */
virtual ~SinclairToCircularCovarianceMatrixFunctor() {}
protected:
private:
unsigned int m_NumberOfComponentsPerPixel;
};
} // namespace Functor
} // namespace otb
#endif
|