Go to the documentation of this file.00001
00002 #ifndef vtol_intensity_face_h_
00003 #define vtol_intensity_face_h_
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #include <vnl/vnl_matrix.h>
00042 #include <vdgl/vdgl_digital_region.h>
00043 #include <vtol/vtol_topology_object.h>
00044 #include <vtol/vtol_face_2d.h>
00045 #include <vtol/vtol_intensity_face_sptr.h>
00046
00047 class vtol_intensity_face : public vtol_face_2d
00048 {
00049 protected:
00050
00051 vdgl_digital_region* region_;
00052 public:
00053
00054
00055 vtol_intensity_face(vtol_face_2d_sptr const& face);
00056 #if 0
00057
00058
00059
00060 vtol_intensity_face(vcl_vector<vtol_edge_sptr>* edges) : Face(edges) {}
00061
00062 vtol_intensity_face(vcl_vector<vtol_edge_sptr>* edges, vdgl_digital_region& dr)
00063 : vtol_face_2d(edges), vdgl_digital_region(dr.Npix(), dr.Xj(), dr.Yj(), dr.Ij()) {}
00064 #endif
00065 vtol_intensity_face(vcl_vector<vtol_edge_sptr>* edges);
00066 vtol_intensity_face(one_chain_list & one_chains);
00067 vtol_intensity_face(vcl_vector<vtol_one_chain_sptr>* chains, vdgl_digital_region const& dr);
00068 vtol_intensity_face(vtol_intensity_face_sptr const& iface);
00069 vtol_intensity_face(vtol_face_2d_sptr const& face, int npts, float const* xp, float const* yp,
00070 unsigned short const* pix);
00071 ~vtol_intensity_face();
00072
00073
00074
00075
00076
00077 virtual vsol_spatial_object_2d* clone() const;
00078
00079
00080 virtual vcl_string is_a() const { return vcl_string("vtol_intensity_face"); }
00081
00082
00083 virtual bool is_class(const vcl_string& cls) const
00084 { return cls==is_a() || vtol_face_2d::is_class(cls); }
00085
00086 private:
00087 inline vtol_topology_object::vtol_topology_object_type
00088 GetTopologyType() const { return vtol_topology_object::INTENSITYFACE; }
00089
00090
00091
00092 virtual vtol_topology_object::vtol_topology_object_type
00093 topology_type() const { return GetTopologyType(); }
00094
00095 public:
00096
00097
00098
00099
00100
00101
00102
00103 virtual const vtol_intensity_face* cast_to_intensity_face() const { return this; }
00104
00105
00106
00107
00108 virtual vtol_intensity_face* cast_to_intensity_face() { return this; }
00109
00110 virtual vdgl_digital_region* cast_to_digital_region() const {return region_;}
00111 virtual vdgl_digital_region* cast_to_digital_region() {return region_;}
00112 double area() const { return region_->area(); }
00113 void ResetPixelData() { region_->ResetPixelData(); }
00114 void IncrementMeans(float x, float y, unsigned short pix){region_->IncrementMeans(x,y,pix);}
00115 void ComputeIntensityStdev(){region_->ComputeIntensityStdev();}
00116 void InitPixelArrays() { region_->InitPixelArrays(); }
00117 void InsertInPixelArrays(float x, float y, unsigned short pix){region_->InsertInPixelArrays(x,y,pix);}
00118
00119 float const* Xj() const { return region_->Xj(); }
00120 float const* Yj() const { return region_->Yj(); }
00121
00122 float const* Zj() const { return 0; }
00123 unsigned short const* Ij() const { return region_->Ij(); }
00124
00125 int Npix()const {return region_->Npix(); }
00126 float X() const { return region_->X(); }
00127 float Y() const { return region_->Y(); }
00128
00129 float Z() const { return 0.f; }
00130 unsigned short I() const {return region_->I();}
00131
00132 void set_X(float x){region_->set_X(x); }
00133 void set_Y(float y){region_->set_Y(y); }
00134 void set_I(unsigned short I){region_->set_I(I);}
00135
00136 void reset() const {region_->reset();}
00137 bool next() const {return region_->next();}
00138 float Xo()const { return region_->Xo(); }
00139 float Yo()const { return region_->Yo(); }
00140
00141 float Zo()const { return 0.f; }
00142 float Io()const { return region_->Io(); }
00143 float Io_sd()const { return region_->Io_sd(); }
00144 double X2()const { return region_->X2(); }
00145 double Y2()const { return region_->Y2(); }
00146 double XY()const { return region_->XY(); }
00147 double I2()const { return region_->I2(); }
00148 double XI()const { return region_->XI(); }
00149 double YI()const { return region_->YI(); }
00150 double Ix() const { return region_->Ix(); }
00151 double Iy() const { return region_->Iy(); }
00152 float Ir() const { return region_->Ir(); }
00153 float Diameter() const { return region_->Diameter(); }
00154 float AspectRatio() const { return region_->AspectRatio(); }
00155 #if 0
00156 void PrincipalOrientation(vcl_vector<float>& axis) { region_->PrincipalOrientation(axis); }
00157 #endif
00158 double Var() const { return region_->Var(); }
00159
00160
00161
00162 float get_min() const { return region_->get_min(); }
00163 float get_max() const { return region_->get_max(); }
00164
00165
00166
00167 virtual vnl_matrix<double> MomentMatrix();
00168
00169
00170
00171
00172
00173 double perimeter();
00174 };
00175
00176 #endif // vtol_intensity_face_h_