Errors in cuda optical flow computation (Bug #4313)
Description
Hi,
I wrote a code for my project, which load a video and compute optical flow using cv::cuda::BroxOpticalFlow or cv::cuda::FarnebackOpticalFlow. They have the same errors.
OpenCV version: 3.0.0-dev
OpenCV Error: The function/feature is not implemented (getGpuMat is available only for cuda::GpuMat and cuda::HostMem) in getGpuMat, file /home/beahacker/Downloads/opencv-new/opencv/modules/core/src/matrix.cpp, line 1419
terminate called after throwing an instance of 'cv::Exception'
what(): /home/beahacker/Downloads/opencv-new/opencv/modules/core/src/matrix.cpp:1419: error: (-213) getGpuMat is available only for cuda::GpuMat and cuda::HostMem in function getGpuMat
The program has unexpectedly finished.
/home/beahacker/Desktop/opencv-workspace/non-local_motion/src-build/non-local_motion crashed.
Hope to receive your responses.
History
Updated by An Tran almost 10 years ago
- File CMakeLists.txt added
- File main.cpp added
Updated by Ilya Lavrenov almost 10 years ago
- Status changed from New to Open
- Assignee set to Vladislav Vinogradov
- Category set to gpu (cuda)
- Target version set to 3.0
- Difficulty set to Medium
Updated by Vladislav Vinogradov almost 10 years ago
It is not a bug, it is expected behavior.
The error message contains a hint:
getGpuMat is available only for cuda::GpuMat and cuda::HostMem in function getGpuMat
All CUDA module functions works only with cuda::GpuMat
and cuda::HostMem
.
You need explicitly create cuda::GpuMat
and upload CPU data from Mat
to it.
Attaching modified source code.
- Status changed from Open to Cancelled
- Difficulty deleted (
Medium) - File main_updated.cpp added
Updated by An Tran over 9 years ago
Vladislav Vinogradov wrote:
It is not a bug, it is expected behavior.
The error message contains a hint:[...]
All CUDA module functions works only with
cuda::GpuMat
andcuda::HostMem
.
You need explicitly createcuda::GpuMat
and upload CPU data fromMat
to it.Attaching modified source code.
Thank Vladislav,
I could not find documentations to use cuda optical flow algorithm properly.
Thank you so much.
Updated by An Tran over 9 years ago
Vladislav Vinogradov wrote:
It is not a bug, it is expected behavior.
The error message contains a hint:[...]
All CUDA module functions works only with
cuda::GpuMat
andcuda::HostMem
.
You need explicitly createcuda::GpuMat
and upload CPU data fromMat
to it.Attaching modified source code.
Thank Vladislav,
I thought opencv would do it automatically from T-API. Creating an GpuMat manually seems to be a surprising to me.
@An
Updated by Steven Puttemans over 9 years ago
An Tran wrote:
Vladislav Vinogradov wrote:
It is not a bug, it is expected behavior.
The error message contains a hint:[...]
All CUDA module functions works only with
cuda::GpuMat
andcuda::HostMem
.
You need explicitly createcuda::GpuMat
and upload CPU data fromMat
to it.Attaching modified source code.
Thank Vladislav,
I thought opencv would do it automatically from T-API. Creating an GpuMat manually seems to be a surprising to me.
@An
If you would like to use the T-API, then you will need to use the UMat container instead of the Mat container.
More information can be found here: http://www.learnopencv.com/opencv-transparent-api/
Updated by An Tran over 9 years ago
Steven Puttemans wrote:
An Tran wrote:
Vladislav Vinogradov wrote:
It is not a bug, it is expected behavior.
The error message contains a hint:[...]
All CUDA module functions works only with
cuda::GpuMat
andcuda::HostMem
.
You need explicitly createcuda::GpuMat
and upload CPU data fromMat
to it.Attaching modified source code.
Thank Vladislav,
I thought opencv would do it automatically from T-API. Creating an GpuMat manually seems to be a surprising to me.
@AnIf you would like to use the T-API, then you will need to use the UMat container instead of the Mat container.
More information can be found here: http://www.learnopencv.com/opencv-transparent-api/
Thank Steven,