mirror of https://github.com/CGAL/cgal
added a sphere test data, the upsample codes works well on it too
This commit is contained in:
parent
d8ea879471
commit
bed181be5c
File diff suppressed because it is too large
Load Diff
|
|
@ -23,7 +23,8 @@ int main(void)
|
||||||
{
|
{
|
||||||
// Reads a .xyz point set file in points[].
|
// Reads a .xyz point set file in points[].
|
||||||
std::vector<PointVectorPair> points;
|
std::vector<PointVectorPair> points;
|
||||||
std::ifstream stream("data/before_upsample.xyz");
|
//std::ifstream stream("data/before_upsample.xyz");
|
||||||
|
std::ifstream stream("data/sphere_1k_after_regularization2.xyz");
|
||||||
|
|
||||||
if (!stream ||
|
if (!stream ||
|
||||||
!CGAL::read_xyz_points_and_normals(stream,
|
!CGAL::read_xyz_points_and_normals(stream,
|
||||||
|
|
@ -36,10 +37,10 @@ int main(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Algorithm parameters
|
//Algorithm parameters
|
||||||
const double sharpness_sigma = 30; //control sharpness of the result.
|
const double sharpness_sigma = 90; //control sharpness of the result.
|
||||||
const double edge_senstivity = 0; // more points will up-sample on edge.
|
const double edge_senstivity = 0; // more points will up-sample on edge.
|
||||||
const double neighbor_radius = 0.2; // initial neighbors size.
|
const double neighbor_radius = 0.2; // initial neighbors size.
|
||||||
const unsigned int number_of_output_points = points.size() * 70;
|
const unsigned int number_of_output_points = points.size() * 100;
|
||||||
|
|
||||||
|
|
||||||
CGAL::Timer task_timer;
|
CGAL::Timer task_timer;
|
||||||
|
|
@ -67,7 +68,10 @@ int main(void)
|
||||||
// Note: write_xyz_points_and_normals() requires an output iterator
|
// Note: write_xyz_points_and_normals() requires an output iterator
|
||||||
// over points as well as property maps to access each
|
// over points as well as property maps to access each
|
||||||
// point position and normal.
|
// point position and normal.
|
||||||
std::ofstream out("data/after_upsample.xyz");
|
|
||||||
|
//std::ofstream out("data/after_upsample.xyz");
|
||||||
|
std::ofstream out("data/sphere_after_upsample.xyz");
|
||||||
|
|
||||||
if (!out ||
|
if (!out ||
|
||||||
!CGAL::write_xyz_points_and_normals(
|
!CGAL::write_xyz_points_and_normals(
|
||||||
out, points.begin(), points.end(),
|
out, points.begin(), points.end(),
|
||||||
|
|
|
||||||
|
|
@ -387,7 +387,7 @@ upsample_point_set(
|
||||||
|
|
||||||
if (iter_time == 0)
|
if (iter_time == 0)
|
||||||
{
|
{
|
||||||
//estimate density threshold
|
//estimate density threshold for the first time
|
||||||
for (i = 0; i < rich_point_set.size() * 0.05; i++)
|
for (i = 0; i < rich_point_set.size() * 0.05; i++)
|
||||||
{
|
{
|
||||||
Rich_point& v = rich_point_set[i];
|
Rich_point& v = rich_point_set[i];
|
||||||
|
|
@ -420,7 +420,7 @@ upsample_point_set(
|
||||||
density_pass_threshold;
|
density_pass_threshold;
|
||||||
|
|
||||||
|
|
||||||
std::cout << "pass_threshold: " << density_pass_threshold2 << std::endl;
|
std::cout << "pass_threshold: " << density_pass_threshold << std::endl;
|
||||||
|
|
||||||
// insert new points until all the points' density pass the threshold
|
// insert new points until all the points' density pass the threshold
|
||||||
unsigned int max_loop_time = 3;
|
unsigned int max_loop_time = 3;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue