/* * This file is part of robotreality * * Copyright(c) sschulz techfak.uni-bielefeld.de * http://opensource.cit-ec.de/projects/robotreality * * This file may be licensed under the terms of the * GNU General Public License Version 3 (the ``GPL''), * or (at your option) any later version. * * Software distributed under the License is distributed * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either * express or implied. See the GPL for the specific language * governing rights and limitations. * * You should have received a copy of the GPL along with this * program. If not, go to http://www.gnu.org/licenses/gpl.html * or write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * The development of this software was supported by the * Excellence Cluster EXC 277 Cognitive Interaction Technology. * The Excellence Cluster EXC 277 is a grant of the Deutsche * Forschungsgemeinschaft (DFG) in the context of the German * Excellence Initiative. * */ #ifndef FastBlob_H #define FastBlob_H #include #include // class Triplet; class FastBlob{ public: FastBlob(); ~FastBlob(); // int distance_to(FastBlob b); // int distance_to(Triplet t); // int get_radius(void); // void set_rect( int xs, int ys, int xe, int ye); void init(int x, int y); void include_pixel( int px, int py); double get_centeroid_x(); double get_centeroid_y(); int get_x(){ return x; } int get_y(){ return y; } int get_width(){ return width; } int get_height(){ return height; } int get_pixelcount(){ return pixelcount; } void move(double x, double y); void merge_with_blob(FastBlob b); int get_boundingboxsize(); // int get_searchradius_min(); // int get_searchradius_max(); // int is_valid_clustering_partner(FastBlob bl2); // int get_bbox_center_x(); // int get_bbox_center_y(); int runid; int id; // int correlation_id; int object_id; bool possible_candidate; // int search_radius_min; // int search_radius_max; double circle_quality(){ double length; length = get_width(); if (get_height() > length){ length = get_height(); } return (4.0 * get_height() * get_width()) / (3.14*length); } static bool compare_circle_quality(FastBlob a, FastBlob b){ return (a.circle_quality() > b.circle_quality()); } // long sum_x; // long sum_y; // long sum_count; private: void boundingbox_update(int px, int py); int width; int height; int sum_x; int sum_y; // int sum_count; int pixelcount; int x; int y; }; #endif