largest.cpp File Reference

#include <vector>
#include <xmmintrin.h>
#include "largest.h"
Include dependency graph for largest.cpp:

Go to the source code of this file.

Classes

struct  Cluster
 Cluster class. More...

Functions

int FindConnectedComponents (std::vector< short > &equivTable, int maxClusters, Image< unsigned char > &limg, Image< short > &comp, int label)
 Find connected components.
void KeepLargestSegment (Image< unsigned char > &segment, int fromLabel, int toLabel, int minArea)
 Keep the largest segment.
void Relabel (Image< short > &comp, std::vector< short > &equivTable, int numClusters, std::vector< Cluster > &clusters)
 Relabel all clusters and fill their attributes.

Detailed Description

Implementations of utility functions to clean segment

Definition in file largest.cpp.


Function Documentation

int FindConnectedComponents ( std::vector< short > &  equivTable,
int  maxClusters,
Image< unsigned char > &  limg,
Image< short > &  comp,
int  label 
)

Find connected components.

Find connected components in segmentation which is later used to keep the largest component

Parameters:
equivTable Equivalence table for different clusters
maxClusters Maximum Number of Clusters
limg Segmentation mask to be clustered
comp Result image with components
label The label of the segmentation mask
Returns:
Number of Connected Components

Definition at line 61 of file largest.cpp.

void KeepLargestSegment ( Image< unsigned char > &  segment,
int  fromLabel,
int  toLabel,
int  minArea = 0 
)

Keep the largest segment.

Keep the largest component of the segmentation

Parameters:
segment Image with segment
fromLabel The label of the segment to clean
toLabel The label to which all non large labels are set
minArea Minimum area of components

Definition at line 278 of file largest.cpp.

void Relabel ( Image< short > &  comp,
std::vector< short > &  equivTable,
int  numClusters,
std::vector< Cluster > &  clusters 
)

Relabel all clusters and fill their attributes.

Fill the area and bounding box attributes of the clusters

Parameters:
comp Connected component image
equivTable Equivalence table
numClusters Number of connected components
clusters Vector with cluster objects

Definition at line 204 of file largest.cpp.

 All Classes Files Functions Variables Typedefs Friends Defines


active_realtime_segmentation
Author(s): Marten Bjorkman. Maintained by Jeannette Bohg
autogenerated on Fri Jan 11 09:51:13 2013