Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Migrating from OpenCV 2.x to 3.x

David Miguel Lozano edited this page Oct 3, 2016 · 1 revision

Init library

OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_13, this, mLoaderCallback);
OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_3_1_0, this, mLoaderCallback);

Highgui -> Imgcodecs / Videoio

The functionality in Highgui has been split into two additional modules:

  • Imgcodecs (imread / imwrite...).
  • Videoio (VideoCapture, VideoWriter).
Highgui.imread(fileName, Highgui.CV_LOAD_IMAGE_GRAYSCALE)
Highgui.imread(fileName)
Highgui.imwrite(photoPath, mBgr);
Highgui.imencode(".bmp", frame, mem);
...
Imgcodecs.imread(fileName, Imgcodecs.CV_LOAD_IMAGE_GRAYSCALE)
Imgcodecs.imread(fileName)
Imgcodecs.imwrite(photoPath, mBgr);
Imgcodecs.imencode(".bmp", frame, mem); 
...

Drawing functions: Core -> Imgproc

Core.circle(..); 
Core.line(...);
Imgproc.circle(..);
Imgproc.line(..);