File indexing completed on 2025-03-09 03:54:59

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2019-07-09
0007  * Description : Preprocessor for face recognition
0008  *
0009  * SPDX-FileCopyrightText: 2019      by Thanh Trung Dinh <dinhthanhtrung1996 at gmail dot com>
0010  * SPDX-FileCopyrightText: 2019-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_PREPROCESSOR_H
0017 #define DIGIKAM_RECOGNITION_PREPROCESSOR_H
0018 
0019 #include "facepreprocessor.h"
0020 
0021 // Local includes
0022 
0023 #include "digikam_export.h"
0024 
0025 namespace Digikam
0026 {
0027 
0028 enum PreprocessorSelection
0029 {
0030     OPENFACE = 0
0031 };
0032 
0033 class DIGIKAM_EXPORT RecognitionPreprocessor: public FacePreprocessor
0034 {
0035 
0036 public:
0037 
0038     explicit RecognitionPreprocessor();
0039     ~RecognitionPreprocessor()                     override;
0040 
0041 public:
0042 
0043     void init(PreprocessorSelection mode);
0044 
0045     cv::Mat preprocess(const cv::Mat& image) const override;
0046 
0047 private:
0048 
0049     // Disable
0050     RecognitionPreprocessor(const RecognitionPreprocessor&)            = delete;
0051     RecognitionPreprocessor& operator=(const RecognitionPreprocessor&) = delete;
0052 
0053 private:
0054 
0055     class Private;
0056     Private* const d;
0057 };
0058 
0059 } // namespace Digikam
0060 
0061 #endif // DIGIKAM_RECOGNITION_PREPROCESSOR_H