Skip to content

Commit

Permalink
Set default colors to points if none are found
Browse files Browse the repository at this point in the history
  • Loading branch information
pierotofy committed Mar 15, 2024
1 parent 3eab2b6 commit 0f23e58
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions point_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,13 @@ PointSet *readPointSet(const std::string &filename) {
}
}

// Add a default color to all points if the set does not have them
if (!r->hasColors()){
std::cout << "Warning: point cloud does not have colors, will set color to white" << std::endl;
r->colors.resize(r->points.size());
std::fill(r->colors.begin(), r->colors.end(), std::array<uint8_t, 3>{255, 255, 255});
}

return r;
}

Expand Down

0 comments on commit 0f23e58

Please sign in to comment.