My GpuMat? I only have normal Mat from VideoCapture, that I replaced dstHost in your code with.
If I understand correctly srcDevice.download(dstHost) should load my CPU frame to GPU one?
// That gives me rotated white boxes
GpuMat srcDevice(500, 500, CV_8UC3, { 0, 0, 0 }), dstDevice;
Mat dstHost;
const Size outSize(250, 250);
const int roiW = 200, roiH = 100;
Rect roi(0, 0, roiW, roiH);
srcDevice(roi).setTo({ 255, 255, 255 });
srcDevice.download(dstHost);
imshow("Original Frame", dstHost);
waitKey(1);
rotate(srcDevice, dstDevice, outSize, 90, 0, roiW - 1);
dstDevice.download(dstHost);
imshow("Rotated Shifted Frame", dstHost);
waitKey(1);
// That gives me rotated white boxes
VideoCapture capture;
Mat frame;
if(capture.isOpened())
{
capture >> frame;
}
else
{
return;
}
GpuMat srcDevice(500, 500, CV_8UC3, { 0, 0, 0 }), dstDevice;
const Size outSize(250, 250);
const int roiW = 200, roiH = 100;
Rect roi(0, 0, roiW, roiH);
srcDevice(roi).setTo({ 255, 255, 255 });
srcDevice.download(frame);
imshow("Original Frame", frame);
waitKey(1);
rotate(srcDevice, dstDevice, outSize, 90, 0, roiW - 1);
dstDevice.download(frame);
imshow("Rotated Shifted Frame", frame);
waitKey(1);
// That gives me nothing - black frames
VideoCapture capture;
Mat frame;
if(capture.isOpened())
{
capture >> frame;
}
else
{
return;
}
GpuMat srcDevice(500, 500, CV_8UC3, { 0, 0, 0 }), dstDevice;
const Size outSize(250, 250);
const int roiW = 200, roiH = 100;
// Rect roi(0, 0, roiW, roiH);
// srcDevice(roi).setTo({ 255, 255, 255 });
srcDevice.download(frame);
imshow("Original Frame", frame);
waitKey(1);
rotate(srcDevice, dstDevice, outSize, 90, 0, roiW - 1);
dstDevice.download(frame);
imshow("Rotated Shifted Frame", frame);
waitKey(1);