Please provide complete information as applicable to your setup.
**• Hardware Platform (Jetson / GPU)**Jetson • DeepStream Version6.1.1
**• JetPack Version (valid for Jetson only)**5.1.1
**• Issue Type( questions, new requirements, bugs)**questions
Hi,guys,I am trying to add extra function in deepstream-app sample to realize edge detection.To realize that,I need to use opencv.A suggestion I get is to add the function in deepstream_app.c/gie_processing_done_buf_prob function,and I add something like:
Ellipse_feature_extraction2 is my costum edge detection function to get an angle from each detected object defined in the deepstream_app_config_parser_yaml.cpp because it involves some opencv functions.
My opinion is to define the codes involving opencv in the deepstream_app_config_parser_yaml.cpp and give it a statement in deepstream_app.h.Then it maybe can be used in the deepstream_app.c just like the
As you know, gst_buffer contains nvbufsurface, which is a handle to the gpu memory, so if you want to use opencv for processing, you need to copy the memory to the cpu
By the way ,the error is like: /usr/include/opencv4/opencv2/core.hpp:49:4: error: #error core.hpp header must be compiled as C++
So maybe I should include something like opencv2/imgproc/imgproc.h ?
So maybe I can’t just change it to cpp file easily.
The opinion I want to state my custom function in deepstream_app.h is because I see the function in deepstream_app_config_parser_yaml.cpp stated in the deepstream_app.h so that the function can be used in deepstream_app_main.c.
So I imitate the opinion and define the void Ellipse_feature_extraction2 in deepstream_app_config_parser_yaml.cpp and then give it a statement in deepstream_app.h.
The statement I add is :
#include <opencv2/opencv.hpp>
using namespace cv
void Ellipse_feature_extraction2(const Mat& img,float& angle);
Just like I mentioned before.But here
const Mat
infers to cv::Mat which do not belongs to C files,so maybe that’s why the error occurs.
In that case,I say that: So maybe I should include something like **opencv2/imgproc/imgproc.h**
Because opencv2/imgproc/imgproc.h includes the C API of opencv,do you think I should do this?
There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks