confirmed bilateral_smoothing_test and edge_aware_upsample_test

but wlop_simplify_and_regularize_test have bug, it seems like memory leak
This commit is contained in:
Shihao Wu 2014-02-24 18:30:58 +08:00
parent 99220af199
commit e5e7d6c917
4 changed files with 37 additions and 14 deletions

View File

@ -48,6 +48,19 @@ if ( CGAL_FOUND )
# Temporary debugging stuff # Temporary debugging stuff
ADD_DEFINITIONS( "-DDEBUG_TRACE" ) ADD_DEFINITIONS( "-DDEBUG_TRACE" )
# Activate concurrency?
option(ACTIVATE_CONCURRENCY
"Enable concurrency"
ON)
if( ACTIVATE_CONCURRENCY )
find_package( TBB REQUIRED )
if( TBB_FOUND )
include(${TBB_USE_FILE})
list(APPEND CGAL_3RD_PARTY_LIBRARIES ${TBB_LIBRARIES})
endif()
endif()
# Executables that do *not* require LAPACK # Executables that do *not* require LAPACK
create_single_source_cgal_program( "read_test.cpp" ) create_single_source_cgal_program( "read_test.cpp" )
create_single_source_cgal_program( "read_test_with_different_pmaps.cpp" ) create_single_source_cgal_program( "read_test_with_different_pmaps.cpp" )

View File

@ -138,7 +138,7 @@ int main(int argc, char * argv[])
} // for each input file } // for each input file
std::cerr << std::endl; std::cerr << std::endl;
system("Pause");
// Returns accumulated fatal error // Returns accumulated fatal error
std::cerr << "Tool returned " << accumulated_fatal_err << std::endl; std::cerr << "Tool returned " << accumulated_fatal_err << std::endl;
return accumulated_fatal_err; return accumulated_fatal_err;

View File

@ -101,7 +101,7 @@ int main(int argc, char * argv[])
const double sharpness_sigma = 25; //control sharpness of the result. const double sharpness_sigma = 25; //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 times_of_output_points = 500; const unsigned int times_of_output_points = 100;
// Accumulated errors // Accumulated errors
int accumulated_fatal_err = EXIT_SUCCESS; int accumulated_fatal_err = EXIT_SUCCESS;

View File

@ -56,20 +56,28 @@ void test_wlop_simplify_and_regularize(std::vector<Point>& points, // input poin
std::vector<Point> points_sampled; std::vector<Point> points_sampled;
points_sampled.resize(points.size() * (retain_percentage / 100.)); points_sampled.resize(points.size() * (retain_percentage / 100.));
output.clear();
// Run algorithm // Run algorithm
CGAL::wlop_simplify_and_regularize_point_set<CGAL::Parallel_tag>( CGAL::wlop_simplify_and_regularize_point_set<CGAL::Parallel_tag>(
points.begin(), points.begin(),
points.end(), points.end(),
std::back_inserter(output), back_inserter(output));
retain_percentage,
neighbor_radius, //CGAL::wlop_simplify_and_regularize_point_set<CGAL::Parallel_tag>(
iter_number, // points.begin(),
need_compute_density); // points.end(),
// std::back_inserter(output),
// retain_percentage,
// neighbor_radius,
// iter_number,
// need_compute_density);
output.clear();
long memory = CGAL::Memory_sizer().virtual_size(); long memory = CGAL::Memory_sizer().virtual_size();
std::cerr << "ok: " << task_timer.time() << " seconds, " std::cerr << "ok: " << task_timer.time() << " seconds, "
<< (memory>>20) << " Mb allocated" << (memory>>20) << " Mb allocated"
<< std::endl; << std::endl;
} }
@ -97,8 +105,8 @@ int main(int argc, char * argv[])
} }
//Algorithm parameters //Algorithm parameters
const double retain_percentage = 10; // percentage of points to retain. const double retain_percentage = 2; // percentage of points to retain.
const double neighbor_radius = 0.25; // neighbors size. const double neighbor_radius = 0.03; // neighbors size.
const unsigned int iter_number = 30; // number of iterations. const unsigned int iter_number = 30; // number of iterations.
const bool need_compute_density = true; // if needed to compute density. const bool need_compute_density = true; // if needed to compute density.
@ -139,6 +147,8 @@ int main(int argc, char * argv[])
// Test // Test
//*************************************** //***************************************
std::vector<Point> output; std::vector<Point> output;
test_wlop_simplify_and_regularize(points, test_wlop_simplify_and_regularize(points,
output, output,
retain_percentage, retain_percentage,
@ -149,7 +159,7 @@ int main(int argc, char * argv[])
} // for each input file } // for each input file
std::cerr << std::endl; std::cerr << std::endl;
system("Pause");
// Returns accumulated fatal error // Returns accumulated fatal error
std::cerr << "Tool returned " << accumulated_fatal_err << std::endl; std::cerr << "Tool returned " << accumulated_fatal_err << std::endl;
return accumulated_fatal_err; return accumulated_fatal_err;