Gohaun
Gohaun

Reputation: 1

I cannot Import bytedeco's JavaCV into my project on IntelliJ

I downloaded bytedeco's JavaCV from github and have included it into my dependencies for my IntelliJ project.
I then read through the documentation and the readme file and then figure out what I think were the proper import statements.

I have tried "import org.bytedeco.javacv.*;" from what I found in the package in the package names. That did not work, IntelliJ could not resolve symbol "bytedeco". This happened even in the JavaCV classes that are a part of the org.bytedeco.javacv package did not resolve the import statements. I then went onto stack overflow to look for anyone who had the same problem or could solve my problem. I couldn't find any useful information at all about what is wrong. I found this very confusing and could not find any other information onto why this is happening. This is my first project, I do not know if this is a limitation with IntelliJ or that I am missing some other package that isn't part of JavaCV or some other problem I do not yet know of.

Upvotes: 0

Views: 527

Answers (1)

Jacky Liu
Jacky Liu

Reputation: 528

That's right the correct package name should be org.bytedeco.opencv.global.opencv_core.*.

Here is a sample code taken from the GitHub:

import org.bytedeco.opencv.opencv_core.*;
import org.bytedeco.opencv.opencv_imgproc.*;
import static org.bytedeco.opencv.global.opencv_core.*;
import static org.bytedeco.opencv.global.opencv_imgproc.*;
import static org.bytedeco.opencv.global.opencv_imgcodecs.*;

public class Smoother {
    public static void smooth(String filename) {
        Mat image = imread(filename);
        if (image != null) {
            GaussianBlur(image, image, new Size(3, 3), 0);
            imwrite(filename, image);
        }
    }
}

You may find the sample code on the official GitHub project site helpful for a fast start:

https://github.com/bytedeco/javacv/tree/master/samples

https://github.com/bytedeco/javacv#manual-installation

Upvotes: 1

Related Questions