digiKam
imagequalityparser_p.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 25/08/2013
7  * Description : Image Quality Parser - private container
8  *
9  * Copyright (C) 2013-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2013-2014 by Gowtham Ashok <gwty93 at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option)
16  * any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #ifndef DIGIKAM_IMAGE_QUALITY_PARSER_P_H
26 #define DIGIKAM_IMAGE_QUALITY_PARSER_P_H
27 
28 #include "imagequalityparser.h"
29 
30 // C++ includes
31 
32 #include <cmath>
33 #include <cfloat>
34 #include <cstdio>
35 
36 // Qt includes
37 
38 #include <QTextStream>
39 #include <QFile>
40 #include <QImage>
41 
42 // Local includes
43 
44 #include "digikam_opencv.h"
45 #include "digikam_debug.h"
46 #include "mixerfilter.h"
47 #include "nrfilter.h"
48 #include "nrestimate.h"
49 #include "exposurecontainer.h"
50 #include "imagequalitycalculator.h"
51 
52 // To switch on/off log trace file.
53 // #define TRACE 1
54 
55 using namespace cv;
56 
57 namespace Digikam
58 {
59 
60 class Q_DECL_HIDDEN ImageQualityParser::Private
61 {
62 public:
63 
64  explicit Private()
65  : clusterCount (30),
66  size (512),
67  edgeThresh (1),
68  ratio (3),
69  kernel_size (3),
70  lowThreshold (0.4),
71  blurrejected (0.0),
72  blur (0.0),
73  acceptedThreshold(0.0),
74  pendingThreshold (0.0),
75  rejectedThreshold(0.0),
76  calculator (nullptr),
77  label (nullptr),
78  running (true)
79  {
80  for (int c = 0 ; c < 3 ; ++c)
81  {
82  fimg[c] = nullptr;
83  }
84 
85  calculator = new ImageQualityCalculator();
86  }
87 
88  float* fimg[3];
89  const uint clusterCount;
90  const uint size;
91 
94 
95  int edgeThresh;
96  int ratio;
98 
99  double lowThreshold;
100 
104 
106 
107  double blurrejected;
108  double blur;
109 
113 
114  QString path;
115 
117 
119 
120  volatile bool running;
121 };
122 
123 } // namespace Digikam
124 
125 #endif // DIGIKAM_IMAGE_QUALITY_PARSER_P_H
Definition: dimg.h:62
Definition: imagequalitycalculator.h:41
Definition: imagequalitycontainer.h:39
Definition: imagequalityparser_p.h:61
volatile bool running
Definition: imagequalityparser_p.h:120
Private()
Definition: imagequalityparser_p.h:64
int ratio
lower:upper threshold for canny edge detector algorithm
Definition: imagequalityparser_p.h:96
DImg image
original image
Definition: imagequalityparser_p.h:101
DImg img8
compression detector image on 8 bits
Definition: imagequalityparser_p.h:103
PickLabel * label
Definition: imagequalityparser_p.h:118
double blurrejected
Definition: imagequalityparser_p.h:107
DImg neimage
noise estimation image[for color]
Definition: imagequalityparser_p.h:102
ImageQualityContainer imq
Definition: imagequalityparser_p.h:105
int kernel_size
kernel size for the Sobel operations to be performed internally by the edge detector
Definition: imagequalityparser_p.h:97
double lowThreshold
Definition: imagequalityparser_p.h:99
int edgeThresh
threshold above which we say that edges are present at a point
Definition: imagequalityparser_p.h:95
ImageQualityCalculator * calculator
Definition: imagequalityparser_p.h:116
const uint clusterCount
Definition: imagequalityparser_p.h:89
Mat detected_edges
Matrix containing only edges in the image.
Definition: imagequalityparser_p.h:93
double acceptedThreshold
Definition: imagequalityparser_p.h:110
Mat src_gray
Matrix of the grayscaled source image.
Definition: imagequalityparser_p.h:92
double blur
Definition: imagequalityparser_p.h:108
const uint size
Size of squared original image.
Definition: imagequalityparser_p.h:90
double pendingThreshold
Definition: imagequalityparser_p.h:111
QString path
Path to host result file.
Definition: imagequalityparser_p.h:114
double rejectedThreshold
Definition: imagequalityparser_p.h:112
Definition: imagequalityparser.h:40
Definition: datefolderview.cpp:43
PickLabel
Definition: digikam_globals.h:122
Definition: refocusmatrix.h:75