#include <iostream>
#include "cvb/point_cloud_factory.hpp"
#include "cvb/point_cloud.hpp"
#include "cvb/calibrator_3d.hpp"
Cvb::Plane3D CutAqs12RoofAndCalculateNormal(
const Cvb::PointCloud& cloud,
double zRangeRoof,
double xRangeRoofPlane,
double yRangeRoofPlane);
int main()
{
try
{
calibrator->SetRangeMapIgnoreValue(0.0);
Cvb::PointCloudFlags::Float | Cvb::PointCloudFlags::XYZ);
auto plane = CutAqs12RoofAndCalculateNormal(*cloudAqs12, 10.0, 50.0, 1000.0);
}
catch (const std::exception & error)
{
std::cout << error.what() << std::endl;
}
return 0;
}
Cvb::Plane3D CutAqs12RoofAndCalculateNormal(
const Cvb::PointCloud &cloud,
double zRangeRoof,
double xRangeRoofPlane,
double yRangeRoofPlane)
{
auto dx = xRangeRoofPlane / 2;
auto dy = yRangeRoofPlane / 2;
bbRoof.
SetZRange({ bbRoof.ZRange().Max() - zRangeRoof, bbRoof.ZRange().Max() + 1 });
auto bbRoofPlane = roof->CalculateBoundingBox();
bbRoofPlane.SetXRange({ cog.X() - dx, cog.X() + dx });
bbRoofPlane.SetYRange({ cog.Y() - dy, cog.Y() + dy });
auto roofPlane = roof->Crop(bbRoofPlane);
return roof->FitPlane();
}
static std::shared_ptr< T > Load(const String &fileName)
void SetZRange(ValueRange< double > zRange) noexcept
static std::unique_ptr< Image > Load(const String &fileName)
static PointCloudPtr Create(const ImagePlane &rangeMap, const Calibrator3D &calibrator, PointCloudFlags flags)
std::shared_ptr< T > Crop(const Cuboid &clipBox) const
Cuboid CalculateBoundingBox() const
Point3D< double > CalculateCenterOfGravity() const
std::shared_ptr< Image > ImagePtr