Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(label_interesting_points[index].size() == 3)
- {
- auto it = label_interesting_points[index].begin();
- Plane p1 = planes[*it]; it++;
- Plane p2 = planes[*it]; it++;
- Plane p3 = planes[*it];
- cout << "p1 = " << p1._a << " " << p1._b << " " << p1._c << " " << p1._d << " " << endl;
- cout << "p2 = " << p2._a << " " << p2._b << " " << p2._c << " " << p2._d << " " << endl;
- cout << "p3 = " << p3._a << " " << p3._b << " " << p3._c << " " << p3._d << " " << endl;
- cout << "point = " << one_point->points[0] << endl;
- Eigen::Matrix3f A;
- Eigen::Vector3f b;
- A << p1._a, p1._b, p1._c, p2._a, p2._b, p2._c, p3._a, p3._b, p3._c;
- b << -p1._d, -p2._d, -p3._d;
- Vector3f x1 = A.colPivHouseholderQr().solve(b);
- one_point->points[0] = PointXYZ(x1[0], x1[1], x1[2]);
- iterate = 0;
- }
- else
- if(label_interesting_points[index].size() == 2)
- {
- auto it = label_interesting_points[index].begin();
- Plane p1 = planes[*it]; it++;
- Plane p2 = planes[*it]; it++;
- Eigen::Vector3f n1 = Vector3f(p1._a, p1._b, p1._c);
- Eigen::Vector3f n2 = Vector3f(p2._a, p2._b, p2._c);
- Eigen::Vector3f n3 = n1.cross(n2);
- Eigen::Vector3f v(one_point->points[0].x, one_point->points[0].y, one_point->points[0].z);
- double d = v.dot(n3);
- cout << "p1 = " << p1._a << " " << p1._b << " " << p1._c << " " << p1._d << " " << endl;
- cout << "p2 = " << p2._a << " " << p2._b << " " << p2._c << " " << p2._d << " " << endl;
- cout << "p3 = " << n3[0] << " " << n3[1] << " " << n3[2] << " " << -d << " " << endl;
- cout << "2point = " << one_point->points[0] << endl;
- Eigen::Matrix3f A;
- Eigen::Vector3f b;
- A << p1._a, p1._b, p1._c, p2._a, p2._b, p2._c, n3[0], n3[1], n3[2];
- b << -p1._d, -p2._d, d;
- Vector3f x1 = A.colPivHouseholderQr().solve(b);
- one_point->points[0] = PointXYZ(x1[0], x1[1], x1[2]);
- iterate = 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement