Go to the documentation of this file.
19 #include <QtCore/QtCore>
25 #define CIMat cimg_library::CImg<float>
26 #define CIMatL cimg_library::CImgList<float>
35 virtual float measure(
float ev1,
float ev2) = 0;
56 return (ev1 * ev1) + (ev2 * ev2);
69 return sqrt((ev1 * ev1) + (ev2 * ev2));
72 return "rootsumsquare";
82 return (ev1 + ev2) / 2;
159 return (ev1 * ev2 < 0 ? -1.0f : 1.0f) * (fabs(ev1) + fabs(ev2)) / 2.0f;
162 return "signedaverageabs";
182 else if(s ==
"average")
184 else if(s ==
"minimal")
186 else if(s ==
"maximal")
188 else if(s ==
"sumsquare")
190 else if(s ==
"rootsumsquare")
192 else if(s ==
"signedaverageabs")
194 else if(s ==
"anisotropy")
201 : W(copy.W), b1(copy.b1), b2(copy.b2), b3(copy.b3), ed1(copy.ed1), ed2(copy.ed2), ev1(copy.ev1), ev2(copy.ev2), cM(0)
204 cM = copy.cM->
copy();
213 void update(
const std::vector<Point3f>& pos,
const std::vector<Point3f>&
nrml)
217 if(
nrml.size() > 0 &&
nrml.size() == pos.size()) {
220 update_local_Basis(
nrml[0]);
223 int cnt = pos.size();
229 for(
int i = 1; i < cnt; i++) {
242 X(0,
id) = 0.5 * w1 * w1;
244 X(2,
id) = 0.5 * w2 * w2;
245 X(3,
id) = w1 * w1 * w1;
246 X(4,
id) = w1 * w1 * w2;
247 X(5,
id) = w1 * w2 * w2;
248 X(6,
id) = w2 * w2 * w2;
255 X(3,
id) = 3 * w1 * w1;
256 X(4,
id) = 2 * w1 * w2;
267 X(5,
id) = 2 * w1 * w2;
268 X(6,
id) = 3 * w2 * w2;
272 CIMat Xt =
X.get_transpose();
285 W(1, 0) = W(0, 1) = b[1];
289 CIMatL bL = W.get_symmetric_eigen();
292 ed1 = - bL(1)(0, 0) * b1 - bL(1)(0, 1) * b2;
293 ed2 = - bL(1)(1, 0) * b1 - bL(1)(1, 1) * b2;
349 b1 =
Point3f(cimg_library::cimg::rand(), cimg_library::cimg::rand(), cimg_library::cimg::rand());
351 }
while(fabs(b1 *
nrml) == 1);
376 CurvatureMeasure* cM;
float measure(float ev1, float ev2)
virtual CurvatureMeasure * copy()
virtual CurvatureMeasure * copy()
float measure(float ev1, float ev2)
virtual CurvatureMeasure * copy()
CU_HOST_DEVICE T norm() const
Euclidean norm of the vector.
virtual CurvatureMeasure * copy()
virtual CurvatureMeasure * copy()
float measure(float ev1, float ev2)
float measure(float ev1, float ev2)
void update(const std::vector< Point3f > &pos, const std::vector< Point3f > &nrml)
Distributed matrix library.
void swap(multiset_vector< Key, Compare, Allocator > &v1, multiset_vector< Key, Compare, Allocator > &v2)
T CU_HOST_DEVICE max(const T a, const T b)
Vector< 3, float > Point3f
virtual CurvatureMeasure * copy()
void set_Measure(CurvatureMeasure *_cM)
virtual CurvatureMeasure * copy()
CU_HOST_DEVICE Vector cross(const Vector &other) const
Compute the cross product as this x other.
virtual CurvatureMeasure * copy()
CU_HOST_DEVICE T det(const Matrix< 1, 1, T > &mat)
void get_eigenVectors(Point3f &evec1, Point3f &evec2)
virtual float measure(float ev1, float ev2)=0
void get_eigenValues(float &eval1, float &eval2)
virtual CurvatureMeasure * copy()
float measure(float ev1, float ev2)
virtual CurvatureMeasure * copy()=0
virtual CurvatureMeasure * copy()
Curvature(const Curvature ©)
float measure(float ev1, float ev2)
virtual ~CurvatureMeasure()
CU_HOST_DEVICE T min(const T a, const T b)
float measure(float ev1, float ev2)
float measure(float ev1, float ev2)
float measure(float ev1, float ev2)
virtual std::string get_type()=0
CU_HOST_DEVICE bool isNan(float s)
float measure(float ev1, float ev2)