Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Thank you for giving me some insight into my problem.

I have re-compiled with cudawarped's suggestion and now I can call the function by cv.cuda.fastNlMeansDenoisingColored.

However,

src = cv2.cuda_GpuMat(cv2.imread('image_path.jpg')) cv2.cuda.fastNlMeansDenoisingColored(src, None, 2, 2, 7, 21)

gives me the following error.

TypeError Traceback (most recent call last) <ipython-input-123-cd4f445e42f1> in <module> ----> 1 cv2.cuda.fastNlMeansDenoisingColored(src, None, 2, 2, 7, 21)

TypeError: Expected Ptr<cv::umat> for argument 'src'

I could do

npTmp = np.random.random((1024, 1024)).astype(np.float32) npMat1 = npMat2 = npMat3 = npDst = np.stack([npTmp,npTmp],axis=2) cuMat1 = cuMat2 = cuMat3 = cuDst = cv2.cuda_GpuMat(npMat1) %timeit cv2.cuda.gemm(cuMat1, cuMat2,1,cuMat3,1,cuDst,1)

this code without any trouble. Is it any other way I can get around the error?

Thank you for giving me some insight into my problem.

I have re-compiled with cudawarped's suggestion and now I can call the function by cv.cuda.fastNlMeansDenoisingColored.

However,

src = cv2.cuda_GpuMat(cv2.imread('image_path.jpg')) cv2.cuda.fastNlMeansDenoisingColored(src, None, 2, 2, 7, 21)

gives me the following error.

TypeError Traceback (most recent call last) <ipython-input-123-cd4f445e42f1> in <module> ----> 1 cv2.cuda.fastNlMeansDenoisingColored(src, None, 2, 2, 7, 21)

TypeError: Expected Ptr<cv::umat> for argument 'src'

I could do

npTmp = np.random.random((1024, 1024)).astype(np.float32) npMat1 = npMat2 = npMat3 = npDst = np.stack([npTmp,npTmp],axis=2) cuMat1 = cuMat2 = cuMat3 = cuDst = cv2.cuda_GpuMat(npMat1) %timeit cv2.cuda.gemm(cuMat1, cuMat2,1,cuMat3,1,cuDst,1)

this The second code works without any trouble. Is it any other way I can get around the error? error?

Thank you for giving me some insight into my problem.

I have re-compiled with cudawarped's suggestion and now I can call the function by cv.cuda.fastNlMeansDenoisingColored.

However,

src = cv2.cuda_GpuMat(cv2.imread('image_path.jpg')) cv2.cuda.fastNlMeansDenoisingColored(src, None, 2, 2, 7, 21)

gives me the following error.

TypeError Traceback (most recent call last) <ipython-input-123-cd4f445e42f1> in <module> ----> 1 cv2.cuda.fastNlMeansDenoisingColored(src, None, 2, 2, 7, 21)

TypeError: Expected Ptr<cv::umat> for argument 'src'

I could do

npTmp = np.random.random((1024, 1024)).astype(np.float32) npMat1 = npMat2 = npMat3 = npDst = np.stack([npTmp,npTmp],axis=2) cuMat1 = cuMat2 = cuMat3 = cuDst = cv2.cuda_GpuMat(npMat1) %timeit cv2.cuda.gemm(cuMat1, cuMat2,1,cuMat3,1,cuDst,1)

The second code works without any trouble. Is it any other way ways I can get around the error?

Thank you for giving me some insight into my problem.

I have re-compiled with cudawarped's suggestion and now I can call the function by cv.cuda.fastNlMeansDenoisingColored.

However,

src = cv2.cuda_GpuMat(cv2.imread('image_path.jpg')) cv2.cuda.fastNlMeansDenoisingColored(src, None, 2, 2, 7, 21)

gives me the following error.

TypeError Traceback (most recent call last) <ipython-input-123-cd4f445e42f1> in <module> ----> 1 cv2.cuda.fastNlMeansDenoisingColored(src, None, 2, 2, 7, 21)

TypeError: Expected Ptr<cv::umat> for argument 'src'

I could do

npTmp = np.random.random((1024, 1024)).astype(np.float32) npMat1 = npMat2 = npMat3 = npDst = np.stack([npTmp,npTmp],axis=2) cuMat1 = cuMat2 = cuMat3 = cuDst = cv2.cuda_GpuMat(npMat1) %timeit cv2.cuda.gemm(cuMat1, cuMat2,1,cuMat3,1,cuDst,1)

The second code works without any trouble. Also, the image exists on the path because I can run the code on C++ with the same image path

Is it any other ways way I can get around the error?