File indexing completed on 2025-03-09 03:55:00
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 16/08/2016 0007 * Description : Full object detection class representing the output of the 0008 * shape predictor class, containing 64 facial point including 0009 * eye, nose, and mouth. 0010 * 0011 * SPDX-FileCopyrightText: 2016 by Omar Amin <Omar dot moh dot amin at gmail dot com> 0012 * SPDX-FileCopyrightText: 2016-2024 by Gilles Caulier <caulier dot gilles at gmail dot com> 0013 * 0014 * SPDX-License-Identifier: GPL-2.0-or-later 0015 * 0016 * ============================================================ */ 0017 0018 #ifndef DIGIKAM_FULL_OBJECT_DETECTION_H 0019 #define DIGIKAM_FULL_OBJECT_DETECTION_H 0020 0021 // C++ includes 0022 0023 #include <vector> 0024 0025 // Local includes 0026 0027 #include "digikam_opencv.h" 0028 #include "digikam_export.h" 0029 0030 namespace Digikam 0031 { 0032 0033 class DIGIKAM_EXPORT FullObjectDetection 0034 { 0035 public: 0036 0037 FullObjectDetection(); 0038 explicit FullObjectDetection(const cv::Rect& rect_); 0039 FullObjectDetection(const cv::Rect& rect_, 0040 const std::vector<std::vector<float> >& parts_); 0041 0042 const cv::Rect& get_rect() const; 0043 0044 cv::Rect& get_rect(); 0045 0046 unsigned long num_parts() const; 0047 0048 const std::vector<float>& part(unsigned long idx) const; 0049 0050 std::vector<float>& part(unsigned long idx); 0051 0052 private: 0053 0054 cv::Rect rect; 0055 std::vector<std::vector<float> > parts; 0056 }; 0057 0058 // ------------------------------------------------------------------- 0059 0060 std::vector<cv::Rect> getEyes(const FullObjectDetection& shape); 0061 0062 } // namespace Digikam 0063 0064 #endif // DIGIKAM_FULL_OBJECT_DETECTION_H