Scripting Samples

The page provides a list of sample scripts which can run under control of scripting engine available in the Computer Vision Sandbox. They demonsrtate usage of different scripting APIs and usage of different types of plug-ins from the scripting environment. While API and plug-ins collection get extended, the number of samples will grow to cover new areas.

Image processing effects

HueRotation.lua This a simple "Hello World" sample demonstrating basics of using an image processing plug-in from a Lua script.
ColorEmboss.lua Sample script which uses two plug-ins: one which supports in-place image processing and another which does not. And so the new image must be set back to the host application for further processing or display.

It changes Emboss plug-in's "azimuth" property, which is direction of a light source, and "hue" property of the Colorize plug-in's at the same time.
Pixellate.lua The sample script uses Pixellate plug-in to "change" vertical/horizontal size of pixels. It first increases size of pixels and then decreases, repeating it a loop.
RandomizeIt.lua A sample script which uses a variety of image processing plug-ins to create sort of unstable environment, where many different things change like: brightness, contrast, saturation, noise level, shaking (slight rotation), etc. This creates sort of old/shaking movie.
Oldify.lua A sample script which uses different image processing plug-ins to create an old film effect, which contains random noise, vertical grain and changing vignetting effect. This all is displayed using sepia colors and surrounded with a fuzzy border.
ControllingEffects.lua A sample script which allows switching between different effects by pressing CapsLock, NumLock and ScrolLock.
SubImageProcessing.lua The script demonstrates how to apply image processing plug-ins to sub images of the source image (rectangular ROIs).
PicturesSlideshow.lua The script demonstrates how to combine JPEG files from the specified folder with incoming video frames. Note: don't forget to set folder to load images from by edditing the script before running it.
FadeOut.lua The script demonstrates a video fading effect, which first randomly fills video frames with black blocks and then randomly cleans it back.

Image processing samples

MotionDetection1.lua The script demonstrates implementation of a simple motion detector based on difference between two consecutive frames of a video stream.
MotionDetection2.lua The script demonstrates implementation of a simple motion detector based on difference between current video frame and background frame. Initially, the first received video frame is taken as background frame. But then it slowly gets updated to decrease difference with new coming frames. The idea is that moving objects should leave scene quick enough before they appear on the background frame, while the rest is static enough and so gets into the background.

The script also saves all detected motion into video files.
TimeLapseImages.lua The script demonstrates saving of video frames into image files at a certain time intervals.
DrawingFunctions.lua The script demonstrates different functions to draw on images.


See also: