2/10/2016

I need your help.. " cuda::meanShiftSegmentation error !! ", error message is "The function/feature is not implemented..."

Someone ask me this problem, but I also suffered this problem and I don't know the solution.
I need yours help.


source code is here.(opencv version is 3.0)
...
#include "opencv2/opencv.hpp"
#include "opencv2\cuda.hpp"
#include "opencv2\cudaimgproc.hpp"

using namespace cv;

int main(int, char)
{


 Mat pictureBGR;
 Mat pictureSegment;
 pictureBGR = imread("2.png"); //unos slike za pretragu

 cuda::GpuMat bgr;
 cuda::GpuMat convertedBgr;
 cuda::GpuMat dstBgr;

   
 bgr.upload(pictureBGR);
 cuda::cvtColor(bgr, convertedBgr, CV_BGR2BGRA); 
  
 TermCriteria criteria(CV_TERMCRIT_EPS, 0, 0.08);
 cuda::meanShiftSegmentation(convertedBgr, dstBgr, 20, 20, 3, criteria);
 dstBgr.download(pictureSegment);


 namedWindow("Display Image", CV_WINDOW_AUTOSIZE);
 imshow("Display Image", pictureSegment);
 waitKey(0);
 return 0;
}
...

error message is here.

OpenCV Error: The function/feature is not implemented (You should explicitly call download method for cuda::GpuMat object) in getMat_, file /home/zburazin/opencv-3.0.0/modules/core/src/matrix.cpp, line 1211
terminate called after throwing an instance of 'cv::Exception'
  what():  /home/zburazin/opencv-3.0.0/modules/core/src/matrix.cpp:1211: error: (-213) You should explicitly call download method for cuda::GpuMat object in function getMat_



In past, I use meanshift function like that.
http://study.marearts.com/2014/12/opencv-meanshiftfiltering-example.html
But nothing changed with the different version of the old code.

Someone know this cause?

Thank you.



3 comments:

  1. Anonymous16/2/16 19:46

    there is a library for cuda that generated by CMake, right?

    ReplyDelete
    Replies
    1. cuda::meanShiftFiltering(convertedBgr, dstBgr, 20, 20, criteria);

      is ok.

      "cuda::meanShiftSegmentation" returns normal Mat
      meanShiftProc() and meanShiftFiltering() return GpuMat.

      Delete
  2. Anonymous5/3/17 19:07

    Hi I had a same error in warpPerspective (Opencv3.2.0)
    Did you resolve it?

    ReplyDelete