#include <vector>
#include <xmmintrin.h>
#include "largest.h"
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. |
Implementations of utility functions to clean segment
Definition in file largest.cpp.
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
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 |
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
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
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.