digiKam
facedetector.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam
4  *
5  * Date : 2010-09-02
6  * Description : A convenience class for a standalone face detector
7  *
8  * Copyright (C) 2010 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
9  * Copyright (C) 2010 by Aditya Bhatt <adityabhatt1991 at gmail dot com>
10  * Copyright (C) 2010-2022 by Gilles Caulier <caulier dot gilles 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_FACESENGINE_FACEDETECTOR_H
26 #define DIGIKAM_FACESENGINE_FACEDETECTOR_H
27 
28 // Qt includes
29 
30 #include <QExplicitlySharedDataPointer>
31 #include <QImage>
32 #include <QVariant>
33 
34 // Local includes
35 
36 #include "digikam_export.h"
37 #include "dimg.h"
38 
39 namespace Digikam
40 {
41 
42 class DIGIKAM_EXPORT FaceDetector
43 {
44 
45 public:
46 
57  FaceDetector();
58  FaceDetector(const FaceDetector& other);
59  ~FaceDetector();
60 
61  QString backendIdentifier() const;
62 
63  FaceDetector& operator=(const FaceDetector& other);
64 
73  QList<QRectF> detectFaces(const QImage& image, const QSize& originalSize = QSize());
74 
83  QList<QRectF> detectFaces(const DImg& image, const QSize& originalSize = QSize());
84 
85  QList<QRectF> detectFaces(const QString& imagePath);
86 
98  void setParameter(const QString& parameter, const QVariant& value);
99  void setParameters(const QVariantMap& parameters);
100  QVariantMap parameters() const;
101 
106  int recommendedImageSize(const QSize& availableSize = QSize()) const;
107 
108  static QRectF toRelativeRect(const QRect& absoluteRect, const QSize& size);
109  static QRect toAbsoluteRect(const QRectF& relativeRect, const QSize& size);
110  static QList<QRectF> toRelativeRects(const QList<QRect>& absoluteRects, const QSize& size);
111  static QList<QRect> toAbsoluteRects(const QList<QRectF>& relativeRects, const QSize& size);
112 
113 private:
114 
115  class Private;
116  QExplicitlySharedDataPointer<Private> d;
117 };
118 
119 } // namespace Digikam
120 
121 #endif // DIGIKAM_FACESENGINE_FACEDETECTOR_H
Definition: dimg.h:62
Definition: facedetector.h:43
qulonglong value
Definition: itemviewutilities.cpp:592
Definition: datefolderview.cpp:43