Skip to content

Commit

Permalink
[clustering] Adding threading openMVG#1476
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoulon committed Feb 11, 2019
1 parent 79a6425 commit 53b18b6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/openMVG/clustering/kmeans.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ std::vector< DataType > ComputeCenterOfMass( const std::vector< DataType > & pts
}

// Compute mean of centers based on the number of points affected to each centers
#pragma omp parallel for
for( uint32_t id_center = 0; id_center < nb_center; ++id_center )
{
trait::divide( new_centers[id_center], nb_per_center[id_center] );
Expand Down Expand Up @@ -193,6 +194,7 @@ void KMeans( const std::vector< DataType > & source_data,
changed = false;

// 2.1 affect center to each points
#pragma omp parallel for
for( size_t id_pt = 0; id_pt < source_data.size(); ++id_pt )
{
const DataType & cur_pt = source_data[id_pt];
Expand Down

0 comments on commit 53b18b6

Please sign in to comment.