9#include <cvb/point_cloud_factory.hpp>
10#include <cvb/point_cloud.hpp>
11#include <cvb/dense_point_cloud.hpp>
12#include <cvb/dnc/finder.hpp>
14int main(
int ,
char* [])
18 const auto path = Cvb::InstallPath();
21 std::cout <<
"Load the search pattern...\n";
25 std::cout <<
"Create a dense point cloud...\n";
26 auto densePointCloud = Cvb::PointCloudFactory::Load<Cvb::DensePointCloud>(path + CVB_LIT(
"tutorial/DNC/Images/Genie/GenieTest.tif"),
30 std::cout <<
"Define the search parameters...\n";
46 std::cout <<
"Run the search on the point cloud...\n";
47 auto searchResult = finder->Find(*densePointCloud, params);
50 std::cout <<
"Number of search results: " << searchResult.size() <<
"\n";
53 for (
const auto& result : searchResult) {
55 <<
": position(x=" << result.Position().X()
56 <<
",y=" << result.Position().Y()
57 <<
",z=" << result.Position().Z()
58 <<
"), rotation(x=" << result.RotationVector().X()
59 <<
",y=" << result.RotationVector().Y()
60 <<
",z=" << result.RotationVector().Z()
61 <<
"), theta=" << result.Theta().Deg()
62 <<
"\370, score=" << result.Score() <<
"\n";
static std::unique_ptr< Finder > Load(const String &fileName)
Loads a finder from the given file name.
Definition: finder.hpp:47
Definition of search parameters.
Definition: search_parameters.hpp:23
void SetMaxInconsistency(double value)
Set maximum inconsistency.
Definition: search_parameters.hpp:309
void SetPrecisionThreshold(double value)
Set precision threshold.
Definition: search_parameters.hpp:229
void SetMaxOcclusion(double value)
Set maximum occlusion.
Definition: search_parameters.hpp:282
void SetHypothesesThreshold(double value)
Set minimum feature score for hypotheses generation.
Definition: search_parameters.hpp:52
void SetMinScore(double value)
Set minimum score.
Definition: search_parameters.hpp:335
void SetDerivativePatchSize(int value)
Set smoothing area in pixels for gradient and normal calculation.
Definition: search_parameters.hpp:78
void SetICPMaxIterations(int value)
Set the maximum number of iterations of the ICP algorithm.
Definition: search_parameters.hpp:203
void SetICPShrink(int value)
Set the subsample factor for ICP.
Definition: search_parameters.hpp:177
void SetMinCoverage(double value)
Set minimum coverage.
Definition: search_parameters.hpp:255
void SetPartsToFind(int value)
Set the maximum number of objects to find.
Definition: search_parameters.hpp:126
void SetRawResultsOnly(bool value) noexcept
Set the raw results flag.
Definition: search_parameters.hpp:152
void SetIndifferentRadius(double value)
Set fraction of template size which accounts for a single object.
Definition: search_parameters.hpp:102