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

# MSH2004EdgeDetection Class Reference

Utility-class for edge-detection. More...

`#include <MSH2004EdgeDetection.h>`

Collaboration diagram for MSH2004EdgeDetection:

[legend]
List of all members.

## Public Member Functions
| MSH2004EdgeDetection (RasterImageProcessor &processor)
| Default constructor.
| ~MSH2004EdgeDetection ()
bool | scanEast (int &x, int &y)
bool | scanWest (int &x, int &y)
bool | scanNorth (int &x, int &y)
bool | scanSouth (int &x, int &y)
bool | ballScanEast (int &x, int &y)
bool | ballScanWest (int &x, int &y)
bool | scan (int &x, int &y, Vector2< double > direction)
| Follows the given direction, and determines edges by the sum of all three channels.
bool | bufferedScan (int &x, int &y, Vector2< double > direction)
| Follows the given direction, and determines edges by the sum of all three channels.
bool | bufferedScan (int &x, int &y)
| Follows the last given direction.
bool | scanField (int &x, int &y, Vector2< double > direction)
| Follows the given direction,and searches for field-edge-points.
bool | scanField (int &x, int &y)
| Follows the last given direction,and searches for field-edge-points.
bool | scan (int &x, int &y)
| Follows the last given direction, and determines edges by the sum of all three channels.
bool | colorScan (int &x, int &y, Vector2< double > direction, colorClass &lastColor)
bool | colorScan (int &x, int &y, colorClass &lastColor)
bool | susanScan (int &x, int &y, Vector2< double > direction)
bool | scan (int &x, int &y, int x1, int y1)
bool | colorScan (int &x, int &y, int x1, int y1, colorClass &lastColor)
void | setDirection (Vector2< double > dir)
colorClass | getColor (int index)
int | getRange (int index)
bool | isHorizontalEdge (int x, int y)
int | horizontalEdgeVote (int x, int y)
bool | isVerticalEdge (int x, int y)
int | verticalEdgeVote (int x, int y)
int | ballEdgeVote (int x, int y)
int | crossEdgeVote (int x, int y)
int | fieldEdgeVote (int x, int y)
colorClass | getColor (int x, int y)
void | skip (int &x, int &y)
| Gives the next pixel of last scan.
bool | findStart (Vector2< int > &start, const Vector2< double > &dir)
int | getBufferSize ()
## Public Attributes
int | threshold
int | tempX
int | tempY
## Private Member Functions
int | fastCrossEdgeVote (int x, int y)
void | addColor ()
bool | insideImage (int x, int y)
int | susanVote (int x, int y)
## Private Attributes
RasterImageProcessor & | ip
SUSANEdgeDetectionLite & | susanDetector
Vector2< double > | direction
int | e
int | f
int | g
int | dx
int | dy
int | cx
int | cy
int | bufferSize
colorClass | currentColor
colorClass | lastColor
int | colorRange
colorClass | colorBuffer [20]
| This buffer is used to store the colors passed by a buffered scan-method during the last scan.
int | ranges [20]
| This buffer is used to store the ranges of the colors.

## Detailed Description

Utility-class for edge-detection.

Definition at line 20 of file MSH2004EdgeDetection.h.

## Constructor & Destructor Documentation

MSH2004EdgeDetection::MSH2004EdgeDetection | ( | RasterImageProcessor & | processor | ) |

| Default constructor. Definition at line 15 of file MSH2004EdgeDetection.cpp. References DEFAULT_EDGE_THRESHOLD.

MSH2004EdgeDetection::~MSH2004EdgeDetection | ( |  | ) |

| Definition at line 23 of file MSH2004EdgeDetection.cpp.

## Member Function Documentation

bool MSH2004EdgeDetection::scanEast | ( | int & | x,
|  | int & | y
| ) |

| Definition at line 27 of file MSH2004EdgeDetection.cpp. References fastCrossEdgeVote(), and insideImage(). Referenced by DoubleScanLinesNumber().

Here is the call graph for this function:

bool MSH2004EdgeDetection::scanWest | ( | int & | x,
|  | int & | y
| ) |

| Definition at line 52 of file MSH2004EdgeDetection.cpp. References fastCrossEdgeVote(), and insideImage(). Referenced by DoubleScanLinesNumber().

Here is the call graph for this function:

bool MSH2004EdgeDetection::scanNorth | ( | int & | x,
|  | int & | y
| ) |

| Definition at line 76 of file MSH2004EdgeDetection.cpp. References fastCrossEdgeVote(), and insideImage().

Here is the call graph for this function:

bool MSH2004EdgeDetection::scanSouth | ( | int & | x,
|  | int & | y
| ) |

| Definition at line 100 of file MSH2004EdgeDetection.cpp. References fastCrossEdgeVote(), and insideImage().

Here is the call graph for this function:

bool MSH2004EdgeDetection::ballScanEast | ( | int & | x,
|  | int & | y
| ) |

| Definition at line 125 of file MSH2004EdgeDetection.cpp. References ballEdgeVote().

Here is the call graph for this function:

bool MSH2004EdgeDetection::ballScanWest | ( | int & | x,
|  | int & | y
| ) |

| Definition at line 148 of file MSH2004EdgeDetection.cpp. References ballEdgeVote().

Here is the call graph for this function:

bool MSH2004EdgeDetection::scan | ( | int & | x,
|  | int & | y,
|  | Vector2< double > | direction
| ) |

  | Follows the given direction, and determines edges by the sum of all three channels. The position of the edge is stored in x and y. Parameters:
  x | The starting x-value.
  y | The starting y-value.
  direction | The direction to follow.
Returns: edge was found Definition at line 171 of file MSH2004EdgeDetection.cpp. References crossEdgeVote(), e, Vector2< double >::x, and Vector2< double >::y.

Here is the call graph for this function:

bool MSH2004EdgeDetection::bufferedScan | ( | int & | x,
|  | int & | y,
|  | Vector2< double > | direction
| ) |

  | Follows the given direction, and determines edges by the sum of all three channels. The position of the edge is stored in x and y. Fills the colorBuffer while scanning, so the client can determine with the colorBuffer-Array what kind of object was found. Parameters:
  x | The starting x-value.
  y | The starting y-value.
  direction | The direction to follow.
Returns: edge was found Definition at line 265 of file MSH2004EdgeDetection.cpp. References addColor(), crossEdgeVote(), e, getColor(), Vector2< double >::x, and Vector2< double >::y.

Here is the call graph for this function:

bool MSH2004EdgeDetection::bufferedScan | ( | int & | x,
|  | int & | y
| ) |

| Follows the last given direction. Skips 3 pixels at the beginning of each scan, while filling the buffer. Definition at line 393 of file MSH2004EdgeDetection.cpp. References addColor(), crossEdgeVote(), e, getColor(), and skip().

Here is the call graph for this function:

bool MSH2004EdgeDetection::scanField | ( | int & | x,
|  | int & | y,
|  | Vector2< double > | direction
| ) |

  | Follows the given direction,and searches for field-edge-points. Determines edges by the sum of the first two channels. The position of the edge is stored in x and y. Parameters:
  x | The starting x-value.
  y | The starting y-value.
  direction | The direction to follow.
Returns: edge was found Definition at line 509 of file MSH2004EdgeDetection.cpp. References e, fieldEdgeVote(), Vector2< double >::x, and Vector2< double >::y.

Here is the call graph for this function:

bool MSH2004EdgeDetection::scanField | ( | int & | x,
|  | int & | y
| ) |

  | Follows the last given direction,and searches for field-edge-points. Determines edges by the sum of the first two channels. The position of the edge is stored in x and y. Parameters:
  x | The starting x-value.
  y | The starting y-value.
Returns: edge was found Definition at line 603 of file MSH2004EdgeDetection.cpp. References e, and fieldEdgeVote().

Here is the call graph for this function:

bool MSH2004EdgeDetection::scan | ( | int & | x,
|  | int & | y
| ) |

| Follows the last given direction, and determines edges by the sum of all three channels. Definition at line 1047 of file MSH2004EdgeDetection.cpp. References crossEdgeVote(), and e.

Here is the call graph for this function:

bool MSH2004EdgeDetection::colorScan | ( | int & | x,
|  | int & | y,
|  | Vector2< double > | direction,
|  | colorClass & | lastColor
| ) |

| Definition at line 838 of file MSH2004EdgeDetection.cpp. References e, getColor(), noColor, Vector2< double >::x, and Vector2< double >::y.

Here is the call graph for this function:

bool MSH2004EdgeDetection::colorScan | ( | int & | x,
|  | int & | y,
|  | colorClass & | lastColor
| ) |

| Definition at line 906 of file MSH2004EdgeDetection.cpp. References e, getColor(), and noColor.

Here is the call graph for this function:

bool MSH2004EdgeDetection::susanScan | ( | int & | x,
|  | int & | y,
|  | Vector2< double > | direction
| ) |

| Definition at line 953 of file MSH2004EdgeDetection.cpp. References e, susanVote(), Vector2< double >::x, and Vector2< double >::y.

Here is the call graph for this function:

bool MSH2004EdgeDetection::scan | ( | int & | x,
|  | int & | y,
|  | int | x1,
|  | int | y1
| ) |

| Definition at line 676 of file MSH2004EdgeDetection.cpp. References crossEdgeVote(), e, and fastCrossEdgeVote().

Here is the call graph for this function:

bool MSH2004EdgeDetection::colorScan | ( | int & | x,
|  | int & | y,
|  | int | x1,
|  | int | y1,
|  | colorClass & | lastColor
| ) |

| Definition at line 769 of file MSH2004EdgeDetection.cpp. References e, getColor(), and noColor.

Here is the call graph for this function:

void MSH2004EdgeDetection::setDirection | ( | Vector2< double > | dir | ) | `[inline]`

| Definition at line 108 of file MSH2004EdgeDetection.h. References e, Vector2< V >::x, and Vector2< V >::y.

colorClass MSH2004EdgeDetection::getColor | ( | int | index | ) | `[inline]`

| Definition at line 126 of file MSH2004EdgeDetection.h. Referenced by bufferedScan(), and colorScan().

int MSH2004EdgeDetection::getRange | ( | int | index | ) | `[inline]`

| Definition at line 130 of file MSH2004EdgeDetection.h.

bool MSH2004EdgeDetection::isHorizontalEdge | ( | int | x,
|  | int | y
| ) | `[inline]`

| Definition at line 134 of file MSH2004EdgeDetection.h. References horizontalEdgeVote().

Here is the call graph for this function:

int MSH2004EdgeDetection::horizontalEdgeVote | ( | int | x,
|  | int | y
| ) | `[inline]`

| Definition at line 138 of file MSH2004EdgeDetection.h. Referenced by isHorizontalEdge().

bool MSH2004EdgeDetection::isVerticalEdge | ( | int | x,
|  | int | y
| ) | `[inline]`

| Definition at line 152 of file MSH2004EdgeDetection.h. References verticalEdgeVote().

Here is the call graph for this function:

int MSH2004EdgeDetection::verticalEdgeVote | ( | int | x,
|  | int | y
| ) | `[inline]`

| Definition at line 156 of file MSH2004EdgeDetection.h. Referenced by isVerticalEdge().

int MSH2004EdgeDetection::ballEdgeVote | ( | int | x,
|  | int | y
| ) | `[inline]`

| Definition at line 170 of file MSH2004EdgeDetection.h. Referenced by ballScanEast(), and ballScanWest().

int MSH2004EdgeDetection::crossEdgeVote | ( | int | x,
|  | int | y
| ) | `[inline]`

| Definition at line 201 of file MSH2004EdgeDetection.h. Referenced by bufferedScan(), and scan().

int MSH2004EdgeDetection::fieldEdgeVote | ( | int | x,
|  | int | y
| ) | `[inline]`

| Definition at line 230 of file MSH2004EdgeDetection.h. Referenced by scanField().

colorClass MSH2004EdgeDetection::getColor | ( | int | x,
|  | int | y
| ) | `[inline]`

| Definition at line 257 of file MSH2004EdgeDetection.h.

void MSH2004EdgeDetection::skip | ( | int & | x,
|  | int & | y
| ) | `[inline]`

| Gives the next pixel of last scan. This is only for the scans that use Bresenham's algorithm. Definition at line 271 of file MSH2004EdgeDetection.h. References e. Referenced by bufferedScan().

bool MSH2004EdgeDetection::findStart | ( | Vector2< int > & | start,
|  | const Vector2< double > & | dir
| ) | `[inline]`

| Definition at line 294 of file MSH2004EdgeDetection.h. References Geometry::clipLineWithRectangleCohenSutherland(), Vector2< V >::x, and Vector2< V >::y.

Here is the call graph for this function:

int MSH2004EdgeDetection::getBufferSize | ( |  | ) | `[inline]`

| Definition at line 308 of file MSH2004EdgeDetection.h.

int MSH2004EdgeDetection::fastCrossEdgeVote | ( | int | x,
|  | int | y
| ) | `[inline, private]`

| Definition at line 363 of file MSH2004EdgeDetection.h. Referenced by scan(), scanEast(), scanNorth(), scanSouth(), and scanWest().

void MSH2004EdgeDetection::addColor | ( |  | ) | `[inline, private]`

| Definition at line 391 of file MSH2004EdgeDetection.h. Referenced by bufferedScan().

bool MSH2004EdgeDetection::insideImage | ( | int | x,
|  | int | y
| ) | `[inline, private]`

| Definition at line 403 of file MSH2004EdgeDetection.h. Referenced by scanEast(), scanNorth(), scanSouth(), and scanWest().

int MSH2004EdgeDetection::susanVote | ( | int | x,
|  | int | y
| ) | `[inline, private]`

| Definition at line 409 of file MSH2004EdgeDetection.h. References SUSANEdgeDetectionLite::isEdgePoint(). Referenced by susanScan().

Here is the call graph for this function:

## Member Data Documentation

int MSH2004EdgeDetection::threshold

| Definition at line 33 of file MSH2004EdgeDetection.h. Referenced by DoubleScanLinesNumber().

int MSH2004EdgeDetection::tempX

| Definition at line 35 of file MSH2004EdgeDetection.h.

int MSH2004EdgeDetection::tempY

| Definition at line 37 of file MSH2004EdgeDetection.h.

RasterImageProcessor& MSH2004EdgeDetection::ip`[private]`

| Definition at line 328 of file MSH2004EdgeDetection.h.

SUSANEdgeDetectionLite& MSH2004EdgeDetection::susanDetector`[private]`

| Definition at line 330 of file MSH2004EdgeDetection.h.

Vector2<double> MSH2004EdgeDetection::direction`[private]`

| Definition at line 331 of file MSH2004EdgeDetection.h.

int MSH2004EdgeDetection::e`[private]`

| Definition at line 333 of file MSH2004EdgeDetection.h. Referenced by bufferedScan(), colorScan(), scan(), scanField(), setDirection(), skip(), and susanScan().

int MSH2004EdgeDetection::f`[private]`

| Definition at line 335 of file MSH2004EdgeDetection.h.

int MSH2004EdgeDetection::g`[private]`

| Definition at line 337 of file MSH2004EdgeDetection.h.

int MSH2004EdgeDetection::dx`[private]`

| Definition at line 339 of file MSH2004EdgeDetection.h.

int MSH2004EdgeDetection::dy`[private]`

| Definition at line 341 of file MSH2004EdgeDetection.h.

int MSH2004EdgeDetection::cx`[private]`

| Definition at line 343 of file MSH2004EdgeDetection.h.

int MSH2004EdgeDetection::cy`[private]`

| Definition at line 345 of file MSH2004EdgeDetection.h.

int MSH2004EdgeDetection::bufferSize`[private]`

| Definition at line 347 of file MSH2004EdgeDetection.h.

colorClass MSH2004EdgeDetection::currentColor`[private]`

| Definition at line 349 of file MSH2004EdgeDetection.h.

colorClass MSH2004EdgeDetection::lastColor`[private]`

| Definition at line 351 of file MSH2004EdgeDetection.h.

int MSH2004EdgeDetection::colorRange`[private]`

| Definition at line 353 of file MSH2004EdgeDetection.h.

colorClass MSH2004EdgeDetection::colorBuffer[20]`[private]`

| This buffer is used to store the colors passed by a buffered scan-method during the last scan. Definition at line 358 of file MSH2004EdgeDetection.h.

int MSH2004EdgeDetection::ranges[20]`[private]`

| This buffer is used to store the ranges of the colors. Definition at line 361 of file MSH2004EdgeDetection.h.

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

- Modules/ImageProcessor/ImageProcessorTools/MSH2004EdgeDetection.h
- Modules/ImageProcessor/ImageProcessorTools/MSH2004EdgeDetection.cpp