@@ -95,10 +95,10 @@ void normalIntegration(const sfmData::SfMData& sfmData,
9595
9696 if (sfmData.getPoses ().size () > 0 )
9797 {
98- for (auto & poseIt : sfmData.getPoses ())
98+ for (auto & [idPose, cameraPose] : sfmData.getPoses (). valueRange ())
9999 {
100100 // Read associated normal map :
101- image::readImage (inputPath + " /" + std::to_string (poseIt. first ) + " _normals.png" , normalsImPNG, image::EImageColorSpace::NO_CONVERSION);
101+ image::readImage (inputPath + " /" + std::to_string (idPose ) + " _normals.png" , normalsImPNG, image::EImageColorSpace::NO_CONVERSION);
102102
103103 int nbCols = normalsImPNG.cols ();
104104 int nbRows = normalsImPNG.rows ();
@@ -107,7 +107,7 @@ void normalIntegration(const sfmData::SfMData& sfmData,
107107 for (auto & viewIt : sfmData.getViews ())
108108 {
109109 poseId = viewIt.second ->getPoseId ();
110- if (poseId == poseIt. first )
110+ if (poseId == idPose )
111111 {
112112 viewId = viewIt.first ;
113113 // Get intrinsics associated with this view :
@@ -184,10 +184,10 @@ void normalIntegration(const sfmData::SfMData& sfmData,
184184 // AliceVision uses distance-to-origin convention
185185 convertZtoDistance (depthMap, distanceMap, K);
186186
187- std::string pathToDM = outputFolder + " /" + std::to_string (poseIt. first ) + " _depthMap.exr" ;
187+ std::string pathToDM = outputFolder + " /" + std::to_string (idPose ) + " _depthMap.exr" ;
188188
189189 // Create pose for metadata
190- const geometry::Pose3 pose = poseIt. second .getTransform ();
190+ const geometry::Pose3 pose = cameraPose .getTransform ();
191191 std::shared_ptr<camera::IntrinsicBase> cam = sfmData.getIntrinsics ().at (intrinsicId);
192192 std::shared_ptr<camera::Pinhole> camPinHole = std::dynamic_pointer_cast<camera::Pinhole>(cam);
193193 Mat34 P = camPinHole->getProjectiveEquivalent (pose);
0 commit comments