Wie richtig, um openCV -APIs zu wickeln, die cv :: inputArray/cv :: outputArray/cv :: InputOutputArray für P/Invoke (C#)C++

Programme in C++. Entwicklerforum
Anonymous
 Wie richtig, um openCV -APIs zu wickeln, die cv :: inputArray/cv :: outputArray/cv :: InputOutputArray für P/Invoke (C#)

Post by Anonymous »

I am writing my custom OpenCV wrapper (now I am using OpenCV 4.11) for C#
There are several reason for writing custom wrapper instead of using existing solutions (such as EmguCV):
  • I need actual version of OpenCV
  • I need CUDA support
  • I don't need a whole functionality of OpenCV
I am using DNN-based face detector for face detection (see cv::FaceDetectorYN), in particular detect method
This method has two input parameters: cv::InputArray and cv::OutputArray
My wrapped method (I expose two detect Überladungen) < /p>
C ++ Seite: < /p>

Code: Select all

extern "C" {
WRAPPEROPENCV_DLL_API void* Create_FaceDetect_DNN(const char* model, const char* config,
cv::Size input_size, float score_threshold, float nms_threshold, int top_k,
int backend_id, int target_id) {
cv::Ptr* faceDetectorYN = new cv::Ptr(
cv::FaceDetectorYN::create(model, config, input_size, score_threshold,
nms_threshold, top_k, backend_id, target_id));

if (faceDetectorYN->empty()) {
std::cerr

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post