Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

MotionRecognition Class Reference

#include <MotionRecognition.h>

Inheritance diagram for MotionRecognition:

Inheritance graph
[legend]
Collaboration diagram for MotionRecognition:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MotionRecognition (const SensorBehaviorControlInterfaces &interfaces)
 Constructor.

Vector2< double > getAngleYZ (Vector2< int > pCentered)
 transforms pixelcoordinates to grad

int isDiff (Image &image1, Image &image2, Vector2< int > p1, Vector2< int > p2)
Vector2< int > getCenteredCoor (Vector2< int > p)
 shifts coordinatesource from top-left to center of image

Vector2< double > getCoorInmm (Vector2< int > p)
 transforms pixelcoordinates to mm

Vector2< int > getCoorInPixel (Vector2< double > p)
 transforms pixelcoordinates to mm

Vector2< int > getPixelFlow (Vector2< double > pCentered, double z, Vector3< double > cameraMovement, Vector3< double > cameraRotation)
 calculates xy-shift of a pixel

Vector2< int > getNewPixelPos (Vector2< int > p, Vector3< double > cameraMovement, Vector3< double > cameraRotation)
 calculates newPixelposition after movement and rotation of the camera

double getCameraZ (Vector2< double > angleYZ)
 calculates distance from camera to object (xy-plain)

Vector3< double > getCameraTranslation (Vector3< double > robotTranslation)
 calculates cameratranslation

Vector3< double > getCameraTranslation (double bounce)
Vector3< double > getCameraRotation (double bounce)
Vector3< double > getRobotTranslationFromOdometry ()
Vector3< double > getRobotTranslationFromBounce (double bounce)
Vector3< double > getRobotRotationFromOdometry ()
Vector3< double > getRobotRotationFromBounce (double bounce)
Vector3< double > getRobotTranslationForRotation (double robotRotationZ)
int pixelInImage (Vector2< int > p)
double getPixelDiff (Vector2< int > raster, double bounce, Image &image1, Image &image2, int draw)
double getPixelDiff (Vector2< int > raster, double bounce, Image &image1, Image &image2)
void drawPixelFlow (Vector3< double > cameraTranslation, Vector3< double > cameraRotation)
void drawDynamicDiff (Image &image1, Image &image2, double timeDiff)
virtual void execute ()
 Executes the module.

virtual bool handleMessage (InMessage &message)
 Called from a MessageQueue to distribute messages.

 DECLARE_DEBUG_IMAGE (imageMotionRecognition)
 DECLARE_DEBUG_IMAGE (imageProcessorGradients)

Private Attributes

OdometryData previousOdometry
Vector2< double > pixelDimensions
Image imageBuffer [IMAGEBUFFERSIZE]
unsigned long imageTimes [IMAGEBUFFERSIZE]
int start
int currentImage
int imagesLeft
Image motionRecognitionImage
Image processorGradientsImage

Detailed Description

Author:
Sebastian Ordyniak

Marten Richert

Definition at line 32 of file MotionRecognition.h.


Constructor & Destructor Documentation

MotionRecognition::MotionRecognition const SensorBehaviorControlInterfaces interfaces  ) 
 

Constructor.

Parameters:
interfaces The paramters of the MotionRecognition module.

Definition at line 12 of file MotionRecognition.cpp.

References BRENNWEITE, Image::cameraInfo, currentImage, IMAGEBUFFERSIZE, imagesLeft, CameraInfo::openingAngleHeight, CameraInfo::openingAngleWidth, pixelDimensions, CameraInfo::resolutionHeight, and CameraInfo::resolutionWidth.


Member Function Documentation

Vector2< double > MotionRecognition::getAngleYZ Vector2< int >  pCentered  ) 
 

transforms pixelcoordinates to grad

Parameters:
pCentered - centered xy-pixelcoordinates
Returns:
centered angle coors in grad

Definition at line 62 of file MotionRecognition.cpp.

References Image::cameraInfo, CameraInfo::openingAngleHeight, CameraInfo::openingAngleWidth, CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, Vector2< V >::x, and Vector2< V >::y.

Referenced by getNewPixelPos().

int MotionRecognition::isDiff Image image1,
Image image2,
Vector2< int >  p1,
Vector2< int >  p2
 

Definition at line 55 of file MotionRecognition.cpp.

References Image::image, Vector2< V >::x, and Vector2< V >::y.

Referenced by getPixelDiff().

Vector2< int > MotionRecognition::getCenteredCoor Vector2< int >  p  ) 
 

shifts coordinatesource from top-left to center of image

Parameters:
p top-left coordinates
Returns:
centered imagecoordinates

Definition at line 47 of file MotionRecognition.cpp.

References Image::cameraInfo, CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, Vector2< V >::x, and Vector2< V >::y.

Referenced by getNewPixelPos().

Vector2< double > MotionRecognition::getCoorInmm Vector2< int >  p  ) 
 

transforms pixelcoordinates to mm

Parameters:
p pixel coordinates
Returns:
coordinates in mm

Definition at line 38 of file MotionRecognition.cpp.

References pixelDimensions, Vector2< double >::x, Vector2< V >::x, Vector2< double >::y, and Vector2< V >::y.

Referenced by getNewPixelPos().

Vector2< int > MotionRecognition::getCoorInPixel Vector2< double >  p  ) 
 

transforms pixelcoordinates to mm

Parameters:
p pixel coordinates
Returns:
coordinates in mm

Definition at line 42 of file MotionRecognition.cpp.

References pixelDimensions, Vector2< double >::x, Vector2< V >::x, Vector2< double >::y, and Vector2< V >::y.

Referenced by getPixelFlow().

Vector2< int > MotionRecognition::getPixelFlow Vector2< double >  pCentered,
double  z,
Vector3< double >  cameraMovement,
Vector3< double >  cameraRotation
 

calculates xy-shift of a pixel

Parameters:
pCentered centered pixelcoordinates
z distance from the object belonging to pixel to camera
cameraMovement movement of the camera (in mm)
cameraRotation rotation of the camera (in grad)
Returns:
xy-shift of pixel

translationskoeffizienten

Brennweite der Kamera

rotationskoeffizenten

Definition at line 69 of file MotionRecognition.cpp.

References getCoorInPixel(), Vector2< V >::x, Vector3< V >::x, Vector2< V >::y, Vector3< V >::y, and Vector3< V >::z.

Referenced by getNewPixelPos().

Here is the call graph for this function:

Vector2< int > MotionRecognition::getNewPixelPos Vector2< int >  p,
Vector3< double >  cameraMovement,
Vector3< double >  cameraRotation
 

calculates newPixelposition after movement and rotation of the camera

Parameters:
p pixelcoordinates (coordinatesource = top-left
cameraMovement movement of the camera (in mm)
cameraRotation rotation of the camera (in grad)
Returns:
new pixelposition

transformiere p in Kamerazentrierte

transformiere in Grad

berechne z Koordinate der xy-Ebene

berechne Fluss in Pixeln

Definition at line 89 of file MotionRecognition.cpp.

References getAngleYZ(), getCameraZ(), getCenteredCoor(), getCoorInmm(), and getPixelFlow().

Referenced by drawPixelFlow(), and getPixelDiff().

Here is the call graph for this function:

double MotionRecognition::getCameraZ Vector2< double >  angleYZ  ) 
 

calculates distance from camera to object (xy-plain)

Parameters:
angleYZ angle of cameraray
Returns:
istance from camera to object (xy-plain)

Definition at line 28 of file MotionRecognition.cpp.

References Matrix3x3< double >::c, DISTANCE_INFINITY, Pose3D::rotation, Pose3D::translation, and Vector3< double >::z.

Referenced by getNewPixelPos().

Vector3< double > MotionRecognition::getCameraTranslation Vector3< double >  robotTranslation  ) 
 

calculates cameratranslation

Parameters:
robotTranslation 
Returns:
cameraTranslation

Definition at line 104 of file MotionRecognition.cpp.

References RotationMatrix::invert(), and Pose3D::rotation.

Referenced by drawDynamicDiff(), getCameraRotation(), getCameraTranslation(), and getPixelDiff().

Here is the call graph for this function:

Vector3< double > MotionRecognition::getCameraTranslation double  bounce  ) 
 

Definition at line 152 of file MotionRecognition.cpp.

References getCameraTranslation(), getRobotTranslationFromBounce(), and getRobotTranslationFromOdometry().

Here is the call graph for this function:

Vector3< double > MotionRecognition::getCameraRotation double  bounce  ) 
 

Definition at line 158 of file MotionRecognition.cpp.

References getCameraTranslation(), getRobotRotationFromBounce(), and getRobotRotationFromOdometry().

Referenced by drawDynamicDiff(), and getPixelDiff().

Here is the call graph for this function:

Vector3< double > MotionRecognition::getRobotTranslationFromOdometry  ) 
 

Definition at line 131 of file MotionRecognition.cpp.

References getRobotTranslationForRotation(), previousOdometry, Pose2D::rotation, Pose2D::translation, Vector2< V >::x, and Vector2< V >::y.

Referenced by getCameraTranslation().

Here is the call graph for this function:

Vector3< double > MotionRecognition::getRobotTranslationFromBounce double  bounce  ) 
 

Definition at line 140 of file MotionRecognition.cpp.

Referenced by getCameraTranslation().

Vector3< double > MotionRecognition::getRobotRotationFromOdometry  ) 
 

Definition at line 144 of file MotionRecognition.cpp.

References previousOdometry, and Pose2D::rotation.

Referenced by getCameraRotation().

Vector3< double > MotionRecognition::getRobotRotationFromBounce double  bounce  ) 
 

Definition at line 148 of file MotionRecognition.cpp.

References fromDegrees().

Referenced by getCameraRotation().

Here is the call graph for this function:

Vector3< double > MotionRecognition::getRobotTranslationForRotation double  robotRotationZ  ) 
 

Definition at line 109 of file MotionRecognition.cpp.

References Pose3D::translation, and Vector3< double >::x.

Referenced by getRobotTranslationFromOdometry().

int MotionRecognition::pixelInImage Vector2< int >  p  ) 
 

Definition at line 125 of file MotionRecognition.cpp.

References Image::cameraInfo, CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, Vector2< V >::x, and Vector2< V >::y.

Referenced by getPixelDiff().

double MotionRecognition::getPixelDiff Vector2< int >  raster,
double  bounce,
Image image1,
Image image2,
int  draw
 

Definition at line 164 of file MotionRecognition.cpp.

References Image::cameraInfo, getCameraRotation(), getCameraTranslation(), getNewPixelPos(), Image::image, isDiff(), motionRecognitionImage, pixelInImage(), processorGradientsImage, CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, Vector2< V >::x, and Vector2< V >::y.

Referenced by drawDynamicDiff(), and getPixelDiff().

Here is the call graph for this function:

double MotionRecognition::getPixelDiff Vector2< int >  raster,
double  bounce,
Image image1,
Image image2
 

Definition at line 191 of file MotionRecognition.cpp.

References getPixelDiff().

Here is the call graph for this function:

void MotionRecognition::drawPixelFlow Vector3< double >  cameraTranslation,
Vector3< double >  cameraRotation
 

Definition at line 114 of file MotionRecognition.cpp.

References Image::cameraInfo, DOT, getNewPixelPos(), LINE, CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, Vector2< V >::x, and Vector2< V >::y.

Referenced by drawDynamicDiff().

Here is the call graph for this function:

void MotionRecognition::drawDynamicDiff Image image1,
Image image2,
double  timeDiff
 

Definition at line 195 of file MotionRecognition.cpp.

References Image::cameraInfo, drawPixelFlow(), getCameraRotation(), getCameraTranslation(), getPixelDiff(), Image::image, INIT_DEBUG_IMAGE, motionRecognitionImage, processorGradientsImage, CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, and SEND_DEBUG_IMAGE.

Referenced by execute().

Here is the call graph for this function:

void MotionRecognition::execute  )  [virtual]
 

Executes the module.

Implements Module.

Definition at line 238 of file MotionRecognition.cpp.

References currentImage, DEBUG_DRAWING_FINISHED, drawDynamicDiff(), SystemCall::getCurrentSystemTime(), HeadControlMode::headControlMode, IMAGEBUFFERSIZE, imagesLeft, imageTimes, MotionRequest::motionType, and previousOdometry.

Here is the call graph for this function:

bool MotionRecognition::handleMessage InMessage message  )  [virtual]
 

Called from a MessageQueue to distribute messages.

Use message.getMessageID to decide if the message is relavant for the MesssageHandler derivate. Use message.bin, message.text or message.config as In streams to get the data from.

Parameters:
message The message that can be read.
Returns:
true if the message was read (handled).

Reimplemented from Module.

Definition at line 262 of file MotionRecognition.cpp.

MotionRecognition::DECLARE_DEBUG_IMAGE imageMotionRecognition   ) 
 

MotionRecognition::DECLARE_DEBUG_IMAGE imageProcessorGradients   ) 
 


Member Data Documentation

OdometryData MotionRecognition::previousOdometry [private]
 

Definition at line 134 of file MotionRecognition.h.

Referenced by execute(), getRobotRotationFromOdometry(), and getRobotTranslationFromOdometry().

Vector2<double> MotionRecognition::pixelDimensions [private]
 

Definition at line 135 of file MotionRecognition.h.

Referenced by getCoorInmm(), getCoorInPixel(), and MotionRecognition().

Image MotionRecognition::imageBuffer[IMAGEBUFFERSIZE] [private]
 

Definition at line 136 of file MotionRecognition.h.

unsigned long MotionRecognition::imageTimes[IMAGEBUFFERSIZE] [private]
 

Definition at line 137 of file MotionRecognition.h.

Referenced by execute().

int MotionRecognition::start [private]
 

Definition at line 138 of file MotionRecognition.h.

int MotionRecognition::currentImage [private]
 

Definition at line 138 of file MotionRecognition.h.

Referenced by execute(), and MotionRecognition().

int MotionRecognition::imagesLeft [private]
 

Definition at line 138 of file MotionRecognition.h.

Referenced by execute(), and MotionRecognition().

Image MotionRecognition::motionRecognitionImage [private]
 

Definition at line 141 of file MotionRecognition.h.

Referenced by drawDynamicDiff(), and getPixelDiff().

Image MotionRecognition::processorGradientsImage [private]
 

Definition at line 141 of file MotionRecognition.h.

Referenced by drawDynamicDiff(), and getPixelDiff().


The documentation for this class was generated from the following files:
Generated on Thu Sep 23 20:09:46 2004 for GT2004 by doxygen 1.3.6