Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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 = dstMat.data;

or

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