Hi, everyone
I've been trying to build a JAR using Gradle of an application to use the local camera (webcam), and so some basic face detection/tracking with all necessary OpenCV dependencies (a fatjar is usually called).
The final JAR is approximately 200MB if javacv-platform is added in the build.gradle file:
compile group: 'org.bytedeco', name: 'javacv-platform', version: '1.3.2'
If I use instead:
compile (group: 'org.bytedeco', name: 'javacv-platform', version: '1.3.2'){
exclude module:'librealsense'
exclude module:'artoolkitplus'
exclude module:'ffmpeg'
exclude module:'flandmark'
exclude module:'flycapture'
exclude module:'libdc1394'
exclude module:'libfreenect'
exclude module:'libfreenect2'
exclude module:'videoinput'
}
The JAR file gets reduced to 105MB
Is there any way to reduce the size of the jar file even more? Like excluding specifically the linux, arm and macos (only need windows) versions of the opencv dependencies? I've tried using, for example:
exclude module:'opencv:android-arm'
In my project, I'm using the following packages/classes:
import org.bytedeco.javacpp.opencv_core;
import org.bytedeco.javacpp.opencv_videoio;
import org.bytedeco.javacpp.opencv_core;
import org.bytedeco.javacv.CanvasFrame;
import org.bytedeco.javacv.OpenCVFrameConverter;
import org.bytedeco.javacpp.opencv_objdetect;
import static org.bytedeco.javacpp.opencv_imgcodecs.imread;
import static org.bytedeco.javacpp.opencv_imgproc.CV_FONT_HERSHEY_PLAIN;
import static org.bytedeco.javacpp.opencv_imgproc.putText;
import static org.bytedeco.javacpp.opencv_imgproc.rectangle;
Is there some way to instruct gradle to include JUST the absolute necessary dependencies?
Regards!