Installing ROpenCVLite
should go smoothly on all major operating systems (Mac, Windows, and
“Ubuntu-like” Linux). There are a few steps to follow before installing
the package itself in order to prepare all the necessary external
(i.e. non-R) dependencies for OpenCV
.
All installation steps are described below.
Before installing ROpenCVLite
, you will need to install
the latest versions of CMake
and Rtools
.
+ Option 1
Use the convenience function provided by the installr
library:
if (!require("installr"))
install.packages("installr")
::install.CMake() installr
During the installation process, make sure to tell the installer to
add CMake
to your “PATH”.
+ Option 2
Download the CMake
installer for Windows at https://cmake.org/download/. Make
sure to tell the installer to add CMake
to your “PATH”.
+ Option 1
Use the convenience function provided by the installr
library:
if (!require("installr"))
install.packages("installr")
::install.Rtools() installr
During the installation process, make sure to tell the installer to
add Rtools
to your “PATH”.
+ Option 2
Download the latest “recommended” version of Rtools
at
https://cran.r-project.org/bin/windows/Rtools/.
Make sure to tell the installer to add Rtools
to your
“PATH”.
Before installing ROpenCVLite
, you will need to install
the latest version of CMake
.
+ Option 1
Go to https://cmake.org/download/.
Scroll down until you reach the “Latest Release” section. Download the
installer for Mac OS X (.dmg file). Once the download is complete,
double-click on the installer and accept the license agreement. Drag and
drop the Cmake
app into your Applications
folder.
To make Cmake
accessible to R
, open a
terminal and type:
sudo "/Applications/CMake.app/Contents/bin/cmake-gui" --install
It will ask for your administrator password.
+ Option 2
If you have homebrew
installed, run the following command in your terminal:
brew install cmake
+ Option 3
If you have MacPorts
installed,
run the following command in your terminal:
sudo port install cmake
Before installing ROpenCVLite
, you will need to install
the latest version of CMake
. Hereafter are two
options to do this on Linux.
+ Option 1
Use your distribution’s package management system. For instance on Ubuntu-like systems, you can install Cmake by typing the following command in your terminal:
sudo apt install cmake
Other distributions will have different package managers. Refer to the documentation of your distribution for finding the proper way to install Cmake on your system.
+ Option 2
Download CMake
for Linux at https://cmake.org/download/.
However it is recommended that you install it using your distribution’s
package management system.
Before installing ROpenCVLite
, you will need to install
the devtools
package in R
.
install.package("devtools")
ROpenCVLite
You can install ROpenCVLite
from CRAN as follows:
install.packages("ROpenCVLite")
Or you can install the latest latest development version (not recommended) as follows:
::install_github("swarm-lab/ROpenCVLite") devtools
This will not install OpenCV
yet. You will be asked
whether you want to install it the first time you load the package.
library(ROpenCVLite)
This step can take some time. Go make yourself a cup of coffee or two
while ROpenCVLite
downloads, compiles and installs
OpenCV
on your system.
In addition, you can also request the (re)installation of
OpenCV
at any time as follows:
::installOpenCV() ROpenCVLite
ROpenCVLite
will also automatically detect when a new
version of OpenCV is available and will offer to update it for you.