Skip to content

Commit

Permalink
dense: fix bug in tower generation
Browse files Browse the repository at this point in the history
(cherry picked from commit e62b65f2593dff34a32a0e04bca07f819c788eb7)
  • Loading branch information
cdcseacave committed Oct 31, 2024
1 parent 36f303d commit bf8fc85
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions apps/InterfaceCOLMAP/InterfaceCOLMAP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -699,18 +699,18 @@ typedef Eigen::Matrix<double,3,1> EVec3d;

bool DetermineInputSource(const String& filenameTXT, const String& filenameBIN, std::ifstream& file, String& filenameCamera, bool& binary)
{
file.open(filenameTXT);
if (file.good()) {
filenameCamera = filenameTXT;
binary = false;
return true;
}
file.open(filenameBIN, std::ios::binary);
if (file.good()) {
filenameCamera = filenameBIN;
binary = true;
return true;
}
file.open(filenameTXT);
if (file.good()) {
filenameCamera = filenameTXT;
binary = false;
return true;
}
VERBOSE("error: unable to open file '%s'", filenameTXT.c_str());
VERBOSE("error: unable to open file '%s'", filenameBIN.c_str());
return false;
Expand Down
10 changes: 5 additions & 5 deletions libs/MVS/Scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2080,13 +2080,13 @@ PointCloud Scene::BuildTowerMesh(const PointCloud& origPointCloud, const Point2f
topPoints.swap(botPoints);
}
}
mesh.Save("tower_mesh.ply");
mesh.Save(MAKE_PATH("tower_mesh.ply"));
} else
#endif
{
mesh.Release();
}
towerPC.Save("tower.ply");
towerPC.Save(MAKE_PATH("tower.ply"));
return towerPC;
}

Expand All @@ -2108,9 +2108,9 @@ void Scene::InitTowerScene(const int towerMode)
mesh.Release();

const auto AppendPointCloud = [this](const PointCloud& towerPC) {
bool bHasNormal(pointcloud.normals.size() == pointcloud.GetSize());
bool bHasColor(pointcloud.colors.size() == pointcloud.GetSize());
bool bHasWeights(pointcloud.pointWeights.size() == pointcloud.GetSize());
bool bHasNormal(towerPC.normals.size() == towerPC.GetSize());
bool bHasColor(towerPC.colors.size() == towerPC.GetSize());
bool bHasWeights(towerPC.pointWeights.size() == towerPC.GetSize());
FOREACH(idxPoint, towerPC.points) {
pointcloud.points.emplace_back(towerPC.points[idxPoint]);
pointcloud.pointViews.emplace_back(towerPC.pointViews[idxPoint]);
Expand Down

0 comments on commit bf8fc85

Please sign in to comment.