0

I am currently trying to make a program in c++ using OpenCV library. In order to accelerate my code I am trying to use OpenCV builtin ocl. In my code I'm trying to use oclMat and I need to take a specific cell's value. Ive tried addressing a specific cell like that:

oclMat ocl_image(image); //initializing the oclMat with image
ocl_image.row(i).col(j) //address the specific (i,j) cell in col_image

My problem now is that I couldn't find a way of convert the value I have (oclMat Header) to 'float'. What I did for now is

ocl_image.row(i).col(j).download(temp) //temp is of type cv::Mat

And the code takes too much time to run, Is there an other way of addressing a specific cell without the need to convert between cv::ocl::oclMat and cv::Mat types?

Thank you.

Or Shalom
  • 1
  • 1
  • Note sure if solution, but if you are creating the "temp" matrix every time then that will be slow, create it once and just write the data to it. – GPPK Jan 09 '15 at 20:11
  • why not use opencv 3.0 where you could use `UMat` which is hardware acceelerated by default ? – kiranpradeep Jan 10 '15 at 05:18

0 Answers0