File indexing completed on 2025-01-30 10:11:40
0001
0002
0003
0004
0005
0006
0007
0008
0009 #if !defined (Magick_ChannelMoments_header)
0010 #define Magick_ChannelMoments_header
0011
0012 #include "Magick++/Include.h"
0013 #include <vector>
0014
0015 namespace Magick
0016 {
0017 class Image;
0018
0019 class MagickPPExport ChannelMoments
0020 {
0021 public:
0022
0023
0024 ChannelMoments(void);
0025
0026
0027 ChannelMoments(const ChannelMoments &channelMoments_);
0028
0029
0030 ~ChannelMoments(void);
0031
0032
0033 double centroidX(void) const;
0034
0035
0036 double centroidY(void) const;
0037
0038
0039 PixelChannel channel(void) const;
0040
0041
0042 double ellipseAxisX(void) const;
0043
0044
0045 double ellipseAxisY(void) const;
0046
0047
0048 double ellipseAngle(void) const;
0049
0050
0051 double ellipseEccentricity(void) const;
0052
0053
0054 double ellipseIntensity(void) const;
0055
0056
0057 double huInvariants(const size_t index_) const;
0058
0059
0060 bool isValid() const;
0061
0062
0063
0064
0065
0066 ChannelMoments(const PixelChannel channel_,
0067 const MagickCore::ChannelMoments *channelMoments_);
0068
0069 private:
0070 PixelChannel _channel;
0071 std::vector<double> _huInvariants;
0072 double _centroidX;
0073 double _centroidY;
0074 double _ellipseAxisX;
0075 double _ellipseAxisY;
0076 double _ellipseAngle;
0077 double _ellipseEccentricity;
0078 double _ellipseIntensity;
0079 };
0080
0081 class MagickPPExport ChannelPerceptualHash
0082 {
0083 public:
0084
0085
0086 ChannelPerceptualHash(void);
0087
0088
0089 ChannelPerceptualHash(const ChannelPerceptualHash &channelPerceptualHash_);
0090
0091
0092 ChannelPerceptualHash(const PixelChannel channel_,
0093 const std::string &hash_);
0094
0095
0096 ~ChannelPerceptualHash(void);
0097
0098
0099 operator std::string() const;
0100
0101
0102 PixelChannel channel(void) const;
0103
0104
0105 bool isValid() const;
0106
0107
0108 double sumSquaredDifferences(
0109 const ChannelPerceptualHash &channelPerceptualHash_);
0110
0111
0112 double srgbHuPhash(const size_t index_) const;
0113
0114
0115 double hclpHuPhash(const size_t index_) const;
0116
0117
0118
0119
0120
0121 ChannelPerceptualHash(const PixelChannel channel_,
0122 const MagickCore::ChannelPerceptualHash *channelPerceptualHash_);
0123
0124 private:
0125 PixelChannel _channel;
0126 std::vector<double> _srgbHuPhash;
0127 std::vector<double> _hclpHuPhash;
0128 };
0129
0130
0131
0132
0133 class MagickPPExport ChannelStatistics
0134 {
0135 public:
0136
0137
0138 ChannelStatistics(void);
0139
0140
0141 ChannelStatistics(const ChannelStatistics &channelStatistics_);
0142
0143
0144 ~ChannelStatistics(void);
0145
0146
0147 double area() const;
0148
0149
0150 PixelChannel channel(void) const;
0151
0152
0153 size_t depth() const;
0154
0155
0156 double entropy() const;
0157
0158
0159 bool isValid() const;
0160
0161
0162 double kurtosis() const;
0163
0164
0165 double maxima() const;
0166
0167
0168 double mean() const;
0169
0170
0171 double minima() const;
0172
0173
0174 double skewness() const;
0175
0176
0177 double standardDeviation() const;
0178
0179
0180 double sum() const;
0181
0182
0183 double sumCubed() const;
0184
0185
0186 double sumFourthPower() const;
0187
0188
0189 double sumSquared() const;
0190
0191
0192 double variance() const;
0193
0194
0195
0196
0197
0198 ChannelStatistics(const PixelChannel channel_,
0199 const MagickCore::ChannelStatistics *channelStatistics_);
0200
0201 private:
0202 PixelChannel _channel;
0203 double _area;
0204 size_t _depth;
0205 double _entropy;
0206 double _kurtosis;
0207 double _maxima;
0208 double _mean;
0209 double _minima;
0210 double _skewness;
0211 double _standardDeviation;
0212 double _sum;
0213 double _sumCubed;
0214 double _sumFourthPower;
0215 double _sumSquared;
0216 double _variance;
0217 };
0218
0219 class MagickPPExport ImageMoments
0220 {
0221 public:
0222
0223
0224 ImageMoments(void);
0225
0226
0227 ImageMoments(const ImageMoments &imageMoments_);
0228
0229
0230 ~ImageMoments(void);
0231
0232
0233 ChannelMoments channel(const PixelChannel channel_) const;
0234
0235
0236
0237
0238 ImageMoments(const Image &image_);
0239
0240 private:
0241 std::vector<ChannelMoments> _channels;
0242 };
0243
0244 class MagickPPExport ImagePerceptualHash
0245 {
0246 public:
0247
0248
0249 ImagePerceptualHash(void);
0250
0251
0252 ImagePerceptualHash(const ImagePerceptualHash &imagePerceptualHash_);
0253
0254
0255 ImagePerceptualHash(const std::string &hash_);
0256
0257
0258 ~ImagePerceptualHash(void);
0259
0260
0261 operator std::string() const;
0262
0263
0264 ChannelPerceptualHash channel(const PixelChannel channel_) const;
0265
0266
0267 bool isValid() const;
0268
0269
0270 double sumSquaredDifferences(
0271 const ImagePerceptualHash &channelPerceptualHash_);
0272
0273
0274
0275
0276 ImagePerceptualHash(const Image &image_);
0277
0278 private:
0279 std::vector<ChannelPerceptualHash> _channels;
0280 };
0281
0282 class MagickPPExport ImageStatistics
0283 {
0284 public:
0285
0286
0287 ImageStatistics(void);
0288
0289
0290 ImageStatistics(const ImageStatistics &imageStatistics_);
0291
0292
0293 ~ImageStatistics(void);
0294
0295
0296 ChannelStatistics channel(const PixelChannel channel_) const;
0297
0298
0299
0300
0301 ImageStatistics(const Image &image_);
0302
0303 private:
0304 std::vector<ChannelStatistics> _channels;
0305 };
0306 }
0307
0308 #endif