8#include "cvb/point_cloud_factory.hpp"
9#include "cvb/point_cloud.hpp"
10#include "cvb/calibrator_3d.hpp"
12Cvb::Plane3D CutAqs12RoofAndCalculateNormal(
const Cvb::PointCloud& cloud,
double zRangeRoof,
double xRangeRoofPlane,
double yRangeRoofPlane);
18 auto path = Cvb::InstallPath();
22 auto calibrator = Cvb::Calibrator3D::Load<Cvb::Calibrator3D>(path + CVB_LIT(
"tutorial/Metric/Images/SICalibration.json"));
23 calibrator->SetRangeMapIgnoreValue(0.0);
29 auto plane = CutAqs12RoofAndCalculateNormal(*cloudAqs12, 10.0, 50.0, 1000.0);
40Cvb::Plane3D CutAqs12RoofAndCalculateNormal(
const Cvb::PointCloud &cloud,
double zRangeRoof,
double xRangeRoofPlane,
double yRangeRoofPlane)
42 auto dx = xRangeRoofPlane / 2;
43 auto dy = yRangeRoofPlane / 2;
47 bbRoof.
SetZRange({ bbRoof.ZRange().
Max() - zRangeRoof, bbRoof.ZRange().
Max() + 1 });
52 auto bbRoofPlane = roof->CalculateBoundingBox();
53 bbRoofPlane.SetXRange({ cog.X() - dx, cog.X() + dx });
54 bbRoofPlane.SetYRange({ cog.Y() - dy, cog.Y() + dy });
55 auto roofPlane = roof->Crop(bbRoofPlane);
58 return roof->FitPlane();
Angle Max(Angle a, Angle b) noexcept
Returns the bigger of two angles.
Definition: angle.hpp:504
void SetZRange(ValueRange< double > zRange) noexcept
Set the range regarding the z-axis.
Definition: cuboid.hpp:101
A dense Cartesian 3D point cloud object.
Definition: decl_dense_point_cloud.hpp:31
static std::unique_ptr< Image > Load(const String &fileName)
Loads an image with the given file name.
Definition: detail_image.hpp:32
A plane in 3D space in Hessian normal form.
Definition: plane_3d.hpp:19
static PointCloudPtr Create(const ImagePlane &rangeMap, const Calibrator3D &calibrator, PointCloudFlags flags)
Creates a new Cartesian 3D point cloud from the given 2.5D range map image.
Definition: point_cloud_factory.hpp:87
A point cloud object.
Definition: decl_point_cloud.hpp:49
std::shared_ptr< T > Crop(const Cuboid &clipBox) const
Creates a new point cloud which only consists of the points inside the clip box.
Definition: decl_point_cloud.hpp:301
Cuboid CalculateBoundingBox() const
Calculates the minimum and maximum extent of the point cloud.
Definition: decl_point_cloud.hpp:224
Point3D< double > CalculateCenterOfGravity() const
Calculates the center of gravity of the point cloud.
Definition: decl_point_cloud.hpp:239