Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

prapi::binary::Component Class Reference

#include <Component.h>

List of all members.


Detailed Description

The Component class stores information about connected (binary) components.

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.


Member Function Documentation

Component prapi::binary::Component::getComponent const util::Matrix< int > &    labels,
int    index
[static]
 

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.

Parameters:
labels  an image with connected component labels.
index  the index of the component to be retrieved.
Returns:
component parameters

List< Component > prapi::binary::Component::getComponents const util::Matrix< int > &    labels [static]
 

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.

Parameters:
labels  an image with connected component labels.
Returns:
the parameters of all connected components

bool prapi::binary::Component::operator== const Component &    other const [inline]
 

Compare two components.

Two components compare the same if their masses match.


The documentation for this class was generated from the following files:
Documentation generated on 11.09.2003 with Doxygen.
The documentation is copyrighted material.
Copyright © Topi Mäenpää 2003. All rights reserved.