File indexing completed on 2025-01-19 03:57:57

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2010-09-03
0007  * Description : Integrated, multithread face detection / recognition
0008  *
0009  * SPDX-FileCopyrightText: 2010-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
0010  * SPDX-FileCopyrightText: 2012-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0011  *
0012  * SPDX-License-Identifier: GPL-2.0-or-later
0013  *
0014  * ============================================================ */
0015 
0016 #ifndef DIGIKAM_RECOGNITION_WORKER_H
0017 #define DIGIKAM_RECOGNITION_WORKER_H
0018 
0019 // Local includes
0020 
0021 #include "facepipeline_p.h"
0022 #include "faceitemretriever.h"
0023 
0024 namespace Digikam
0025 {
0026 
0027 class Q_DECL_HIDDEN RecognitionWorker : public WorkerObject
0028 {
0029     Q_OBJECT
0030 
0031 public:
0032 
0033     explicit RecognitionWorker(FacePipeline::Private* const dd);
0034     ~RecognitionWorker() override;
0035 
0036 public Q_SLOTS:
0037 
0038     void process(const FacePipelineExtendedPackage::Ptr& package);
0039     void setThreshold(double threshold, bool);
0040 
0041     // TODO: add set K-Nearest method
0042 
0043 protected:
0044 
0045     void aboutToDeactivate() override;
0046 
0047 Q_SIGNALS:
0048 
0049     void processed(const FacePipelineExtendedPackage::Ptr& package);
0050 
0051 protected:
0052 
0053     FaceItemRetriever            imageRetriever;
0054     FacialRecognitionWrapper     recognizer;
0055     FacePipeline::Private* const d;
0056 
0057 private:
0058 
0059     // Disable
0060     RecognitionWorker(const RecognitionWorker&)            = delete;
0061     RecognitionWorker& operator=(const RecognitionWorker&) = delete;
0062 };
0063 
0064 } // namespace Digikam
0065 
0066 #endif // DIGIKAM_RECOGNITION_WORKER_H