|
latest version v1.9 - last update 24 Nov 2005 |
|
#include <ltiContour.h>
Public Types | |
| enum | direction { UNKNOWN = -2, NOMOVE = -1, E = 0, NE, N, NW, W, SW, S, SE } |
Public Member Functions | |
| chainCode (const direction &v=NOMOVE) | |
| chainCode (const int &v) | |
| chainCode (const chainCode &other) | |
| chainCode (const int &x, const int &y) | |
| chainCode (const point &here, const point &next) | |
| direction | getDirection () const |
| bool | isDirection () const |
| point | getNext (const point &here) const |
| point | getPrevious (const ipoint &here) const |
| int | deltaX () const |
| int | deltaY () const |
| point | delta () const |
| chainCode & | operator= (const direction &other) |
| chainCode & | copy (const direction &other) |
| chainCode & | copy (const chainCode &other) |
| chainCode & | operator= (const chainCode &other) |
| bool | compare (const chainCode &other) |
| bool | operator== (const chainCode &other) |
| bool | compare (const direction &other) |
| bool | operator== (const direction &other) |
| chainCode & | subtract (const chainCode &first, const chainCode &second) |
| chainCode | operator- (const chainCode &other) const |
| chainCode & | subtract (const chainCode &other) |
| chainCode & | operator-= (const chainCode &other) |
| chainCode & | add (const chainCode &first, const chainCode &second) |
| chainCode | operator+ (const chainCode &other) const |
| chainCode & | add (const chainCode &other) |
| chainCode & | operator+= (const chainCode &other) |
| chainCode & | divide (const int &other) |
| chainCode | operator/ (const int &other) |
| ubyte | getCanzlerCode (const chainCode &nextChainCode) const |
Static Public Attributes | |
Canzler Codes | |
Given two chain codes for a sequence of three adjacent pixels, the Canzler-Codes give you information which borders of the middle pixel belong to the boundary. With the getCanzlerCode you can obtain the corresponding coding for the pixel pointed by this chain code, if the next chain code is the one given. They are somehow similar to the so called "chain crack codes", but instead of specifying a direction of the boundary, they code which "crack codes" belong to the middle pixel between two chain codes.
There are 16 Canzler-Codes, that can be obtained by the combination of the four values Top, Right, Bottom and Left, which specify that the border runs on the top, right, bottom and/or left edge of the pixel respectively. | |
| static const ubyte | Nothing |
| static const ubyte | Top |
| static const ubyte | Right |
| static const ubyte | Bottom |
| static const ubyte | Left |
Protected Member Functions | |
| void | fromDeltas (const int &x, const int &y) |
Protected Attributes | |
| direction | value |
The used directions follows the next diagram:
The "int" value resulting from casting these chain codes is proportional to the angle with a proportionality constant of 45°, i.e. if 'c' is a chainCode object, then the equivalent direction in degrees is 45*int(c.getDirection()).
|
|
Directions used in chain codes The used directions follows the next diagram:.
The "int" value resulting from casting these chain codes is proportional to the angle with a proportionality constant of 45°, i.e. if 'c' is a chainCode object, then the equivalent direction in degrees is 45*int(c.getDirection()). |
|
|
default constructor
|
|
|
constructor to cast an integer
|
|
|
copy constructor
|
|
||||||||||||
|
Constrcutor. This constructor creates a chainCode object using the sign of the parameters to calculate the direction. Image-coordinates are used, i.e. a positive "y" implies a change towards "south", and a positive x implies a change towards "east". |
|
||||||||||||
|
Constructor.This constructor creates a chainCode object using two points.
|
|
|
add the angles of the other chain code to this chainCode and leave the result in this instance. Returns a reference to the instance |
|
||||||||||||
|
add the angles of the first and second chain codes
|
|
|
compare with another object
|
|
|
compare with another object
|
|
|
become other object
|
|
|
become other object
|
|
|
returns point with changes in both direction, x and y.
|
|
|
returns change in x. For example, if the value is NW, deltaX() returns -1. |
|
|
returns change in y. For example, if the value is NW, deltaY() returns -1. |
|
|
divide chain code equivalent angle with an integer. The result will be left in this instance and a reference to it will be returned |
|
||||||||||||
|
compute chain code from x and y deltas
|
|
|
return the Canzler Code for the pixel pointed by this chainCode if the second chainCode is the one given as parameter. The result a the bitwise OR of some of the codes Top, Bottom, Left and Right.
|
|
|
returns direction of this chain element
|
|
|
returns next point with start point "here" and using this chainCode.
|
|
|
returns previous point with start point "here" and using this chainCode.
|
|
|
Possible Direction.returns true if this object contains one of the eight posible directions, and false otherwise.
|
|
|
add the angles of this and the other chain code
|
|
|
add another chain code
|
|
|
subtract the angle equivalent of the other chainCode from *this
|
|
|
subtract another chain code
|
|
|
divide chain code angle with integer.
|
|
|
become other object
|
|
|
become other object
|
|
|
compare with another object
|
|
|
compare with another object
|
|
|
subtract the angle equivalent of the other chain code from this one. The result will be left in this instance, and a reference to it will be returned. |
|
||||||||||||
|
subtract the angles of the first and second chain code elements and leave the result here!
|
|
|
Right has value 2 (the second bit).
|
|
|
Bottom has value 4 (the third bit).
|
|
|
Top has value 1 (the first bit).
|
|
|
Nothing has the value 0.
|
|
|
Attribute containing the chain code.
|