Learn R Programming

⚠️There's a newer version (0.6.0) of this package.Take me there.

Rvision

swarm-lab badges:

muschellij2 badges:

Not ready for production. Try at your own risks.



1 - Package description

This package uses the OpenCV library to provide R users with functions to read and manipulate video and image files, as well as camera streams.

Read the FAQ below for more info about the what, why, and how of Rvision.


2 - Package installation

2.1 - Before installing

Before installing Rvision, you will need to install the latest version of the devtools package in R.You can install devtools as follows:

install.package("devtools")

2.2 - Installing Rvision

You can install Rvision as follows:

devtools::install_github("swarm-lab/Rvision")

Rvision depends on ROpenCVLite to access OpenCV's functionalities. If not already installed, ROpenCVLite will be installed first by the above command line. This may take some time as it will download, compile and install OpenCV for you (compilation time will depend on your computer). I suggest going out for a cup of tea or coffee while ROpenCVLite is installing ;-)


3 - FAQ

Can I take pictures of my cat using Rvision?

Heck yeah! You can AND you should! You can even take pictures of your dog if you are that kind of degenerate person :-)

After placing your favorite pet in front of the webcam, just do:

my_stream <- stream(0)   # 0 will start your default webcam in general. 
my_pet_pic <- readNext(my_stream)
plot(my_pet_pic)
release(my_stream)

Can I take selfies with my webcam using Rvision?

You certainly can, but you should ask yourself whether you should...

my_stream <- stream(0)   # 0 will start your default webcam in general. 
my_selfie <- readNext(my_stream)
plot(my_selfie)
release(my_stream)

Be careful, this will trigger the explosion of your camera if it detects that you are making a duck face ;-)


Copy Link

Version

Version

0.2.2

License

GPL-3

Maintainer

Simon Garnier

Last Published

April 5th, 2021

Functions in Rvision (0.2.2)

addWeighted

Weighted Sum of Two Images
as.array.Rcpp_Image

Convert Image to Array or Matrix
RvisionAck

Image and video samples
Stream-class

An S4 class containing an OpenCV stream
Image-class

An S4 Class Containing an OpenCV Image
Rvision

Rvision: A basic (for now) computer vision library for R.
bitdepth

The Bit Depth of an Image
boxFilter

Blurs an Image Using a Box Filter
dim.Rcpp_Video

Dimensions of a Video
farneback

Optical Flow Using Farneback's Algorithm
morph

Morphological Operations
nrow.Rcpp_Image

The Number of Rows/Columns/Channels of an Image
plot.Image

Plot Rvision Images
plot.OF_array

Plot Optical Flow Arrays
write.Image

Image Output
image

Create an Object of Class Image
isBlob

Test for a Blob Object
setProp.Rcpp_Stream

Set/Get Video Properties
simpleBlobDetector

Simple Blob Detector
changeBitDepth

Convert image bit depth
changeColorSpace

Convert image between colorspaces
frame

Video Reader Position
gaussianBlur

Blurs an Image Using a Gaussian Filter
cloneImage

Make a copy of an Image object
codec

Codec of a Video
isVideo

Test for a Video object
Video-class

An S4 Class Containing an OpenCV Video
absdiff

Absolute Difference Between Two Images
filter2D

Image Convolution with Kernel
colorspace

The Color Space of an Image
dim.Rcpp_Image

Dimensions of an Image
plot.blob

Plot Blobs
readFrame

Read Specific Video Frame
merge

Merge Separate Channels into an Image
fps

Framerate of a Video
isImage

Test for an Image Object
isStream

Test for a Stream object
readNext.Rcpp_Stream

Read Next of an Object Frame
release.Rcpp_Stream

Release Object from Memory
split

Split an Image into Separate Channels
stream

Create an object of class Stream
sum

Sum Generic for additional arguments
timelapse

Make timelapse from Stream object
video

Create an Object of Class Video
nrow.Rcpp_Video

The Number of Rows/Columns/Frames of a Video
blur

Blurs an Image Using a Normalized Box Filter
medianBlur

Blurs an Image Using a Median Filter