#include <Component.h>
It also contains static methods for extracting component information from labeled images.
Public Methods | |
| Component (double r=0, double c=0, int m=0, int index=0) | |
| Create a new component with the given center of mass row and column coordinates, mass, and label index. | |
| Component (const Component &other) | |
| The copy constructor. | |
| Component & | operator= (const Component &other) |
| Assignment operator. | |
| bool | operator== (const Component &other) const |
| Compare two components. | |
| bool | operator!= (const Component &other) const |
| Compare components according to their masses. | |
| bool | operator< (const Component &other) const |
| Compare components according to their masses. | |
| bool | operator> (const Component &other) const |
| Compare components according to their masses. | |
| bool | operator>= (const Component &other) const |
| Compare components according to their masses. | |
| bool | operator<= (const Component &other) const |
| Compare components according to their masses. | |
Static Public Methods | |
| Component | getComponent (const util::Matrix< int > &labels, int index) |
| Get the parameters of a connected component in a labeled image. | |
| util::List< Component > | getComponents (const util::Matrix< int > &labels) |
| Get the parameters of all connected components in a labeled image. | |
Public Attributes | |
| double | comR |
| The row coordinate of the center of mass of an object. | |
| double | comC |
| The column coordinate of the center of mass of an object. | |
| int | mass |
| The number of pixels in the connected component. | |
| int | labelIndex |
| The index of the component's label in a labeled image. | |
|
||||||||||||
|
Get the parameters of a connected component in a labeled image. The coordinates and mass of the object with the given label index are returned. If the label image does not contain such index, a component with zero mass is returned.
|
|
|
Get the parameters of all connected components in a labeled image. The first item in the returned list stores the parameters of the component labeled with one, the second one the parameters of the component labeled with two and so on, up to the maximum value in the image.
|
|
|
Compare two components. Two components compare the same if their masses match. |