STIRA
0.1
|
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. | |
OrientationGrid * | Clone () |
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... | |
LocalOrientation * | GetOrientation (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< LocalOrientation > | GetOrientationVector (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 | |
Image * | VisualizeMagnitudeImage () |
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 | |
Image * | VisualizeOrientationImage (double threshold, ColorExportMode myMode=EXPORT_HSV_MODE) |
creates current orientation image ready for exporting to disk or viewing on screen More... | |
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.
stira::imagedata::OrientationGrid::OrientationGrid | ( | int | width, |
int | height | ||
) |
Constructor.
width | width of the grid |
height | height of the grid |
double stira::imagedata::OrientationGrid::GetAngle | ( | int | x, |
int | y | ||
) |
Gets the local angle at specified position of the grid.
x | the x coordinate |
y | the y coordinate |
Referenced by stira::steerable::ComputeSteerableFilteredImages::FilterAlongDominantOrientationG(), stira::steerable::ComputeSteerableFilteredImages::FilterAlongDominantOrientationH(), and stira::imageanalysis::CannyEdgeDetector::~CannyEdgeDetector().
double stira::imagedata::OrientationGrid::GetMagnitude | ( | int | x, |
int | y | ||
) |
Gets the magnitude of the feature response at position (x, y)
x | the x coordinate |
y | the 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.
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.
x | the x coordinate |
y | the 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.
xMin | minimum x coordinate of the ROI |
yMin | minimum y coordinate of the ROI |
xMax | maximum x coordinate of the ROI |
yMax | maximum y coordinate of the ROI |
Referenced by stira::imageanalysis::HOG::HOG().
void stira::imagedata::OrientationGrid::SetAngle | ( | int | x, |
int | y, | ||
double | myAngle | ||
) |
Sets the local angle at specified position of the grid.
x | the x coordinate |
y | the y coordinate |
myAngle | the angle to set for position (x,y) |
Referenced by stira::steerable::ComputeOrientation::ComputeDominantOrientationInputComplexPyramidLevel(), stira::steerable::ComputeOrientation::ComputeDominantOrientationInputFreemanAdelson(), stira::filter::NonSeparableFilter::DetermineLocalMagnitudeAndOrientation(), stira::imageanalysis::HOG::HOG(), stira::imageanalysis::StegerLineDetector::Run(), stira::imageanalysis::CannyEdgeDetector::~CannyEdgeDetector(), and ~OrientationGrid().
void stira::imagedata::OrientationGrid::SetMagnitude | ( | int | x, |
int | y, | ||
double | myMagnitude | ||
) |
Sets the magnitude of the feature response at position (x, y)
x | the x coordinate |
y | the y coordinate |
myMagnitude | the magnitude to set for position (x,y) |
Referenced by stira::steerable::ComputeOrientation::ComputeDominantOrientationInputComplexPyramidLevel(), stira::steerable::ComputeOrientation::ComputeDominantOrientationInputFreemanAdelson(), stira::filter::NonSeparableFilter::DetermineLocalMagnitudeAndOrientation(), stira::imageanalysis::HOG::HOG(), stira::imageanalysis::StegerLineDetector::Run(), and ~OrientationGrid().
void stira::imagedata::OrientationGrid::SetOrientation | ( | int | x, |
int | y, | ||
LocalOrientation * | pLocalOrientation | ||
) |
Sets the local orientation (angle,magnitude) at specified position of the grid.
x | the x coordinate |
y | the y coordinate |
myLocalOrientation | the 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
threshold | threshold value for magnitude (below this, we just put black instead of coded orientation) |
myMode | color mapping scheme to use |
References stira::imagedata::ColorValue::c, stira::imagedata::Image::GetBands(), and stira::imagedata::Image::SetImageName().