This class serves for computation of the so-called Motion Tensor (see the the bibliographic references). More...
#include <ofMotionTensor.h>
Public Member Functions | |
| MotionTensor (i3d::Image3d< VOXEL > *Inp, i3d::Image3d< VOXEL > *Inp1, i3d::Vector3d< float >Sp=i3d::Vector3d< float >(1.0f, 1.0f, 1.0f)) | |
| MotionTensor (const MotionTensor< VOXEL > &st) | |
| virtual | ~MotionTensor () |
| virtual void | FreeMemory () |
| virtual void | ComputeTensor () |
| virtual void | SetDerivationInput (size_t a) |
| virtual size_t | GetDerivationInput () |
| MotionTensor & | operator= (const MotionTensor &st) |
| void | SetGamma (VOXEL g) |
| VOXEL | GetGamma () |
Protected Member Functions | |
| void | MultiplyTensorEntries () |
| void | MultiplyByScalar (VOXEL a) |
| void | AddTensor (MotionTensor< VOXEL > *Second) |
Protected Attributes | |
| i3d::Image3d< VOXEL > * | InputT1 |
| size_t | DerivationInput |
| VOXEL | Gamma |
This class serves for computation of the so-called Motion Tensor (see the the bibliographic references).
It is an ancestor of the class StructureTensor<VOXEL>. The core functionality is inherited.
Let
is the input gray-scale image sequence. Let
denotes the image gradient (2D image sequence). Let
, where
denotes the standard tensor product. Then the Motion Tensor has following form: For every pixel
are computed the spatial and temporal derivatives and their products are convolved with Gaussian blur with standard deviation
and saved in following matrix:
for 2D image sequence and
for 3D images. The motion tensor is computed from two input consecutive images. The spatial derivatives are computed with the stencil
, where
is the spacing. The temporal derivatives are computed with simple two point forward euler operator (See function TemporalDerivation()). The matrix entries are saved in the i3d::Image3d. So the MotionTensor class saves the matrix of Images.
The implementation of this function is based on following articles and book chapters:
Joachim Weickert. Coherence-Enhancing Diffusion Filtering, International Journal of Computer Vision 31(2/3), 111-127 (1999).
Bernd Jahne. DIgital Image Processing Concepts, Algorithms and Scientific Applications. Springer. 4th edition
A. Bruhn, J. Weickert, T. Kohlberger, and C. Schnörr A Multigrid Platform for Real-Time Motion Computation with Discontinuity-Preserving Variational Methods, Technical Report No. 136, Department of Mathematics, Saarland University, Saarbrücken, Germany, Mai 2005
The typical usage:
#include <OFFMGSolver.h>
#include <image3d.h>
......
i3d::Image3d<float> FImg, FImg1;
MotionTensor<float> MT(&FImg, &FImg1,Vector3d<float>(1.0,1.0,1.0));
MT.SetSigma(3.0);
MT.ComputeTensor();
MT.BlurTensor();
ST.GetTensorItem(1,2)->SaveImage("st_yt_deriv.mhd"); // save the fy * ft matrix entry to file
......
| MotionTensor< VOXEL >::MotionTensor | ( | i3d::Image3d< VOXEL > * | Inp, | |
| i3d::Image3d< VOXEL > * | Inp1, | |||
| i3d::Vector3d< float > | Sp = i3d::Vector3d <float>(1.0f, 1.0f, 1.0f) | |||
| ) |
Constructor. First and second parameter are pointers to 2 images from the motion sequence. Third parameter is spatial spacing.
| MotionTensor< VOXEL >::MotionTensor | ( | const MotionTensor< VOXEL > & | st | ) |
Copy constructor.
| MotionTensor< VOXEL >::~MotionTensor | ( | ) | [virtual] |
Destructor.
| void MotionTensor< VOXEL >::FreeMemory | ( | ) | [virtual] |
Free memory which will not be used by some specific routines which computes optical flow.
Reimplemented from StructureTensor< VOXEL >.
| void MotionTensor< VOXEL >::ComputeTensor | ( | ) | [virtual] |
This method computes the tensor
.
Reimplemented from StructureTensor< VOXEL >.
| void MotionTensor< VOXEL >::SetDerivationInput | ( | size_t | a | ) | [virtual] |
Set whether to compute spatial derivatives from first(a = 0), second(a = 1), or average(a = 2) of both frames.
| size_t MotionTensor< VOXEL >::GetDerivationInput | ( | ) | [virtual] |
Get whether to compute spatial derivatives from first(return 0), second(return 1), or average(return 2) of both frames.
| MotionTensor< VOXEL > & MotionTensor< VOXEL >::operator= | ( | const MotionTensor< VOXEL > & | st | ) |
Asignment operator.
| void MotionTensor< VOXEL >::SetGamma | ( | VOXEL | g | ) |
| VOXEL MotionTensor< VOXEL >::GetGamma | ( | ) |
| void MotionTensor< VOXEL >::MultiplyTensorEntries | ( | ) | [protected] |
| void MotionTensor< VOXEL >::MultiplyByScalar | ( | VOXEL | a | ) | [protected] |
| void MotionTensor< VOXEL >::AddTensor | ( | MotionTensor< VOXEL > * | Second | ) | [protected] |
i3d::Image3d<VOXEL>* MotionTensor< VOXEL >::InputT1 [protected] |
size_t MotionTensor< VOXEL >::DerivationInput [protected] |
VOXEL MotionTensor< VOXEL >::Gamma [protected] |
1.7.1