#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int gProgress = -1;
bool onProgress( float v )
{
int progress = (int)( 10.f * v );
if ( progress != gProgress )
{
gProgress = progress;
printf( "%d%%...\n", progress * 10 );
}
return true;
}
void resetProgress( void )
{
gProgress = -1;
}
{
printf( "Samples: %zu\n", numSamples );
printf( "Active point pairs: %zu\n", numActivePairs );
if ( numActivePairs > 0 )
{
printf( "RMS point-to-point distance: %f ± %f\n", p2ptMetric, p2ptInaccuracy );
printf( "RMS point-to-plane distance: %f ± %f\n", p2plMetric, p2plInaccuracy );
}
}
int main(
int argc,
char* argv[] )
{
int rc = EXIT_FAILURE;
if ( argc < 4 )
{
fprintf( stderr, "Usage: %s INPUT1 INPUT2 [INPUTS...] OUTPUT\n", argv[0] );
goto out;
}
const int inputNum = argc - 2;
for ( int i = 0; i < inputNum; ++i )
{
if ( !pointCloud )
{
goto out_inputs;
}
maxBBox = bbox;
}
printStats( icp );
printf( "Calculating transformations...\n" );
resetProgress();
printStats( icp );
for ( int i = 0; i < inputNum; i++ )
{
printf("Resulting transform for part %d:\n%f %f %f %f\n%f %f %f %f\n%f %f %f %f\n\n", i, xf->A.x.x, xf->A.x.y, xf->A.x.z, xf->b.x, xf->A.y.x, xf->A.y.y, xf->A.y.z, xf->b.y, xf->A.z.x, xf->A.z.y, xf->A.z.z, xf->b.z);
for ( size_t j = 0; j < numPoints; j++ )
{
}
}
if ( !saveError )
{
rc = EXIT_SUCCESS;
}
else
{
}
out_inputs: ;
for ( size_t i = 0; i < numLoadedInputs; i++ )
{
}
out:
return rc;
}
struct MR_std_function_bool_from_float MR_std_function_bool_from_float
struct MR_Vector_MR_AffineXf3f_MR_ObjId MR_Vector_MR_AffineXf3f_MR_ObjId
struct MR_Vector_MR_MeshOrPointsXf_MR_ObjId MR_Vector_MR_MeshOrPointsXf_MR_ObjId
struct MR_MeshOrPoints MR_MeshOrPoints
struct MR_VertCoords MR_VertCoords
MRC_API MR_AffineXf3f MR_AffineXf3f_DefaultConstruct(void)
MRC_API MR_Vector3f MR_AffineXf3f_call(const MR_AffineXf3f *_this, const MR_Vector3f *x)
MRC_API float MR_Box3f_diagonal(const MR_Box3f *_this)
MRC_API MR_Box3f MR_Box3f_DefaultConstruct(void)
MRC_API bool MR_Box3f_valid(const MR_Box3f *_this)
MRC_API float MR_Box3f_volume(const MR_Box3f *_this)
struct MR_expected_void_std_string MR_expected_void_std_string
struct MR_expected_MR_PointCloud_std_string MR_expected_MR_PointCloud_std_string
struct MR_PointCloud MR_PointCloud
struct MR_std_string MR_std_string
MRC_API MR_ICPProperties * MR_ICPProperties_DefaultConstruct(void)
MRC_API void MR_ICPProperties_Destroy(const MR_ICPProperties *_this)
struct MR_MeshOrPointsXf MR_MeshOrPointsXf
struct MR_ICPProperties MR_ICPProperties
MRC_API const MR_PointCloudPart * MR_MeshOrPoints_asPointCloudPart(const MR_MeshOrPoints *_this)
MRC_API void MR_MeshOrPoints_Destroy(const MR_MeshOrPoints *_this)
MRC_API MR_MeshOrPointsXf * MR_MeshOrPointsXf_ConstructFrom(const MR_MeshOrPoints *obj, MR_AffineXf3f xf)
MRC_API const MR_MeshOrPoints * MR_MeshOrPointsXf_Get_obj(const MR_MeshOrPointsXf *_this)
MRC_API MR_MeshOrPoints * MR_MeshOrPoints_Construct_MR_PointCloud(const MR_PointCloud *pc)
MRC_API void MR_MeshOrPointsXf_Destroy(const MR_MeshOrPointsXf *_this)
struct MR_MultiwayICPSamplingParameters MR_MultiwayICPSamplingParameters
MRC_API void MR_MultiwayICP_Destroy(const MR_MultiwayICP *_this)
MRC_API MR_MultiwayICP * MR_MultiwayICP_Construct(const MR_Vector_MR_MeshOrPointsXf_MR_ObjId *objects, const MR_MultiwayICPSamplingParameters *samplingParams)
MRC_API void MR_MultiwayICPSamplingParameters_Set_samplingVoxelSize(MR_MultiwayICPSamplingParameters *_this, float value)
struct MR_MultiwayICP MR_MultiwayICP
MRC_API bool MR_MultiwayICP_updateAllPointPairs(MR_MultiwayICP *_this, MR_PassBy cb_pass_by, MR_std_function_bool_from_float *cb)
MRC_API MR_uint64_t MR_MultiwayICP_getNumActivePairs(const MR_MultiwayICP *_this)
MRC_API MR_MultiwayICPSamplingParameters * MR_MultiwayICPSamplingParameters_DefaultConstruct(void)
MRC_API void MR_MultiwayICP_setParams(MR_MultiwayICP *_this, const MR_ICPProperties *prop)
MRC_API MR_uint64_t MR_MultiwayICP_getNumSamples(const MR_MultiwayICP *_this)
MRC_API void MR_MultiwayICPSamplingParameters_Destroy(const MR_MultiwayICPSamplingParameters *_this)
MRC_API float MR_MultiwayICP_getMeanSqDistToPlane(const MR_MultiwayICP *_this, const double *value)
MRC_API float MR_MultiwayICP_getMeanSqDistToPoint(const MR_MultiwayICP *_this, const double *value)
MRC_API MR_Vector_MR_AffineXf3f_MR_ObjId * MR_MultiwayICP_calculateTransformations(MR_MultiwayICP *_this, MR_PassBy cb_pass_by, MR_std_function_bool_from_float *cb)
MRC_API void MR_MultiwayICPSamplingParameters_Set_cb(MR_MultiwayICPSamplingParameters *_this, MR_PassBy value_pass_by, MR_std_function_bool_from_float *value)
MRC_API const MR_PointCloud * MR_PointCloudPart_Get_cloud(const MR_PointCloudPart *_this)
MRC_API MR_Box3f MR_PointCloud_computeBoundingBox_1(const MR_PointCloud *_this, const MR_AffineXf3f *toWorld)
MRC_API MR_VertId MR_PointCloud_addPoint_1(MR_PointCloud *_this, const MR_Vector3f *point)
MRC_API MR_PointCloud * MR_PointCloud_DefaultConstruct(void)
MRC_API const MR_VertCoords * MR_PointCloud_Get_points(const MR_PointCloud *_this)
MRC_API void MR_PointCloud_Destroy(const MR_PointCloud *_this)
MRC_API MR_expected_MR_PointCloud_std_string * MR_PointsLoad_fromAnySupportedFormat_2(const char *file, const char *file_end, const MR_PointsLoadSettings *settings)
MRC_API MR_expected_void_std_string * MR_PointsSave_toAnySupportedFormat_3(const MR_PointCloud *points, const char *file, const char *file_end, const MR_SaveSettings *settings)
MRC_API MR_MeshOrPointsXf * MR_Vector_MR_MeshOrPointsXf_MR_ObjId_index(MR_Vector_MR_MeshOrPointsXf_MR_ObjId *_this, MR_ObjId i)
MRC_API MR_Vector_MR_MeshOrPointsXf_MR_ObjId * MR_Vector_MR_MeshOrPointsXf_MR_ObjId_DefaultConstruct(void)
MRC_API void MR_Vector_MR_MeshOrPointsXf_MR_ObjId_push_back_MR_MeshOrPointsXf_rvalue_ref(MR_Vector_MR_MeshOrPointsXf_MR_ObjId *_this, MR_MeshOrPointsXf *t)
MRC_API void MR_Vector_MR_MeshOrPointsXf_MR_ObjId_Destroy(const MR_Vector_MR_MeshOrPointsXf_MR_ObjId *_this)
MRC_API MR_uint64_t MR_Vector_MR_MeshOrPointsXf_MR_ObjId_size(const MR_Vector_MR_MeshOrPointsXf_MR_ObjId *_this)
MRC_API MR_uint64_t MR_VertCoords_size(const MR_VertCoords *_this)
MRC_API const MR_AffineXf3f * MR_Vector_MR_AffineXf3f_MR_ObjId_index_const(const MR_Vector_MR_AffineXf3f_MR_ObjId *_this, MR_ObjId i)
MRC_API const MR_Vector3f * MR_VertCoords_index_const(const MR_VertCoords *_this, MR_VertId i)
MRC_API void MR_Vector_MR_AffineXf3f_MR_ObjId_Destroy(const MR_Vector_MR_AffineXf3f_MR_ObjId *_this)
MRC_API const MR_MeshOrPointsXf * MR_Vector_MR_MeshOrPointsXf_MR_ObjId_index_const(const MR_Vector_MR_MeshOrPointsXf_MR_ObjId *_this, MR_ObjId i)
MRC_API const MR_std_string * MR_expected_MR_PointCloud_std_string_GetError(const MR_expected_MR_PointCloud_std_string *_this)
MRC_API MR_PointCloud * MR_expected_MR_PointCloud_std_string_GetMutableValue(MR_expected_MR_PointCloud_std_string *_this)
MRC_API void MR_expected_MR_PointCloud_std_string_Destroy(const MR_expected_MR_PointCloud_std_string *_this)
MRC_API const MR_std_string * MR_expected_void_std_string_GetError(const MR_expected_void_std_string *_this)
MRC_API MR_std_function_bool_from_float * MR_std_function_bool_from_float_DefaultConstruct(void)
MRC_API void MR_std_function_bool_from_float_Assign(MR_std_function_bool_from_float *_this, bool(*func)(float _1))
MRC_API void MR_std_function_bool_from_float_Destroy(const MR_std_function_bool_from_float *_this)
MRC_API void MR_std_string_Destroy(const MR_std_string *_this)
MRC_API const char * MR_std_string_Data(const MR_std_string *_this)