Analytic: Cameras' frames decoding for AI model
AnsweredHi,
We noticed that the slowest and the most CPU consuming part of the Plugin, when using AI model, is the recovering and the decoding phase of the cameras' frames. Here how they are recovered in our implementation:
cv::Mat img(
/*_rows*/ videoFrame->height(),
/*_cols*/ videoFrame->width(),
/*_type*/ CV_8UC3, // BGR color space (default for OpenCV)
/*_data*/ (void*)videoFrame->data(0),
/*_step*/ (size_t)videoFrame->lineSize(0));
Is there a faster method to recover it?
Regards,
-
Hello Riles Oualis ,
I'm afraid there nothing we can recommend about the OpenCV framework itself, except trying to use different pixel type. For example, CV_8UC1 instead of CV_8UC3. See
types_c.h.But here are some guidelines.
If your scenario permits
1. Skip frames and don't process every frame.
2. Use another faster framework.
3. Process black and white frames, not color ones.
4. Reduce frame resolution.0
Please sign in to leave a comment.
Comments
1 comment