Content
This short example shows how to use ReconstructMe SDK to generate printable busts. It automatically detects when a full camera rotation around the subject is complete and starts post-processing. It post-processes the mesh in a way that the resulting mesh is watertight and directly printable. For this to work, the example makes a couple of assumptions:
- The sensor is placed roughly on eye-level of the person to scan when reconstruction starts
- The sensor is hold horizontally towards the subject (i.e no tilting) when reconstruction starts
- Either the person is doing a full rotation infront of the camera or the camera is moved 360° around the subject. Note that it needs to be a full rotation in one way. Don't go 180° in one direction and then back the other way.
The following 3D modell shows a typical bust result.
Note, for best results you should disable sensor exposure auto-correction. Don't do this immediately when the sensor starts, but rather after a couple of frames.
Boost is only used to generate examples and is not necessary for working with this SDK.
#include <boost/test/unit_test.hpp>
#include <math.h>
#include <string.h>
BOOST_AUTO_TEST_SUITE(example_reconstructmesdk)
BOOST_AUTO_TEST_CASE(bust_generation) {
float prev_pos[16], cur_pos[16];
float rotation_axis[4] = {0, 0, 1, 0};
float angle;
float sum_turn_angles = 0.f;
while (fabs(sum_turn_angles) < 2.f * 3.1415f) {
continue;
}
sum_turn_angles += angle;
memcpy(prev_pos, cur_pos, 16 * sizeof(float));
}
}
float cut_plane[4] = {0, 0, 1, -300};
float transform[16];
transform[11] = 300;
}
BOOST_AUTO_TEST_SUITE_END()