cuda::GpuMat.convertTo(CV_32F) not working

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

cuda::GpuMat.convertTo(CV_32F) not working

opencv-users mailing list
     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 - .

     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,
Reply | Threaded
Open this post in threaded view

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


nvcc -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[])

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

        cv::cuda::GpuMat dst, src;

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

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