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.packages("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.6

License

GPL-3

Maintainer

Simon Garnier

Last Published

April 5th, 2021

Functions in Rvision (0.2.6)

addWeighted

Weighted Sum of Two Images
as.array.Rcpp_Image

Convert Image to Array or Matrix
colorspace

The Color Space of an Image
destroyDisplay

drawEllipse

drawLine

gaussianBlur

Blurs an Image Using a Gaussian Filter
image

Create an Object of Class Image
merge

Merge Separate Channels into an Image
morph

Morphological Operations
release.Rcpp_Stream

Release Object from Memory
resize

sum

Sum Generic for additional arguments
timelapse

Make timelapse from Stream object
Image-class

An S4 Class Containing an OpenCV Image
Rvision

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

Convert image bit depth
changeColorSpace

Convert image between colorspaces
drawText

fps

Framerate of a Video
frame

Video Reader Position
plot.Image

Plot Rvision Images
plot.OF_array

Plot Optical Flow Arrays
setProp.Rcpp_Stream

Set/Get Video Properties
simpleBlobDetector

Simple Blob Detector
drawRectangle

write.Image

Image Output
RvisionAck

Image and video samples
Video-class

An S4 Class Containing an OpenCV Video
absdiff

Absolute Difference Between Two Images
dim.Rcpp_Image

Dimensions of an Image
dim.Rcpp_Stream

Dimensions of a Stream
farneback

Optical Flow Using Farneback's Algorithm
filter2D

Image Convolution with Kernel
isStream

Test for a Stream object
isVideo

Test for a Video object
readMulti

Read a Multi-Page Image
readNext.Rcpp_Stream

Read Next of an Object Frame
blur

Blurs an Image Using a Normalized Box Filter
Stream-class

An S4 class containing an OpenCV stream
cloneImage

Make a copy of an Image object
codec

Codec of a Video
isBlob

Test for a Blob Object
isImage

Test for an Image Object
sobel

Calculates an Image Derivatives Using an Extended Sobel Operator
spatialGradient

First Order Derivatives of an Image with the Sobel Operator
scharr

Calculates an Image Derivatives Using a Scharr Operator
sepFilter2D

Image Filtering with a Separable Linear Filter
video

Create an Object of Class Video
nrow.Rcpp_Video

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

Blurs an Image Using a Box Filter
drawArrow

drawCircle

laplacian

Calculates the Laplacian of an Image
medianBlur

Blurs an Image Using a Median Filter
plot.blob

Plot Blobs
readFrame

Read Specific Video Frame
split

Split an Image into Separate Channels
sqrBoxFilter

Blurs an Image Using a Square Box Filter
stream

Create an object of class Stream
nrow.Rcpp_Stream

The Number of Rows/Columns of a Stream
bilateralFilter

Edge-Preserving Noise Reduction with a Bilateral Filter
dim.Rcpp_Video

Dimensions of a Video
bitdepth

The Bit Depth of an Image
display

newDisplay

nrow.Rcpp_Image

The Number of Rows/Columns/Channels of an Image