GPUFFTVideoCaptureDemo - Demonstrate use of GPGPU computing for live filtering via 2D-FFT.

This demo makes use of the FOSS GPUmat toolbox to perform a GPU
accelerated 2D FFT + filtering in frequency space + 2D inverse FFT on a
live video feed from video capture or movie playback. GPUmat allows to
use NVidia’s CUDA gpu computing framework on supported NVidia gpu’s

It shows how a Psychtoolbox floating point texture (with video content
inside) can be efficiently passed to GPUmat as a matrix of GPUsingle data
type, which is stored and processed on the GPU. Then it uses GPUmat’s fft
routines for forward/inverse fft’s and matrix manipulation. Then it
returns the final image to Psychtoolbox as a new floating point texture
for display. The same steps are carried out with Matlab/Octave’s regular
fft routines on the cpu for reference.

Requires the freely downloadable NVidia CUDA-5.0 SDK/Runtime and the free
and open-source GPUmat toolbox as well as a compute capable NVidia
graphics card.


GPUFFTVideoCaptureDemo([usegpu=1][, showfft=0][, fwidth=11][, roi=[0 0 640 480]][, depth=1][, deviceId=0][, cameraname])


‘usegpu’ = 0 to use regular Matlab/Octave fft on CPU, 1 = to use GPUmat on GPU.

‘showfft’ = 1 to show amplitude spectrum of video in usegpu=1 mode.

‘fwidth’ = Width of low-pass filter kernel in frequency space units.

‘roi’ Selects a rectangular subregion of the camera for display. By
default, it selects a [0 0 640 480] rectangle, ie. the full area of a
camera with 640 x 480 pixels resolution. This parameter may need tweaking
for some cameras, as some drivers have bugs and don’t work well with all

‘depth’ = 1 for Mono, 3 for color processing.

‘deviceId’ Device index of video capture device. Defaults to system default.

‘cameraname’ Name string for selection of video capture device. This is
only honored if ‘deviceId’ is a negative number, and only for certain
video capture plugins. Defaults to none.

Path   Retrieve current version from GitHub | View changelog