mirror of
https://github.com/opencv/opencv.git
synced 2025-06-12 20:42:53 +08:00
Merge pull request #21369 from UnaNancyOwen:fix_uwp
Fix support objdetect module for UWP * Fix support objdetect module for UWP * Fix define module for objdetect * Remove conditional compilation from public headers * Add StsNotImplemented for FaceDetectorYN/FaceRecognizerSF * Fix typo error message * Fix error message * coding style, eliminate warnings
This commit is contained in:
parent
7f6dcc2745
commit
ed6ca0d7fa
@ -1,5 +1,16 @@
|
|||||||
set(the_description "Object Detection")
|
set(the_description "Object Detection")
|
||||||
ocv_define_module(objdetect opencv_core opencv_imgproc opencv_calib3d opencv_dnn WRAP java objc python js)
|
ocv_define_module(objdetect
|
||||||
|
opencv_core
|
||||||
|
opencv_imgproc
|
||||||
|
opencv_calib3d
|
||||||
|
OPTIONAL
|
||||||
|
opencv_dnn
|
||||||
|
WRAP
|
||||||
|
python
|
||||||
|
java
|
||||||
|
objc
|
||||||
|
js
|
||||||
|
)
|
||||||
|
|
||||||
if(HAVE_QUIRC)
|
if(HAVE_QUIRC)
|
||||||
get_property(QUIRC_INCLUDE GLOBAL PROPERTY QUIRC_INCLUDE_DIR)
|
get_property(QUIRC_INCLUDE GLOBAL PROPERTY QUIRC_INCLUDE_DIR)
|
||||||
|
@ -6,13 +6,16 @@
|
|||||||
|
|
||||||
#include "opencv2/imgproc.hpp"
|
#include "opencv2/imgproc.hpp"
|
||||||
#include "opencv2/core.hpp"
|
#include "opencv2/core.hpp"
|
||||||
|
#ifdef HAVE_OPENCV_DNN
|
||||||
#include "opencv2/dnn.hpp"
|
#include "opencv2/dnn.hpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
namespace cv
|
namespace cv
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#ifdef HAVE_OPENCV_DNN
|
||||||
class FaceDetectorYNImpl : public FaceDetectorYN
|
class FaceDetectorYNImpl : public FaceDetectorYN
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -273,6 +276,7 @@ private:
|
|||||||
|
|
||||||
std::vector<Rect2f> priors;
|
std::vector<Rect2f> priors;
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
Ptr<FaceDetectorYN> FaceDetectorYN::create(const String& model,
|
Ptr<FaceDetectorYN> FaceDetectorYN::create(const String& model,
|
||||||
const String& config,
|
const String& config,
|
||||||
@ -283,7 +287,12 @@ Ptr<FaceDetectorYN> FaceDetectorYN::create(const String& model,
|
|||||||
const int backend_id,
|
const int backend_id,
|
||||||
const int target_id)
|
const int target_id)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_OPENCV_DNN
|
||||||
return makePtr<FaceDetectorYNImpl>(model, config, input_size, score_threshold, nms_threshold, top_k, backend_id, target_id);
|
return makePtr<FaceDetectorYNImpl>(model, config, input_size, score_threshold, nms_threshold, top_k, backend_id, target_id);
|
||||||
|
#else
|
||||||
|
CV_UNUSED(model); CV_UNUSED(config); CV_UNUSED(input_size); CV_UNUSED(score_threshold); CV_UNUSED(nms_threshold); CV_UNUSED(top_k); CV_UNUSED(backend_id); CV_UNUSED(target_id);
|
||||||
|
CV_Error(cv::Error::StsNotImplemented, "cv::FaceDetectorYN requires enabled 'dnn' module.");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace cv
|
} // namespace cv
|
||||||
|
@ -4,13 +4,17 @@
|
|||||||
|
|
||||||
#include "precomp.hpp"
|
#include "precomp.hpp"
|
||||||
|
|
||||||
|
#include "opencv2/core.hpp"
|
||||||
|
#ifdef HAVE_OPENCV_DNN
|
||||||
#include "opencv2/dnn.hpp"
|
#include "opencv2/dnn.hpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
namespace cv
|
namespace cv
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#ifdef HAVE_OPENCV_DNN
|
||||||
class FaceRecognizerSFImpl : public FaceRecognizerSF
|
class FaceRecognizerSFImpl : public FaceRecognizerSF
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -173,10 +177,16 @@ private:
|
|||||||
private:
|
private:
|
||||||
dnn::Net net;
|
dnn::Net net;
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
Ptr<FaceRecognizerSF> FaceRecognizerSF::create(const String& model, const String& config, int backend_id, int target_id)
|
Ptr<FaceRecognizerSF> FaceRecognizerSF::create(const String& model, const String& config, int backend_id, int target_id)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_OPENCV_DNN
|
||||||
return makePtr<FaceRecognizerSFImpl>(model, config, backend_id, target_id);
|
return makePtr<FaceRecognizerSFImpl>(model, config, backend_id, target_id);
|
||||||
|
#else
|
||||||
|
CV_UNUSED(model); CV_UNUSED(config); CV_UNUSED(backend_id); CV_UNUSED(target_id);
|
||||||
|
CV_Error(cv::Error::StsNotImplemented, "cv::FaceRecognizerSF requires enabled 'dnn' module");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace cv
|
} // namespace cv
|
||||||
|
Loading…
Reference in New Issue
Block a user