Ask Your Question

victor.dmdb's profile - activity

2020-04-29 21:31:54 -0500 received badge  Famous Question (source)
2018-11-02 04:46:01 -0500 received badge  Notable Question (source)
2018-07-23 07:02:48 -0500 received badge  Popular Question (source)
2017-02-15 08:21:49 -0500 received badge  Supporter (source)
2017-02-15 07:45:14 -0500 commented answer Best way to save CV_16SC3 frames

Also sorry, the fps thing wasn't related to the speed, but most just stating i'm storing large 16bit matrices at a high rate. My concern would actually more be towards compression than speed.

2017-02-15 07:00:40 -0500 commented question Best way to save CV_16SC3 frames

Need to store different data types to hold multiple data sources for each frame. All the data have the same resolution. Yep I was converting them to 16S before merging anyway.

2017-02-15 04:42:30 -0500 asked a question Best way to save CV_16SC3 frames

VideoWriter doesn't seem to have any 16bit codecs (or am I wrong about that?), so should these be saved with FileStorage instead? Assuming I need to save 16bit images at 25+ fps.

I'm actually trying to save an 8U, 16U and 16S at the same time, so I just merge all three into an CV_16SC3 Mat. Or is there a better solution to this?

2017-01-26 22:05:33 -0500 commented question VIDEOIO ERROR: V4L

Ok no the solution above simply silences the error, but will still get an empty stream if it opens successfully


will be 0

2017-01-25 12:48:27 -0500 commented question VIDEOIO ERROR: V4L

I might have fixed this with

cv::VideoCapture cap = cv::VideoCapture( "", cv::CAP_FFMPEG  );
2017-01-25 11:59:45 -0500 received badge  Editor (source)
2017-01-25 11:55:25 -0500 asked a question VIDEOIO ERROR: V4L

I get the following error when I try to initialise a videocapture with a url:

cv::VideoCapture cap = cv::VideoCapture( ""  );


VIDEOIO ERROR: V4L: device Unable to query number of channels

There is nothing wrong with the videofile or access rights.

I recently recompiled ffmpeg with extra libs, and opencv 3.2 on ubuntu xenial, with the following configs:


./configure --enable-gpl --enable-version3 --enable-nonfree --enable-libmfx --enable-runtime-cpudetect --enable-gray --enable-vaapi --enable-vdpau --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libfdk-aac --enable-libtheora --enable-libvpx --enable-libwebp --enable-x11grab --cpu=native --enable-vaapi --enable-vdpau --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libwavpack --enable-libxvid --enable-libx264 --enable-libx265 --enable-openssl --enable-nvenc --enable-cuda --enable-omx --enable-libv4l2

opencv 3.2


Could it be that I compiled opencv with VAor opencl?

EDIT: I tried recompiling opencv without the extra parameters and get the same issue:

2017-01-24 04:39:35 -0500 asked a question UMat empty with VideoCapture

This will work with a normal Mat, as in the image will be retrieved correctly.

cv::Mat mat;
std::string url = "";
cv::VideoCapture cap(url);
cap >> mat;

But if done with a UMat the retrieve mat will be empty. I'm running on Ubuntu xenial, and have recently tried installing (for ffmpeg, not opencv)

Would that maybe cause the issue?

2017-01-16 20:20:00 -0500 received badge  Enthusiast
2017-01-10 08:19:58 -0500 received badge  Scholar (source)
2017-01-10 08:19:55 -0500 commented answer UMat operators

haha, alright I was asking for a compare function, and there is indeed a compare function, I probably should have looked better

2017-01-10 02:47:55 -0500 commented answer UMat operators

As in with cv::Mat one can do:

cv::Mat A = cv::Mat(1000, 1000, CV_8UC3), B = cv::Mat(1000, 1000, CV_8UC3);
cv::randu(A, Scalar::all(0), Scalar::all(255));
cv::randu(B, Scalar::all(0), Scalar::all(255));
cv::Mat C = A > B;

Is there any way to do the same with cv::UMat directly?

2017-01-09 23:57:05 -0500 commented answer UMat operators

so regarding the 1st issue, I would run cv::bitwise_not(umat, umat), though I've understood its not recommended to overwrite a matrix with itself, is that incorrect? Also how would I compare 2 umat matrices, since they don't have any equivalent bitwise functions?

2017-01-09 21:40:45 -0500 asked a question UMat operators

How does one use basic matrix operators with cv::UMat, similar to those available for cv::Mat. For example using ~ for bitwise_not, or comparing 2 matrices with >.

I'm aware of getMat, but I assume that using that function would remove the advantages of using UMat.

Also are there any efficiency differences between the 2 options below?

  cv::UMat srcMat;
  cv::Mat dstMat;
  cv::cvtColor(srcMat, dstMat, CV_BGR2YUV);
  uint8_t * data =;


  cv::UMat srcMat, dstMat;
  cv::cvtColor(srcMat, dstMat, CV_BGR2YUV);
  uint8_t * data = dstMat.getMat(cv::ACCESS_READ).data;