Skip to content

Commit 0f23e58

Browse files
committed
Set default colors to points if none are found
1 parent 3eab2b6 commit 0f23e58

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

point_io.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,13 @@ PointSet *readPointSet(const std::string &filename) {
130130
}
131131
}
132132

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

0 commit comments

Comments
 (0)