cvDetect: a simple R package for OpenCV face/hand/finger detection demo, Currently Windows only.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

cvDetect : Simple OpenCV Image/Webcam Detections for R

Simple R package for OpenCV face/hand/finger detection demo, with the help of ROpenCVLite and Rcpp packages. Currently Windows only.

(Also check (Traditional Chinese page) )

3 Detection

Related tool/package/library versions for creating this package

Winodws 7 OS 64 bit
R: 3.4.0
Rtools: Rtools34.exe
Rcpp: 0.12.10
OpenCV: 3.2.0
ROpenCVLite: 0.1.1

Install cvDetect binary package (Windows only)

  1. Download +/-

    These are compiled OpenCV 3.2.0 binaries/libraries for Windows by Rtools34 mingw G++, using ROpenCVLite package. includes etc, include, and x64 sub-directories. only includes x87 sub-directory

  2. Uncompress zip file(s) in some directory, e.g., d:\ROpencv

    Under d:\ROpencv, there should be etc, include, x64, and/or x86 subdirectories.


If you feel uncomfortable to download binary files in 1. and 2. in this page, you can build them yourself by installing ROpenCVLite package and copy all the files and sub-directories under the compiled "opencv" directory it builds to a new directory (e.g. d:\ROpencv). The compiled "opencv" directory can be located in, e.g., d:\R\R-3.4.0\library\ROpenCVLite .

  1. Modify PATH environment variable via Windows Control Panel:

    add ROpencv binray directories to PATH environment variable.
    This ensures R to find related OpenCV dll files when running cvDetect.

   or only
  1. Download

    In R, install zip file via "Install package(s) from local files..." menu

Compile and install cvDetect source package (Windows only)

We have to install Rtools if we want to compile cvDetect from source.

  1. Follow Stepe 1 to Step 3 in above binary package installation procedure.

  2. Add an OPENCV environment variable via Windows Control Panel:

    add, e.g., "d:\Ropencv" , to a new OPENCV environment variable.

    This OPENCV environment varible is used in inside src directory.

  3. Download cvDetect_0.1.1.tar.gz in this page.

  4. In R:

    Suppose we save cvDetect_0.1.1.tar.gz under d:\temp directory:



Enter 'q' or 'Q' to stop these funcitons.

If cameraId = 0 does not work, try 1, 2,....



# face detection via webcam

# face detection in Photo 

# hand/palm detection via webcam

# finger detection via webcam

Original C++ detection source codes used in cvDetect

Face detection: OpenCV library demo code

Hand/Palm detection: by Andol Li

Finger detection: by Abner Matheus