Ask Your Question

Revision history [back]

You use method getMat with parameter access flag

There is an example in cam_shift.cpp

You use method getMat with parameter access flag

There is an example in cam_shift.cpp

You cannot access to gpu data. Method getMat make a copy of gpu data to cpu and when it is finished copy cpu data to gpu

example

UMat w;
...
// get access to UMat
{
Mat b= w.getMat(cv::ACCESS_READ);
b.at<Vec3b>(10,12) = Vec3b(17,15,14);
} // b object is copy to gpu and b is destroyed (cpu memory used)

You use method getMat with parameter access flag

There is an example in cam_shift.cpp

You cannot access to gpu data. Method getMat make a copy of gpu data to cpu and when it is finished copy cpu data to gpu

example

UMat w;
...
// get access to UMat
{
Mat b= w.getMat(cv::ACCESS_READ);
b.at<Vec3b>(10,12) b.at<Vec3b>(Point(10,12)) = Vec3b(17,15,14);
} // b object is copy to gpu and b is destroyed (cpu memory used)