ddt  0.1
imageStats.hpp
Go to the documentation of this file.
1 // @copyright
2 // (c) Copyright ESO 2020
3 // All Rights Reserved
4 // ESO (eso.org) is an Intergovernmental Organization, and therefore special
5 // legal conditions apply.
6 //
7 // @file imageStats.hpp
8 // @brief Image analysis and statistic function declaration.
9 //
10 // This file is part of the DDT Image Handling Library and
11 // provides functions to analyse and calculate statistic values for CPL images.
12 //
13 // @author Christoph Bortlisz, CGI
14 // @since 2020/07/29
15 //
16 
17 #ifndef IMAGESTATS_HPP_
18 #define IMAGESTATS_HPP_
19 
20 //#include <algorithm>
21 //#include <cctype>
22 #include <list>
23 #include <vector>
24 
25 //#include <sys/stat.h>
26 
27 #include <cpl.h>
28 
29 // namespace ddt {
30 
39 typedef struct CplStatistics {
43  double min_val;
47  double max_val;
51  double mean_val;
55  double rms_val;
59  int pix_num;
61 
62 const size_t MaxHistLength = 10000;
63 
69 double MaxPixelCplImage(const cpl_image* const image);
70 
80 double MaxPixelCplImageWindow(const cpl_image* const image, const int llx,
81  const int lly, const int urx, const int ury);
82 
88 double MinPixelCplImage(const cpl_image* const image);
89 
99 double MinPixelCplImageWindow(const cpl_image* const image, const int llx,
100  const int lly, const int urx, const int ury);
101 
107 double MeanPixelCplImage(const cpl_image* const image);
108 
118 double MeanPixelCplImageWindow(const cpl_image* const image, const int llx,
119  const int lly, const int urx, const int ury);
120 
126 double RmsValueCplImage(const cpl_image* const image);
127 
138 double RmsValueCplImageWindow(const cpl_image* const image, const int llx,
139  const int lly, const int urx, const int ury);
140 
147 cpl_stats* StatsCplImage(const cpl_image* const image);
148 
159 cpl_stats* StatsCplImageWindow(const cpl_image* const image, const int llx,
160  const int lly, const int urx, const int ury);
161 
168 double RmsValueCplStats(const cpl_stats* const stats_cpl);
169 
177 CplStatistics* StatisticsCplImage(const cpl_image* const image);
178 
190 CplStatistics* StatisticsCplImageWindow(const cpl_image* const image,
191  const int llx, const int lly,
192  const int urx, const int ury);
193 
201 CplStatistics* StatisticsCplStats(const cpl_stats* const stats_cpl);
202 
212 bool FwhmValuesCplImage(const cpl_image* const image, const int x_pos,
213  const int y_pos, double* const fwhm_x,
214  double* const fwhm_y);
215 
222 cpl_apertures* AperturesCplImage(const cpl_image* const image,
223  const double sigma);
224 
231 bool AperturesCplImageDump(const char* const file_name,
232  const cpl_apertures* const apertures);
233 
241 bool MinMaxPixelsCplImage(const cpl_image* const image, double* const min,
242  double* const max);
243 
253 bool MedianMinMaxPixelsCplImage(const cpl_image* const image, double* const min,
254  double* const max,
255  const double kernel_size = 5);
256 
262 void CheckForNanValues(cpl_image* const image);
263 
272 double PixelValueCplImage(const cpl_image* const image, const int x_pos,
273  const int y_pos, int* const is_rejected);
274 
282 void GetHistogram(const cpl_image* const image, const int64_t min_value,
283  const int64_t max_value, std::vector<int>& distribution);
284 
294 void GetHistogramBins(const cpl_image* const image, const int64_t min_value,
295  const int64_t max_value, std::vector<int>& distribution);
296 
306 void GetCutValuesPercentage(const cpl_image* const image,
307  const double percentage, double* const min_value,
308  double* const max_value);
309 
325 bool Get_IQE_Values(const cpl_image* const subImage, double* const x_axis_angle,
326  double* const background,
327  double* const peak_above_background, double* const fwhm_x,
328  double* const fwhm_y, double* const object_coord_x,
329  double* const object_coord_y);
330 
340 bool MinMaxInvalidCheck(const cpl_image* const image, double* const min,
341  double* const max);
342 
350 double SigmaCplImage(const cpl_image* const image, double* const sigma);
351 
363 double SigmaCplImageWindow(const cpl_image* const image, const int llx,
364  const int lly, const int urx, const int ury,
365  double* const sigma);
366 //} // namespace ddt
367 
368 #endif /* IMAGESTATS_HPP_ */
SigmaCplImageWindow
double SigmaCplImageWindow(const cpl_image *const image, const int llx, const int lly, const int urx, const int ury, double *const sigma)
Definition: imageStats.cpp:720
FwhmValuesCplImage
bool FwhmValuesCplImage(const cpl_image *const image, const int x_pos, const int y_pos, double *const fwhm_x, double *const fwhm_y)
Definition: imageStats.cpp:262
CplStatistics::min_val
double min_val
Definition: imageStats.hpp:43
StatsCplImageWindow
cpl_stats * StatsCplImageWindow(const cpl_image *const image, const int llx, const int lly, const int urx, const int ury)
Definition: imageStats.cpp:165
CplStatistics::rms_val
double rms_val
Definition: imageStats.hpp:55
MeanPixelCplImage
double MeanPixelCplImage(const cpl_image *const image)
Definition: imageStats.cpp:82
RmsValueCplImageWindow
double RmsValueCplImageWindow(const cpl_image *const image, const int llx, const int lly, const int urx, const int ury)
Definition: imageStats.cpp:128
MinMaxPixelsCplImage
bool MinMaxPixelsCplImage(const cpl_image *const image, double *const min, double *const max)
Definition: imageStats.cpp:313
MinPixelCplImageWindow
double MinPixelCplImageWindow(const cpl_image *const image, const int llx, const int lly, const int urx, const int ury)
Definition: imageStats.cpp:72
RmsValueCplStats
double RmsValueCplStats(const cpl_stats *const stats_cpl)
Definition: imageStats.cpp:179
MedianMinMaxPixelsCplImage
bool MedianMinMaxPixelsCplImage(const cpl_image *const image, double *const min, double *const max, const double kernel_size=5)
Definition: imageStats.cpp:369
PixelValueCplImage
double PixelValueCplImage(const cpl_image *const image, const int x_pos, const int y_pos, int *const is_rejected)
Definition: imageStats.cpp:445
StatisticsCplImage
CplStatistics * StatisticsCplImage(const cpl_image *const image)
Definition: imageStats.cpp:200
AperturesCplImageDump
bool AperturesCplImageDump(const char *const file_name, const cpl_apertures *const apertures)
Definition: imageStats.cpp:292
MaxPixelCplImage
double MaxPixelCplImage(const cpl_image *const image)
Definition: imageStats.cpp:36
GetHistogram
void GetHistogram(const cpl_image *const image, const int64_t min_value, const int64_t max_value, std::vector< int > &distribution)
Definition: imageStats.cpp:452
MaxHistLength
const size_t MaxHistLength
Definition: imageStats.hpp:62
CplStatistics
struct CplStatistics CplStatistics
SigmaCplImage
double SigmaCplImage(const cpl_image *const image, double *const sigma)
Definition: imageStats.cpp:716
StatsCplImage
cpl_stats * StatsCplImage(const cpl_image *const image)
Definition: imageStats.cpp:149
CplStatistics::pix_num
int pix_num
Definition: imageStats.hpp:59
Get_IQE_Values
bool Get_IQE_Values(const cpl_image *const subImage, double *const x_axis_angle, double *const background, double *const peak_above_background, double *const fwhm_x, double *const fwhm_y, double *const object_coord_x, double *const object_coord_y)
Definition: imageStats.cpp:618
CplStatistics
Definition: imageStats.hpp:39
CheckForNanValues
void CheckForNanValues(cpl_image *const image)
Definition: imageStats.cpp:421
CplStatistics::max_val
double max_val
Definition: imageStats.hpp:47
StatisticsCplImageWindow
CplStatistics * StatisticsCplImageWindow(const cpl_image *const image, const int llx, const int lly, const int urx, const int ury)
Definition: imageStats.cpp:219
GetHistogramBins
void GetHistogramBins(const cpl_image *const image, const int64_t min_value, const int64_t max_value, std::vector< int > &distribution)
Definition: imageStats.cpp:485
MaxPixelCplImageWindow
double MaxPixelCplImageWindow(const cpl_image *const image, const int llx, const int lly, const int urx, const int ury)
Definition: imageStats.cpp:49
CplStatistics::mean_val
double mean_val
Definition: imageStats.hpp:51
MinMaxInvalidCheck
bool MinMaxInvalidCheck(const cpl_image *const image, double *const min, double *const max)
Definition: imageStats.cpp:666
RmsValueCplImage
double RmsValueCplImage(const cpl_image *const image)
Definition: imageStats.cpp:105
StatisticsCplStats
CplStatistics * StatisticsCplStats(const cpl_stats *const stats_cpl)
Definition: imageStats.cpp:237
GetCutValuesPercentage
void GetCutValuesPercentage(const cpl_image *const image, const double percentage, double *const min_value, double *const max_value)
Definition: imageStats.cpp:537
MeanPixelCplImageWindow
double MeanPixelCplImageWindow(const cpl_image *const image, const int llx, const int lly, const int urx, const int ury)
Definition: imageStats.cpp:95
AperturesCplImage
cpl_apertures * AperturesCplImage(const cpl_image *const image, const double sigma)
Definition: imageStats.cpp:281
MinPixelCplImage
double MinPixelCplImage(const cpl_image *const image)
Definition: imageStats.cpp:59