提交 995302ec 编写于 作者: H Hordur Johannsson

The VTK library loads vertex colors in PLY files as RGB. Added that to the polymesh loader.

git-svn-id: svn+ssh://svn.pointclouds.org/pcl/trunk@3268 a9d63959-f2ad-4865-b262-bf0e56cfafb6
上级 5a892429
......@@ -257,9 +257,12 @@ pcl::io::vtk2mesh(const vtkSmartPointer<vtkPolyData>& poly_data, pcl::PolygonMes
poly_colors = vtkUnsignedCharArray::SafeDownCast(poly_data->GetPointData()->GetScalars("Colors"));
// some applications do not save the name of scalars (including PCL's native vtk_io)
if (!poly_colors)
if (!poly_colors && poly_data->GetPointData() != NULL )
poly_colors = vtkUnsignedCharArray::SafeDownCast(poly_data->GetPointData()->GetScalars("scalars"));
if (!poly_colors && poly_data->GetPointData() != NULL )
poly_colors = vtkUnsignedCharArray::SafeDownCast(poly_data->GetPointData()->GetScalars("RGB"));
// TODO: currently only handles rgb values with 3 components
if (poly_colors && (poly_colors->GetNumberOfComponents() == 3))
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册