heres my code (i am using javacv):
import org.bytedeco.javacpp.opencv_core; import org.bytedeco.javacpp.opencv_features2d; import org.bytedeco.javacpp.opencv_nonfree;
import static org.bytedeco.javacpp.opencv_highgui.imread; opencv_core.Mat images[] = new opencv_core.Mat[2]; images[0] = new opencv_core.Mat(); images[1] = new opencv_core.Mat(); images[0] = imread("/storage/emulated/0/DCIM/Camera/p3.jpg"); images[1] = imread("/storage/emulated/0/DCIM/Camera/p4.jpg"); System.out.println("images read"); opencv_nonfree.SURF surf= new opencv_nonfree.SURF(100); opencv_features2d.KeyPoint keyPoints1 = new opencv_features2d.KeyPoint(); opencv_features2d.KeyPoint keyPoints2 = new opencv_features2d.KeyPoint(); surf.detect(images[0], keyPoints1); surf.detect(images[1], keyPoints2); System.out.println("Number of SURF points (1): " + keyPoints1.capacity()); System.out.println("Number of SURF points (2): " + keyPoints2.capacity());