Robust Local Optical Flow Libary Documentation  V 1.2
 All Classes Files Functions Variables Enumerations Enumerator Macros Pages
Macros | Functions
RLOFTools.hpp File Reference

Motion estimation and illustration. More...

#include <OpticalFlow/RLOFFactory.h>
#include <OpticalFlow/RLOFParameter.h>
#include <iostream>
#include <opencv\highgui.h>

Go to the source code of this file.

Functions

static void denseMotionField (const cv::Mat &img1, const cv::Mat &img2, IFeatureTracker *tracker, FeatureTrackerContext &param, cv::Mat &U, cv::Mat &V)
 
void FlowToRGB (const cv::Mat &dx, const cv::Mat &dy, cv::Mat &rgbFlow, const float &max_size=-1, bool use_value=false, cv::Mat &sat=cv::Mat())
 Convert motion field to RGB colormap. More...
 
void test1 ()
 
void test0 ()
 

Detailed Description

Motion estimation and illustration.

Contains a set of useful function regarding motion estimation and illustration.

Version
1.2
Date
04.05.2012
Author
Tobias Senst

Definition in file RLOFTools.hpp.

Function Documentation

static void denseMotionField ( const cv::Mat &  img1,
const cv::Mat &  img2,
IFeatureTracker tracker,
FeatureTrackerContext param,
cv::Mat &  U,
cv::Mat &  V 
)
static

Compute a dense motion field with the prefered optical flow method

Parameters
img1Image at time t.
img2Image at time t+1.
trackerPointer to the RLOF instance.
paramRLOF parameter.
UResulting u matrice containing dx motions of type CV_32FC1.
VResulting v matrice containing dy motions of type CV_32FC1.

Definition at line 116 of file RLOFTools.hpp.

Referenced by demo(), and test1().

void FlowToRGB ( const cv::Mat &  dx,
const cv::Mat &  dy,
cv::Mat &  rgbFlow,
const float &  max_size = -1,
bool  use_value = false,
cv::Mat &  sat = cv::Mat() 
)

Convert motion field to RGB colormap.

Function converts a motion vector field specified by dx and dy to a 8UC3 RGB colormap using the HSV2RGB transformation.While Saturation(S) and Value(V) channels are used to code the length of a motion vector, Hue(H) is used to display the direction (angle) Therefore lenght of a motion vector is scaled with max_size

Parameters
dx32FC1 motion vectorfield dx component
dy32FC1 motion vectorfield dx component
rgbFlow8UC3 output matrice (colormap)
max_sizeMaximal value to rescale the S or V channel.
use_valueIf set V channels is used to code motion vector length else S channels is used
satIf set it has to be 8UC1 and is used the weight the sat channel (by default it should not be used)

Definition at line 180 of file RLOFTools.hpp.

Referenced by demo().

void test0 ( )

Test function. Check for all intances available.

Definition at line 342 of file RLOFTools.hpp.

Referenced by main().

void test1 ( )

Test function. Test the consitens of the accuracy of the library.

Definition at line 276 of file RLOFTools.hpp.

Referenced by main().