Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

First, check that your image was loaded correctly:

Mat src_host = imread("sunset.jpg", CV_LOAD_IMAGE_COLOR);
if (src_host.empty())
    std::cerr << "Can't load image";

The second issues is that you are passing GpuMat dst to imwrite function. You should pass dst_host:

gpu::resize(src, dst, Size(256, 256), 0, 0, INTER_CUBIC);
Mat dst_host(dst);
imwrite("out.jpeg", dst_host);