开发者

openCV imdecode works slowly

开发者 https://www.devze.com 2023-04-03 00:56 出处:网络
I\'m working with MJPEG big sequences (e.g. 3000 JPEGs in sequence). I\'m holding this JPEG sequence in vector of object containing JPEG data as std::vector<char> vBufferPFDecode. I want to show

I'm working with MJPEG big sequences (e.g. 3000 JPEGs in sequence). I'm holding this JPEG sequence in vector of object containing JPEG data as std::vector<char> vBufferPFDecode. I want to show this data with openCV hightGUI methods (imsho开发者_JS百科w), so I have to convert it to cv::Mat type with method:

cv::Mat pMat=cv::imdecode(cv::Mat(vBufferPFDecode), -1 );

It works, but to slowly - I can only get 8-10 frames per second. Do you know any alternative methods?


I think you are allocating a whole new frame each time, instead of using the data and attaching it to a MatHeader.

Please Post the entire code to confirm.

0

精彩评论

暂无评论...
验证码 换一张
取 消