Quantcast

cuda::GpuMat.convertTo(CV_32F) not working

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

cuda::GpuMat.convertTo(CV_32F) not working

opencv-users mailing list
   Hello.
     I've started using OpenCV 3.0 recently - built from the repository version of Oct
3rd, 2015.
     I'm writing an application which I advertised a few months ago -
https://sites.google.com/site/alexsusu/video-diff .

     I've tried today to use GpuMat's convertTo(CV_32F), from CV_8U, but it seems it's not
working (while cv::Mat's convertTo(CV_32F) does).

     So I'd like to report this issue as a bug.
     Please let me know if there's anything else I should be aware of.

   Thank you,
     Alex
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: cuda::GpuMat.convertTo(CV_32F) not working

keghn

/*
nvcc p.cu -o p `pkg-config --cflags --libs opencv` -lopencv_gpu

*/

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

using namespace cv;

int main (int argc, char* argv[])
{
    try
    {


        cv::Mat src_host = cv::imread("Fruit_Bat.jpg", CV_LOAD_IMAGE_COLOR);   // Read the file


        cv::cuda::GpuMat dst, src;
        src.upload(src_host);

        cv::cuda::cvtColor(src,  dst, CV_BGR2GRAY);

        cv::Mat result_host(dst);
        cv::imshow("Result", result_host);
        cv::waitKey();
    }
    catch(const cv::Exception& ex)
    {
        std::cout << "Error: " << ex.what() << std::endl;
    }
    return 0;
}
Loading...