Open nbackfisch opened 7 years ago
Thanks for your help! It's awesome to have enthusiastic users! :) Hope this fix will remove the bug.
:) Almost: now we end up in another error OpenCV Error: Assertion failed (type == CV_32F || type == CV_64F) in invert, file /data/nbackfisch/opencv-3.2.0/modules/core/src/lapack.cpp, line 841
I called cv.cuda.warpPerspective{original:cuda(), nil, trafo:cuda()}
So maybe some wrong casting? Also notice that I had issues installing lapack with cv if i remember right. So error can also be on my side.
Well but I need to go now, I have to catch a train and drive 700km home now ;)
Try keeping M
in main memory. Does this line work?
cv.cuda.warpPerspective{original:cuda(), nil, trafo}
I too end up with the same error:
b2 = cv.cuda.warpPerspective{a1,nil,M:cuda()} -- a1 is CudaTensor
OpenCV Error: Assertion failed (type == CV_32F || type == CV_64F) in invert, file /home/user/opencv-3.2.0/modules/core/src/lapack.cpp, line 841
C++ exception
If M is in main memory, the following error occurs
b2 = cv.cuda.warpPerspective{a1,nil,M}
OpenCV Error: Gpu API call (invalid configuration argument) in call, file /home/user/opencv-3.2.0/modules/cudawarping/src/cuda/warp.cu, line 260
C++ exception
Hi, now I also ran in the Cuda error: OpenCV Error: Gpu API call (invalid configuration argument) in call, file /data/nbackfisch/opencv-3.2.0/modules/cudawarping/src/cuda/warp.cu, line 258
Assume again, we use M:cuda()
again. Can you check, whether the original
and trafo
are loaded to cv_8U
and still need to be converted to cv_32F
for some following method (e.g. from opencv)? If so, don't forget to cast back to cv_8U ;)
I found this post, where they also face such an Assertion Failure and loading the image to cv_8U sounds reasonable to me. http://stackoverflow.com/questions/26470149/c-convert-cvmat-from-cv-8u-to-cv-32f
What do you think?
Hopefully it is very easy, since there was a similiar, already solved issue: https://github.com/VisionLabs/torch-opencv/issues/132
132
Error here: When using cuda.warpPerspective function, there is an error raised: You should explicitly call download method for cuda::GpuMat object
I copy the solution suggestion that seemed to work for that other issue:
@shrubb: Since you have/had no GPU to test this, it sounds probable for me, that it is the reason here as well. Btw: CPU Version of warpPerspective is running fine.
Thanks in advance!