digiKam
compression_detector.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 : 28/08/2021
7  * Description : Image Quality Parser - Compression detection
8  *
9  * Copyright (C) 2021-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_COMPRESSION_DETECTOR_H
26 #define DIGIKAM_COMPRESSION_DETECTOR_H
27 
28 // Local includes
29 
30 #include "dimg.h"
31 #include "digikam_opencv.h"
32 #include "detector.h"
33 
34 namespace Digikam
35 {
36 
38 {
39  Q_OBJECT
40 
41 public:
42 
43  explicit CompressionDetector();
45 
46  float detect(const cv::Mat& image) const override;
47 
48 private:
49 
50  template <typename Function>
51  cv::Mat checkEdgesBlock(const cv::Mat& gray_image,
52  int blockSize,
53  Function accessEdges) const;
54  cv::Mat detectMonoColorRegion(const cv::Mat& image) const;
55 
56  float normalize(const float number);
57 
58 private:
59 
60  class Private;
61  Private* const d;
62 };
63 
64 } // namespace Digikam
65 
66 #endif // DIGIKAM_COMPRESSION_DETECTOR_H
Definition: compression_detector.h:38
CompressionDetector()
Definition: compression_detector.cpp:64
float detect(const cv::Mat &image) const override
Definition: compression_detector.cpp:91
~CompressionDetector()
Definition: compression_detector.cpp:70
Definition: detector.h:41
Definition: datefolderview.cpp:43