| Title: | Helper Package for Installing 'OpenCV' |
|---|---|
| Description: | Installs 'OpenCV' for use by other packages. 'OpenCV' <https://opencv.org/> is library of programming functions mainly aimed at real-time computer vision. This 'Lite' version installs the stable base version of 'OpenCV' and some of its experimental externally contributed modules. It does not provide R bindings directly. |
| Authors: | Simon Garnier [aut, cre, cph] (ORCID: <https://orcid.org/0000-0002-3886-3974>), Muschelli John [ctb] |
| Maintainer: | Simon Garnier <[email protected]> |
| License: | GPL-3 |
| Version: | 4.130.0 |
| Built: | 2026-05-22 10:27:54 UTC |
| Source: | https://github.com/swarm-lab/ropencvlite |
This function returns the location at which OpenCV should be installed by default.
defaultOpenCVPath()defaultOpenCVPath()
A character string.
Simon Garnier, [email protected]
defaultOpenCVPath()defaultOpenCVPath()
This function attempts to download, compile and install OpenCV on the system. This process will take several minutes.
installOpenCV( install_path = defaultOpenCVPath(), batch = FALSE, use_ccache = FALSE, optimize_for_host = FALSE, modules = c("calib3d", "core", "dnn", "features2d", "flann", "gapi", "highgui", "imgcodecs", "imgproc", "ml", "objdetect", "photo", "stitching", "video", "videoio", "ximgproc", "wechat_qrcode") )installOpenCV( install_path = defaultOpenCVPath(), batch = FALSE, use_ccache = FALSE, optimize_for_host = FALSE, modules = c("calib3d", "core", "dnn", "features2d", "flann", "gapi", "highgui", "imgcodecs", "imgproc", "ml", "objdetect", "photo", "stitching", "video", "videoio", "ximgproc", "wechat_qrcode") )
install_path |
A character string indicating the location at which
OpenCV should be installed. By default, it is the value returned by
|
batch |
A boolean indicating whether to skip ( |
use_ccache |
A boolean indicating whether to use |
optimize_for_host |
A boolean indicating whether to let CMake detect
and use the host CPU's full instruction set ( |
modules |
A character vector of OpenCV modules to compile. Defaults to
the full set supported by |
A boolean.
Simon Garnier, [email protected]
## Not run: installOpenCV() ## End(Not run)## Not run: installOpenCV() ## End(Not run)
This function checks that Cmake is installed on the system.
isCmakeInstalled()isCmakeInstalled()
A boolean.
Simon Garnier, [email protected]
isCmakeInstalled()isCmakeInstalled()
This function checks that OpenCV is installed and accessible.
isOpenCVInstalled()isOpenCVInstalled()
A boolean.
Simon Garnier, [email protected]
isOpenCVInstalled()isOpenCVInstalled()
This function returns the configuration options for compiling
C/C++-based packages against OpenCV installed by ROpenCVLite.
opencvConfig(output = "libs", arch = NULL)opencvConfig(output = "libs", arch = NULL)
output |
Either 'libs' for library configuration options or 'cflags' for C/C++ configuration flags. |
arch |
architecture relevant for Windows. If |
A concatenated character string (with cat) of the
configuration options.
Simon Garnier, [email protected]
## Not run: if (isOpenCVInstalled()) { opencvConfig() opencvConfig(output = "cflags") opencvConfig(arch = R.version$arch) } ## End(Not run)## Not run: if (isOpenCVInstalled()) { opencvConfig() opencvConfig(output = "cflags") opencvConfig(arch = R.version$arch) } ## End(Not run)
This function returns the location at which OpenCV is installed.
OpenCVPath()OpenCVPath()
A character string.
Simon Garnier, [email protected]
## Not run: OpenCVPath() ## End(Not run)## Not run: OpenCVPath() ## End(Not run)
This function determines the version of OpenCV installed within R.
opencvVersion()opencvVersion()
A character string.
Simon Garnier, [email protected]
if (isOpenCVInstalled()) { opencvVersion() }if (isOpenCVInstalled()) { opencvVersion() }
This function removes OpenCV from the system.
removeOpenCV()removeOpenCV()
A boolean.
Simon Garnier, [email protected]
## Not run: installOpenCV() ## End(Not run)## Not run: installOpenCV() ## End(Not run)