CVR-Lib last update 20 Sep 2009

cvr::rectLocation Class Reference

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

#include <cvrRectLocation.h>

Collaboration diagram for cvr::rectLocation:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 rectLocation ()
 rectLocation (const ipoint &pos, const float &ang, const float &maxLength, const float &minLength)
 rectLocation (const fpoint &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 ipoint &shft)
rectLocationshift (const fpoint &shft)
rectLocationshift (const rectLocation &other, const ipoint &shft)
rectLocationshift (const rectLocation &other, const fpoint &shft)
rectLocationrotate (const float &factor)
rectLocationrotate (const rectLocation &other, const float &factor)
bool contains (const ipoint &p) const
bool contains (const fpoint &p) const
float distanceSqr (const rectLocation &other)
float distanceSqr (const rectLocation &other, fpoint &pt, fpoint &po)
float calculateArea () const

Public Attributes

fpoint position
float angle
float maxLength
float minLength


Detailed Description

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

The rectangular location is 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 cvr::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 cvr::boundingBox functor, and use them to check if objects overlap or not.


Constructor & Destructor Documentation

cvr::rectLocation::rectLocation (  ) 

Default constructor.

cvr::rectLocation::rectLocation ( const ipoint pos,
const float &  ang,
const float &  maxLength,
const float &  minLength 
)

Constructor.

Parameters:
pos position of the center 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

cvr::rectLocation::rectLocation ( const fpoint pos,
const float &  ang,
const float &  maxLength,
const float &  minLength 
)

Constructor.

Parameters:
pos position of the center 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

cvr::rectLocation::rectLocation ( const location loc  ) 

Copy constructor from a normal location.

cvr::rectLocation::rectLocation ( const rectLocation other  ) 

Copy constructor.


Member Function Documentation

float cvr::rectLocation::calculateArea (  )  const

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

rectLocation& cvr::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 cvr::rectLocation::contains ( const fpoint p  )  const

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

bool cvr::rectLocation::contains ( const ipoint p  )  const

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

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

Copy operator.

float cvr::rectLocation::distanceSqr ( const rectLocation other,
fpoint pt,
fpoint 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 cvr::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

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

Operator !=.

bool cvr::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& cvr::rectLocation::operator= ( const rectLocation other  ) 

Alias for copy operator.

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

Operator ==.

bool cvr::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& cvr::rectLocation::rotate ( const rectLocation other,
const float &  factor 
)

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

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

Add the given angle in radians to the actual angle.

rectLocation& cvr::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& cvr::rectLocation::scale ( const float &  factor  ) 

Multiply the lengths and position with the given factor.

rectLocation& cvr::rectLocation::shift ( const rectLocation other,
const fpoint shft 
)

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

rectLocation& cvr::rectLocation::shift ( const rectLocation other,
const ipoint shft 
)

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

rectLocation& cvr::rectLocation::shift ( const fpoint shft  ) 

Shift the rectLocation by the given point.

rectLocation& cvr::rectLocation::shift ( const ipoint shft  ) 

Shift the rectLocation by the given point.


Member Data Documentation

Angle in radians 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.

Major length.

The angle corresponds to the axis with the maxLength

Minor length.

Should be smaller than maximum length

Position of the rectLocation.


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

Generated on Sun Sep 20 22:08:51 2009 for CVR-Lib by Doxygen 1.5.8