Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

GPU resize Ubuntu 12.04

I installed OpenCV 2.4.6.1 on Ubuntu 12.04 with CUDA turned on. While I can run the sample on http://opencv.willowgarage.com/wiki/OpenCV_GPU, when I try to run the following progrm:

#include <iostream>
#include "opencv2/opencv.hpp"
#include "opencv2/gpu/gpu.hpp"

using namespace cv;

int main (int argc, char* argv[])
{
    try
    {
        std::cout << CV_VERSION ;
        Mat src_host = imread("sunset.jpg", CV_LOAD_IMAGE_COLOR);
        gpu::GpuMat dst, src;
        src.upload(src_host);

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

        return 0;
    }
    catch(const cv::Exception& ex)
    {
        std::cout << "Error: " << ex.what() << std::endl;
    }
    return 0;
}

I get the following error: OpenCV Error: Assertion failed (k == STD_VECTOR_MAT) in getMat, file /home/opencv-2.4.6.1/modules/core/src/matrix.cpp, line 988 2.4.6.1Error: /home/opencv-2.4.6.1/modules/core/src/matrix.cpp:988: error: (-215) k == STD_VECTOR_MAT in function getMat

I have a GTX 460 which scores a 2.1 on the Nvidia compute capability score. Has any one else run into this problem?

GPU resize Ubuntu 12.04

I installed OpenCV 2.4.6.1 on Ubuntu 12.04 with CUDA turned on. I have Cuda version 5.0 installed. While I can run the sample on http://opencv.willowgarage.com/wiki/OpenCV_GPU, when I try to run the following progrm:

#include <iostream>
#include "opencv2/opencv.hpp"
#include "opencv2/gpu/gpu.hpp"

using namespace cv;

int main (int argc, char* argv[])
{
    try
    {
        std::cout << CV_VERSION ;
        Mat src_host = imread("sunset.jpg", CV_LOAD_IMAGE_COLOR);
        gpu::GpuMat dst, src;
        src.upload(src_host);

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

        return 0;
    }
    catch(const cv::Exception& ex)
    {
        std::cout << "Error: " << ex.what() << std::endl;
    }
    return 0;
}

I get the following error: OpenCV Error: Assertion failed (k == STD_VECTOR_MAT) in getMat, file /home/opencv-2.4.6.1/modules/core/src/matrix.cpp, line 988 2.4.6.1Error: /home/opencv-2.4.6.1/modules/core/src/matrix.cpp:988: error: (-215) k == STD_VECTOR_MAT in function getMat

I have a GTX 460 which scores a 2.1 on the Nvidia compute capability score. Has any one else run into this problem?