Ask Your Question

Revision history [back]

You must load the appropriate OpenCV dll's with accordance to the system architecture you are using. Mine is placed in the 'lib\opencv' directory inside my project folder.

    String currentDir = new File("").getAbsolutePath();
    String arch = System.getProperty("sun.arch.data.model");

    switch (arch) {
        case "64":
            System.load(currentDir + "\\lib\\opencv\\x64\\opencv_java247.dll");
            break;
        case "32":
            System.load(currentDir + "\\lib\\opencv\\x86\\opencv_java247.dll");
            break;
    }