---
author: "Simon Garnier"
title: "2 - Using ROpenCVLite"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{2 - Using ROpenCVLite}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

The goal of [`ROpenCVLite`](https://github.com/swarm-lab/ROpenCVLite) is to 
enable developers to create their own packages for [`R`](https://cran.r-project.org) 
based on [`OpenCV`](https://opencv.org/). Computer vision is just one of the 
possible applications for [`OpenCV`](https://opencv.org/). It can do many more 
things, such as fast matrix processing and GPU computing. By providing access to 
a standardized installation of [`OpenCV`](https://opencv.org/), we hope to help 
the [`R`](https://cran.r-project.org) community take advantage of this fantastic 
library. 

---

## Create a package using [`ROpenCVLite`](https://github.com/swarm-lab/ROpenCVLite)

Follow these steps to configure your package for [`ROpenCVLite`](https://github.com/swarm-lab/ROpenCVLite):

1. Set [`ROpenCVLite`](https://github.com/swarm-lab/ROpenCVLite) as a dependency 
in the DESCRIPTION file of your package.
2. Use the [`opencvConfig` function](https://swarm-lab.github.io/ROpenCVLite/reference/opencvConfig.html)
provided with [`ROpenCVLite`](https://github.com/swarm-lab/ROpenCVLite) to:
    + set the `PKG_LIBS` value of the Makevars and Makevars.win 
files of your package (using `opencvConfig("libs")`). 
    + set the `PKG_CPPFLAGS` value of the Makevars and Makevars.win
files of your package (using `opencvConfig("cflags")`).

You can find an example of how to set up your package with 
[`ROpenCVLite`](https://github.com/swarm-lab/ROpenCVLite) in our 
[Rvision](https://github.com/swarm-lab/Rvision) package:

* [DESCRIPTION](https://github.com/swarm-lab/Rvision/blob/master/DESCRIPTION)
* [Makevars](https://github.com/swarm-lab/Rvision/blob/master/src/Makevars)
* [Makevars.win](https://github.com/swarm-lab/Rvision/blob/master/src/Makevars.win)
