Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6255 Discussions

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


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 in ...\opencv_contrib-master\modules\xfeatures2d\src\cuda\, 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 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

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:

(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)

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


0 Kudos