LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::rectLocation Class Reference

The rectLocation class specifies a small region in an image or channel. More...

#include <ltiLocation.h>

Collaboration diagram for lti::rectLocation:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 rectLocation ()
 rectLocation (const point &pos, const float &ang, const float &maxLength, const float &minLength)
 rectLocation (const tpoint< float > &pos, const float &ang, const float &maxLength, const float &minLength)
 rectLocation (const location &loc)
 rectLocation (const rectLocation &other)
rectLocationcopy (const rectLocation &other)
rectLocationcastFrom (const location &other)
rectLocationoperator= (const rectLocation &other)
bool operator== (const rectLocation &p) const
bool operator!= (const rectLocation &p) const
bool operator< (const rectLocation &other)
bool operator> (const rectLocation &other)
rectLocationscale (const float &factor)
rectLocationscale (const rectLocation &other, const float &factor)
rectLocationshift (const point &shft)
rectLocationshift (const tpoint< float > &shft)
rectLocationshift (const rectLocation &other, const point &shft)
rectLocationshift (const rectLocation &other, const tpoint< float > &shft)
rectLocationrotate (const float &factor)
rectLocationrotate (const rectLocation &other, const float &factor)
bool contains (const point &p) const
bool contains (const tpoint< float > &p) const
float distanceSqr (const rectLocation &other)
float distanceSqr (const rectLocation &other, tpoint< float > &pt, tpoint< float > &po)
float getArea () const

Public Attributes

tpoint< float > position
float angle
float maxLength
float minLength

Detailed Description

The rectLocation class specifies a small region in an image or channel.

The rectangular locations are represented by its position in an image or channel, an orientation, the length at the orientation direction (maxLenght), and the length at the perpendicular direction (minLength).

The difference to lti::location is that the regions are considered rectangular. Two lengths are needed, where the orientation angle is always given for the maxLength.

You can get rectangular locations with the lti::boundingBox functor, and used them to check if objects overlap or not.


Constructor & Destructor Documentation

lti::rectLocation::rectLocation (  ) 

default constructor

lti::rectLocation::rectLocation ( const point pos,
const float &  ang,
const float &  maxLength,
const float &  minLength 
)

Constructor.

Parameters:
pos position of the middle point of the rectLocation
ang angle of the rectLocation (in radians)
maxLength length in pixels of the principal axis
minLength length in pixels of the second axis
lti::rectLocation::rectLocation ( const tpoint< float > &  pos,
const float &  ang,
const float &  maxLength,
const float &  minLength 
)

Constructor.

Parameters:
pos position of the middle point of the rectLocation
ang angle of the rectLocation (in radians)
maxLength length in pixels of the principal axis
minLength length in pixels of the second axis
lti::rectLocation::rectLocation ( const location loc  ) 

copy constructor from a normal location

lti::rectLocation::rectLocation ( const rectLocation other  ) 

copy constructor


Member Function Documentation

rectLocation& lti::rectLocation::castFrom ( const location other  ) 

copy the other location into this rectLocation.

The radius of the location will be assumed as the maxLength and minLength.

bool lti::rectLocation::contains ( const tpoint< float > &  p  )  const

Check if the given point can be considered within the rectLocation.

bool lti::rectLocation::contains ( const point p  )  const

Check if the given point can be considered within the rectLocation.

rectLocation& lti::rectLocation::copy ( const rectLocation other  ) 

copy operator

float lti::rectLocation::distanceSqr ( const rectLocation other,
tpoint< float > &  pt,
tpoint< float > &  po 
)

returns the square of the distance between the borders of two locations or zero if they overlap or if one of the locations lies inside the other one.

Parameters:
other the other rectLocation to be compared with
pt point in the border of this location with the smallest distance.
po point in the border of the other location with the smallest distance.
Returns:
minimal distance to other location
float lti::rectLocation::distanceSqr ( const rectLocation other  ) 

returns the square of the distance between the borders of two locations or zero if they overlap or if one of the locations lies inside the other one.

Parameters:
other the other rectLocation to be compared with
Returns:
minimal distance to other location
float lti::rectLocation::getArea (  )  const

Get the area of this location (maxLength*minLength).

bool lti::rectLocation::operator!= ( const rectLocation p  )  const

operator !=

bool lti::rectLocation::operator< ( const rectLocation other  ) 

Comparition operator.

A rectLocation is smaller than another one if its area is smaller, or in case of equal areas, if the position is smaller, i.e. if it has smaller y-coordinate, or in case of equal y-position, if it has smaller x-coordinate.

rectLocation& lti::rectLocation::operator= ( const rectLocation other  ) 

alias for copy operator

bool lti::rectLocation::operator== ( const rectLocation p  )  const

operator ==

bool lti::rectLocation::operator> ( const rectLocation other  ) 

Comparition operator.

A rectLocation is greater than another one if its area is greater, or in case of equal radii, if the position is greater, i.e. if it has greater y-coordinate, or in case of equal y-position, if it has greater x-coordinate.

rectLocation& lti::rectLocation::rotate ( const rectLocation other,
const float &  factor 
)

Add the given angle in radius to the angle of the other rectLocation and leave the result here.

rectLocation& lti::rectLocation::rotate ( const float &  factor  ) 

Add the given angle in radius to the actual angle.

rectLocation& lti::rectLocation::scale ( const rectLocation other,
const float &  factor 
)

Multiply the other rectLocation's lengths and position with the given factor and leave the result here.

rectLocation& lti::rectLocation::scale ( const float &  factor  ) 

Multiply the lengths and position with the given factor.

rectLocation& lti::rectLocation::shift ( const rectLocation other,
const tpoint< float > &  shft 
)

Shift the other rectLocation by the given point and leave the result here.

rectLocation& lti::rectLocation::shift ( const rectLocation other,
const point shft 
)

Shift the other rectLocation by the given point and leave the result here.

rectLocation& lti::rectLocation::shift ( const tpoint< float > &  shft  ) 

Shift the rectLocation by the given point.

rectLocation& lti::rectLocation::shift ( const point shft  ) 

Shift the rectLocation by the given point.


Member Data Documentation

Angle in radius of the rectLocation.

It is usually given for the image coordinates, i.e. for a left coordinate system, in which positive angles are given clock-wise.

maximum length.

The angle corresponds to the axis with the maxLength

minimum length.

Should be smaller than maximum length

Position of the rectLocation.


The documentation for this class was generated from the following file:

Generated on Sat Apr 10 15:27:32 2010 for LTI-Lib by Doxygen 1.6.1