stereolabs / zed-opencv

ZED SDK interface sample for OpenCV
https://www.stereolabs.com/docs/opencv/
MIT License
137 stars 79 forks source link

How to get the GpuMat of depth image? #47

Closed DreamsZM closed 2 years ago

DreamsZM commented 6 years ago

I wish to get the GpuMat of depth image,what should I do?

WASCHMASCHINE commented 6 years ago

Look at the sample code: https://github.com/stereolabs/zed-examples

DreamsZM commented 6 years ago

@WASCHMASCHINE after get zed.retrieveMeasure(gpu_depth, sl::MEASURE_DEPTH, sl::MEM_GPU),how to transform the cv::gpu::GpuMat?

obraun-sl commented 6 years ago

Use cudaMemcpy2D to copy the GPU data of sl::Mat (using getPtr<sl::uchar1>(MEM_GPU)) to the gpu data of the gpuMat (.data)

liprin1129 commented 6 years ago

@obraun-sl I did like this below, but not working... cudaMemcpy2D( this->_gpuMat.data, this->_gpuMat.step * sizeof(float3), this->_zedMat.getPtr<sl::uchar1>(sl::MEM_GPU), this->_zedMat.getStepBytes(sl::MEM_GPU), this->_zedMat.getWidth() * sizeof(sl::uchar4), this->_zedMat.getHeight(), cudaMemcpyDeviceToDevice );

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment otherwise it will be automatically closed in 5 days