digiKam
imagequalitycalculator.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 Calculor
8  *
9  * Copyright (C) 2013-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2021 by Phuoc Khanh Le <phuockhanhnk94 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_CALCULATOR_H
26 #define DIGIKAM_IMAGE_QUALITY_CALCULATOR_H
27 
28 // Local includes
29 
30 #include "digikam_globals.h"
31 
32 // Qt includes
33 
34 #include <QString>
35 #include <QList>
36 
37 namespace Digikam
38 {
39 
41 {
42 public:
43 
45  {
46  QString detetionType;
47  float weight;
48  float score;
49  };
50 
51 public:
52 
53  explicit ImageQualityCalculator();
55 
56  float calculateQuality() const;
57  void addDetectionResult(const QString& name,
58  const float score,
59  const float weight) const;
60 
61 private:
62 
63  void normalizeWeight() const;
64  void adjustWeightByQualityLevel() const;
65  int numberDetectors() const;
66 
67  // Disable
69  ImageQualityCalculator& operator=(const ImageQualityCalculator&) = delete;
70 
71 private:
72 
73  class Private;
74  Private* const d;
75 };
76 
77 } // namespace Digikam
78 
79 #endif // DIGIKAM_IMAGE_QUALITY_CALCULATOR_H
Definition: imagequalitycalculator.h:41
float calculateQuality() const
Definition: imagequalitycalculator.cpp:92
ImageQualityCalculator()
Definition: imagequalitycalculator.cpp:53
~ImageQualityCalculator()
Definition: imagequalitycalculator.cpp:59
void addDetectionResult(const QString &name, const float score, const float weight) const
Definition: imagequalitycalculator.cpp:64
Definition: datefolderview.cpp:43
Definition: imagequalitycalculator.h:45
float weight
Definition: imagequalitycalculator.h:47
float score
Definition: imagequalitycalculator.h:48
QString detetionType
Definition: imagequalitycalculator.h:46