Ask Your Question
0

Use Opencl to access Umat data

asked 2020-11-21 04:41:25 -0500

AndyK gravatar image

I want to use the opencl function atan2(y, x) which can take vectors for x and Y and perform a per-element operation.

Is there a way I can pass in pointers to two Umats (2 dimensional, float) and get a per-element atan2 operation?

This would obviously save having to copy from Gpu to CPU and back.

edit retag flag offensive close merge delete

Comments

opencl function atan2(y, x) which can take vectors for x and Y

where did you find this ? (i don't think such a thing exists)

pointers to two Umats

you should not use pointers at all here

berak gravatar imageberak ( 2020-11-21 05:49:23 -0500 )edit

Use OpenGL, it's more than capable.

sjhalayka gravatar imagesjhalayka ( 2020-11-21 10:23:49 -0500 )edit

2 answers

Sort by ยป oldest newest most voted
0

answered 2020-11-21 14:40:50 -0500

berak gravatar image

if you can live with it also calculating the magnitude, cartToPolar has ocl support, just give it UMat's as in/output

edit flag offensive delete link more
0

answered 2020-11-21 14:31:00 -0500

crackwitz gravatar image

you mention OpenCL. are you writing an OpenCL kernel?

if you have a cv::UMat(), you can call the .handle() method to get an OpenCL buffer handle: https://docs.opencv.org/master/d7/d45...

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-11-21 04:41:25 -0500

Seen: 38 times

Last updated: Nov 21