Code example for cornerHarris

asked 2015-02-10 05:02:48 -0500

aries gravatar image

updated 2015-02-10 08:14:18 -0500

I am new to opencv, I working on detecting the corners of colored squares from an image. I came across this function which seems to work for my problem "ocl::cornerHarris". Could someone please provide me a example of how to use this function?

edit retag flag offensive close merge delete


title does no more match question ?

berak gravatar imageberak ( 2015-02-10 05:44:05 -0500 )edit

Sorry I just edited it.

aries gravatar imagearies ( 2015-02-10 08:14:34 -0500 )edit


Are you sure you want to use the OCL (OpenCL) version of cornerHarris ? If no, use the CPU version and you can look at this tutorial:

If yes, I have never used the OpenCL or CUDA functions in OpenCV but you can look at this tutorial:

The only thing that differs from the CPU version is the use of oclMat:

Mat img;
img = imread("path_to_the_image");
oclMat oclImg;
Eduardo gravatar imageEduardo ( 2015-02-10 11:47:11 -0500 )edit