[r36628]: trunk / contrib / brl / bbas / vsph / vsph_segment_sphere.h  Maximize  Restore  History

Download this file

54 lines (48 with data), 1.7 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef vsph_segment_sphere_h_
#define vsph_segment_sphere_h_
#include "vsph_unit_sphere.h"
//:
// \file
#include <vcl_map.h>
#include <vbl/vbl_disjoint_sets.h>
class vsph_segment_sphere
{
public:
vsph_segment_sphere(vsph_unit_sphere const& usph, double c, int min_size,double sigma, bool dosmoothing ) : seg_valid_(false),usph_(usph),sigma_(sigma), c_(c), min_size_(min_size), num_ccs_(0),dosmoothing_(dosmoothing){}
// === accessors ==-
double sigma() const {return sigma_;}
double c() const {return c_;}
int min_size() const {return min_size_;}
int num_ccs() const {return num_ccs_;}
const vcl_map<int, vcl_vector<int> >& regions() const {return regions_;}
// === process methods ===
void set_data(vcl_vector<double> data){data_ = data;}
void segment();
bool extract_region_bounding_boxes();
const vcl_map<int, vsph_sph_box_2d>& region_boxes() const {return bboxes_;}
vcl_vector<double> region_data() const;
vcl_vector<vcl_vector<float> > region_color() const;
//: function to compute mean of the pixels in a region using the oringal values of the spherical segment
double region_mean(int id);
//: function to compute median of the pixels in a region using the oringal values of the spherical segment
double region_median(int id);
private:
void smooth_data();
bool seg_valid_;
vsph_unit_sphere usph_;
double sigma_;
double c_;
int min_size_;
bool dosmoothing_;
//: spherical "image" data
vcl_vector<double> data_;
vcl_vector<double> smooth_data_;
int num_ccs_;
//: segmented regions
vbl_disjoint_sets ds_;
//: region id sph vert ids
vcl_map<int, vcl_vector<int> > regions_;
//: region id box
vcl_map<int, vsph_sph_box_2d> bboxes_;
};
#endif

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks