mtt_clustering.h
Go to the documentation of this file.
1 /**************************************************************************************************
2  Software License Agreement (BSD License)
3 
4  Copyright (c) 2011-2013, LAR toolkit developers - University of Aveiro - http://lars.mec.ua.pt
5  All rights reserved.
6 
7  Redistribution and use in source and binary forms, with or without modification, are permitted
8  provided that the following conditions are met:
9 
10  *Redistributions of source code must retain the above copyright notice, this list of
11  conditions and the following disclaimer.
12  *Redistributions in binary form must reproduce the above copyright notice, this list of
13  conditions and the following disclaimer in the documentation and/or other materials provided
14  with the distribution.
15  *Neither the name of the University of Aveiro nor the names of its contributors may be used to
16  endorse or promote products derived from this software without specific prior written permission.
17 
18  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
19  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
21  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
24  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 ***************************************************************************************************/
31 #ifndef _MTT_CLUSTERING_H_
32 #define _MTT_CLUSTERING_H_
33 
34 #include "mtt.h"
35 
36 void FlagCollisionWithOcclusion(t_cluster**clusters,int object_size,t_data*data,t_config*config);
37 
45 double dietmayer_threshold(double r,t_config*config);
46 double ClusteringThreshold(double r1,double t1,double r2,double t2,t_config*config);
47 
57 t_cluster**clustering(t_data*data,int*count,t_config*config,t_flag*flags);
58 
59 bool clustering(t_data&data,vector<t_clustersPtr> &clustersPtr,t_config*config,t_flag*flags);
60 
69 void remove_border_points(t_cluster**clusters,int size,int npoints);
70 
79 void remove_small_clusters(t_cluster**clusters,int*size,int threshold);
80 
90 void calc_cluster_props(t_cluster**clusters,int size,t_data*data,t_config*config);
91 
101 bool clusters2objects(vector<t_objectPtr> &objectsPtr,vector<t_clustersPtr> &clusters,t_data& data,t_config& config);
102 
109 void calc_object_props(vector<t_objectPtr> &objects);
110 
111 void calc_cluster_props(vector<t_clustersPtr> &clusters,t_data&data);
112 
119 void clean_objets(vector<t_objectPtr> &objects);
120 
121 
130 void recursive_line_fitting(t_objectPtr& object,t_cluster& cluster,t_data& data,t_config& config);
131 
138 void free_lines(vector<t_objectPtr> &objects);
139 
150 void recursive_IEPF(t_objectPtr& object,t_data& data,int start,int end,t_config& config);
151 
152 extern double point2point_distance(double xi,double yi,double xf,double yf);
153 extern double point2line_distance(double alpha,double ro,double x,double y);
154 extern int real2print(double x,t_config*config);
155 extern void _p(const char*text);
156 #endif
void recursive_IEPF(t_objectPtr &object, t_data &data, int start, int end, t_config &config)
Recursive iterative end point fit. Single step.
void clean_objets(vector< t_objectPtr > &objects)
Frees memory associated with objects.
double ClusteringThreshold(double r1, double t1, double r2, double t2, t_config *config)
void free_lines(vector< t_objectPtr > &objects)
Removes lines from memory.
double point2point_distance(double xi, double yi, double xf, double yf)
Calculates the distante between two points.
int real2print(double x, t_config *config)
double dietmayer_threshold(double r, t_config *config)
Computes dietmayer clustering threshold.
void recursive_line_fitting(t_objectPtr &object, t_cluster &cluster, t_data &data, t_config &config)
Recursive line fitting, complete process.
void calc_cluster_props(t_cluster **clusters, int size, t_data *data, t_config *config)
Calculates cluster properties.
boost::shared_ptr< t_object > t_objectPtr
Definition: mtt_common.h:240
Global include file that combines all local include files for the mtt algorithm.
void remove_small_clusters(t_cluster **clusters, int *size, int threshold)
Removes clusters based on their size.
Cluster type class, clusters are groups of points in close proximity.
void _p(const char *text)
This structure has all points coordinates.
Definition: mtt_common.h:115
t_cluster ** clustering(t_data *data, int *count, t_config *config, t_flag *flags)
Performs clustering operation.
bool clusters2objects(vector< t_objectPtr > &objectsPtr, vector< t_clustersPtr > &clusters, t_data &data, t_config &config)
Converts clusters of points into objects using recursive line fitting.
This structure contains global configurations parameters.
Definition: mtt_common.h:137
void calc_object_props(vector< t_objectPtr > &objects)
Computes object properties, such as centroid and size.
This structure contains global flags parameters.
Definition: mtt_common.h:369
void FlagCollisionWithOcclusion(t_cluster **clusters, int object_size, t_data *data, t_config *config)
double point2line_distance(double alpha, double ro, double x, double y)
Calculates the line to point distance.
void remove_border_points(t_cluster **clusters, int size, int npoints)
Removes cluster border points.


mtt
Author(s): Jorge Almeida
autogenerated on Mon Mar 2 2015 01:32:18