STIRA  0.1
Public Types | Public Member Functions | List of all members
stira::imagedata::OrientationGrid Class Reference

A data class to hold a grid of local orientations: for each pixel, a local orientation and magnitude are kept from this representation, it should be fairly easy to implement the Hough transform for different parametric models like straight lines and circles: loop over all possible values of the parameter sets for the lines to check a) based on parameters, generate parametric representation of candidate line (circle, curve) b) for all pixels along this line, check if the orientation map (direction/strength) supports the presence of this candidate if yes, add 1 to accumulator for the given parameters. More...

#include <OrientationGrid.h>

Public Types

enum  ColorExportMode { EXPORT_RGB_MODE, EXPORT_HSV_MODE }
 enum that describes color mapping from angle to color More...
 

Public Member Functions

 OrientationGrid (int width, int height)
 Constructor. More...
 
 ~OrientationGrid ()
 Destructor.
 
OrientationGridClone ()
 
int GetWidth ()
 Gets the width of the grid.
 
int GetHeight ()
 Gets the height of the grid.
 
void SetAngle (int x, int y, double myAngle)
 Sets the local angle at specified position of the grid. More...
 
double GetAngle (int x, int y)
 Gets the local angle at specified position of the grid. More...
 
void SetOrientation (int x, int y, LocalOrientation *pLocalOrientation)
 Sets the local orientation (angle,magnitude) at specified position of the grid. More...
 
LocalOrientationGetOrientation (int x, int y)
 Gets the local orientation (angle,magnitude) at specified position of the grid. More...
 
void SetMagnitude (int x, int y, double myMagnitude)
 Sets the magnitude of the feature response at position (x, y) More...
 
double GetMagnitude (int x, int y)
 Gets the magnitude of the feature response at position (x, y) More...
 
std::vector< LocalOrientationGetOrientationVector (int xMin, int yMin, int xMax, int yMax)
 Gets a vector with the orientations within the specified ROI. More...
 
bool GetMinMaxMagnitude (double &mmin, double &mmax)
 Gets the minimum and maximum magnitude of the features in the grid. More...
 
ArrayGrid< double > * ExtractMagnitudeGrid ()
 extracts a grid with only edge magnitudes Becomes responsability of the caller to free this newly created object
 
ImageVisualizeMagnitudeImage ()
 creates current magnitude image ready for exporting to disk or viewing on screen
 
ArrayGrid< double > * ExtractOrientationGrid ()
 extracts a grid with only edge orientations Becomes responsability of the caller to free this newly created object
 
ImageVisualizeOrientationImage (double threshold, ColorExportMode myMode=EXPORT_HSV_MODE)
 creates current orientation image ready for exporting to disk or viewing on screen More...
 

Detailed Description

A data class to hold a grid of local orientations: for each pixel, a local orientation and magnitude are kept from this representation, it should be fairly easy to implement the Hough transform for different parametric models like straight lines and circles: loop over all possible values of the parameter sets for the lines to check a) based on parameters, generate parametric representation of candidate line (circle, curve) b) for all pixels along this line, check if the orientation map (direction/strength) supports the presence of this candidate if yes, add 1 to accumulator for the given parameters.

Member Enumeration Documentation

enum that describes color mapping from angle to color

Enumerator
EXPORT_RGB_MODE 

linear interpolation in R, G and B (see ConvertAngleToRGBMap for details)

EXPORT_HSV_MODE 

angle mapped to H, (S and V are both set to 1). HSV is then converted to RGB

Constructor & Destructor Documentation

stira::imagedata::OrientationGrid::OrientationGrid ( int  width,
int  height 
)

Constructor.

Parameters
widthwidth of the grid
heightheight of the grid

Member Function Documentation

double stira::imagedata::OrientationGrid::GetAngle ( int  x,
int  y 
)
double stira::imagedata::OrientationGrid::GetMagnitude ( int  x,
int  y 
)

Gets the magnitude of the feature response at position (x, y)

Parameters
xthe x coordinate
ythe y coordinate

References stira::imagedata::ColorValue::c, stira::common::MathUtils::ToDegrees(), and stira::imagedata::ColorValue::type.

Referenced by stira::imageanalysis::CannyEdgeDetector::~CannyEdgeDetector().

bool stira::imagedata::OrientationGrid::GetMinMaxMagnitude ( double &  mmin,
double &  mmax 
)

Gets the minimum and maximum magnitude of the features in the grid.

Parameters
mmin(output) the minimum magnitude
mmax(output) the maximum magnitude
LocalOrientation * stira::imagedata::OrientationGrid::GetOrientation ( int  x,
int  y 
)

Gets the local orientation (angle,magnitude) at specified position of the grid.

Parameters
xthe x coordinate
ythe y coordinate
std::vector< LocalOrientation > stira::imagedata::OrientationGrid::GetOrientationVector ( int  xMin,
int  yMin,
int  xMax,
int  yMax 
)

Gets a vector with the orientations within the specified ROI.

Parameters
xMinminimum x coordinate of the ROI
yMinminimum y coordinate of the ROI
xMaxmaximum x coordinate of the ROI
yMaxmaximum y coordinate of the ROI

Referenced by stira::imageanalysis::HOG::HOG().

void stira::imagedata::OrientationGrid::SetAngle ( int  x,
int  y,
double  myAngle 
)
void stira::imagedata::OrientationGrid::SetMagnitude ( int  x,
int  y,
double  myMagnitude 
)
void stira::imagedata::OrientationGrid::SetOrientation ( int  x,
int  y,
LocalOrientation pLocalOrientation 
)

Sets the local orientation (angle,magnitude) at specified position of the grid.

Parameters
xthe x coordinate
ythe y coordinate
myLocalOrientationthe local orientation to set for position (x,y)
Image * stira::imagedata::OrientationGrid::VisualizeOrientationImage ( double  threshold,
ColorExportMode  myMode = EXPORT_HSV_MODE 
)

creates current orientation image ready for exporting to disk or viewing on screen

Parameters
thresholdthreshold value for magnitude (below this, we just put black instead of coded orientation)
myModecolor mapping scheme to use

References stira::imagedata::ColorValue::c, stira::imagedata::Image::GetBands(), and stira::imagedata::Image::SetImageName().


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