Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoulon committed May 12, 2015
2 parents 843e01c + 31ae2cc commit 9c82ae2
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/software/SfM/main_ComputeSfM_DataColor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,17 @@ void ColorizeTracks(
}
}

/// Export camera poses positions as a Vec3 vector
void GetCameraPositions(const SfM_Data & sfm_data, std::vector<Vec3> & vec_camPosition)
{
const Poses & poses = sfm_data.getPoses();
for (Poses::const_iterator iterPose = poses.begin();
iterPose != poses.end(); ++iterPose)
{
vec_camPosition.push_back(iterPose->second.center());
}
}

// Convert from a SfM_Data format to another
int main(int argc, char **argv)
{
Expand Down Expand Up @@ -162,11 +173,12 @@ int main(int argc, char **argv)
}

// Compute the scene structure color
std::vector<Vec3> vec_3dPoints, vec_tracksColor;
std::vector<Vec3> vec_3dPoints, vec_tracksColor, vec_camPosition;
ColorizeTracks(sfm_data, vec_3dPoints, vec_tracksColor);
GetCameraPositions(sfm_data, vec_camPosition);

// Export the SfM_Data scene in the expected format
if (plyHelper::exportToPly(vec_3dPoints,std::vector<Vec3>(), sOutputPLY_Out, &vec_tracksColor))
if (plyHelper::exportToPly(vec_3dPoints, vec_camPosition, sOutputPLY_Out, &vec_tracksColor))
{
return EXIT_SUCCESS;
}
Expand Down

0 comments on commit 9c82ae2

Please sign in to comment.