Ask Your Question

ManuKlause's profile - activity

2019-11-10 07:49:59 -0600 received badge  Notable Question (source)
2019-07-26 19:04:43 -0600 received badge  Popular Question (source)
2016-11-25 03:40:40 -0600 received badge  Enthusiast
2016-11-18 02:12:13 -0600 commented question Convert Mat to 16 bit int

Yes, they are 16 bit.

2016-11-18 01:59:11 -0600 commented question Convert Mat to 16 bit int

I want to use the data of cv::Mat in CUDA, and CUDA does not support cv::Mat. So, using mat1.convertTo(mat2, CV_16U) wouldnt be helpful.

2016-11-18 01:48:21 -0600 asked a question Convert Mat to 16 bit int

Hi,

I want to convert my 16 bit images from format cv::Mat to 16 bit. Currently, I am using this function

int size = image.total() * image.elemSize(); // number of elements * size of elements
float * bytes = new float[size];  
std::memcpy(bytes, &image.data, size * sizeof(float));
return bytes;

which only allows me to use 8 bit images (format bytes). Do you know a function call to convert cv::Mat to my desired bit format?

Best

ManuKlause

2016-11-14 03:08:56 -0600 asked a question unspecified launch failure in function caller

Hi everyone,

running this code:

gpu::GpuMat cv_imgLeft_gpu;
gpu::GpuMat cv_imgLeft_gpu_blur;
Size filter_size;
filter_size.width = 7;
filter_size.height = 7;

// create filter
cv::Ptr<gpu::FilterEngine_GPU> filter = gpu::createGaussianFilter_GPU(CV_16SC1, filter_size, gauss_sigma);
while() {
// get image, function is from camera supplier, image is stored in pointer ptrGrabResultLeft
CameraLeft.RetrieveResult(5000, ptrGrabResultLeft, TimeoutHandling_ThrowException);
// constructor for GpuMatrix headers pointing to user-allocated data, load image to GPU memory
cv_imgLeft_gpu = gpu::GpuMat(ptrGrabResultLeft -> GetHeight(), ptrGrabResultLeft -> GetWidth(), CV_16SC1,  (uint32_t*)imageLeft.GetBuffer());
// apply filter
filter->apply(cv_imgLeft_gpu, cv_imgLeft_gpu_blur, cv::Rect(0, 0, cv_imgLeft_gpu.cols, cv_imgLeft_gpu.rows));
}

produces this error output in my terminal:

OpenCV Error: Gpu API call (unspecified launch failure) in caller, file /hdd/buildbot/slave_jetson_tx_4/35-O4T-L4T-R24-armhf/opencv/modules/gpu/src/cuda/row_filter.h, line 174 terminate called after throwing an instance of 'cv::Exception' what(): /hdd/buildbot/slave_jetson_tx_4/35-O4T-L4T-R24-armhf/opencv/modules/gpu/src/cuda/row_filter.h:174: error: (-217) unspecified launch failure in function caller

I am using an TX1 with OpenCV for Tegra 2.4.13. The camera takes 12 bit images within a 16 bit mask. However, if I load the image fo cv Mat format and convert it to gpu Mat, it works fine. But the time to convert the image is to long, I want to avoid that.

Thanks for your help.

Best ManuKlause