Intel® Distribution of OpenVINO™ Toolkit
Community support and discussions about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all things computer vision-related on Intel® platforms.
5856 Discussions

[Novice Help!]anyone who running SIFT algorithm with using OpenCL successfully?

然_魏_
Beginner
432 Views

Hi, there! I tried to use SIFT algorithm with OpenCL in OpenCV, However,I found it's difficult to use custom *.cl in OpenCV, I just found surf.cl in ...\opencv_contrib-master\modules\xfeatures2d\src\cuda\surf.cl, and there isn't have corresponding example(just has ...\sources\samples\gpu\surf_keypoint_matcher.cpp) So the problem is: * Are there anyone who running SIFT algorithm in OpenCV using OpenCL successfully? coud you give me some advice(OpenCV 2.4.X is also OK); * How to use surf.cl which given by OpenCV3.0? * If the above algorithm are very complex, could you give me some simple algorithm code examples with custom OpenCL? Many thanks!

0 Kudos
1 Reply
Jeffrey_M_Intel1
Employee
432 Views

Thanks for your great question -- we may need more examples/documentation for this topic.  As a quick answer though, you can try this:

1. Make sure OpenCL is installed.  (I used Linux OpenCL in Media Server Studio)

2. Download OpenCV 3.0 source and compile with OpenCL and opencv-world

3. This test program seems to work: http://stackoverflow.com/questions/28529458/how-to-launch-custom-opencl-kernel-in-opencv-3-0-0-ocl

(Needs a few small changes to the kernel parameters)

__kernel void shift(
   image2d_t src,
   float shift_x,
   float shift_y,
   global uchar* dst,
   int dst_step, int dst_offset, int dst_rows, int dst_cols)

4. Compile and link: (Makefile)

all:
	g++ -I /usr/local/include opencv_cust_ocl.cpp -L/usr/local/lib -lopencv_world -o opencltest

 

Reply