showPointCloud with single color

This commit is contained in:
ozantonkal 2013-06-12 10:55:07 +02:00
parent 01086323b0
commit 46cf22cdff
4 changed files with 15 additions and 1 deletions

View File

@ -28,6 +28,7 @@ namespace temp_viz
void addCoordinateSystem(double scale, const Affine3f& t, const String &id = "coordinate");
void showPointCloud(const String& id, InputArray cloud, InputArray colors, const Affine3f& pose = Affine3f::Identity());
void showPointCloud(const String& id, InputArray cloud, const Color& color, const Affine3f& pose = Affine3f::Identity());
bool addPointCloudNormals (const Mat &cloud, const Mat& normals, int level = 100, float scale = 0.02f, const String &id = "cloud");

View File

@ -104,6 +104,7 @@ public:
* \param[in] pose transform to be applied on the point cloud
*/
void showPointCloud(const String& id, InputArray cloud, InputArray colors, const Affine3f& pose = Affine3f::Identity());
void showPointCloud(const String& id, InputArray cloud, const Color& color, const Affine3f& pose = Affine3f::Identity());
bool addPolygonMesh (const Mesh3d& mesh, const cv::Mat& mask, const std::string &id = "polygon");
bool updatePolygonMesh (const Mesh3d& mesh, const cv::Mat& mask, const std::string &id = "polygon");

View File

@ -28,6 +28,11 @@ void temp_viz::Viz3d::showPointCloud(const String& id, InputArray cloud, InputAr
impl_->showPointCloud(id, cloud, colors, pose);
}
void temp_viz::Viz3d::showPointCloud(const String& id, InputArray cloud, const Color& color, const Affine3f& pose)
{
impl_->showPointCloud(id, cloud, color, pose);
}
bool temp_viz::Viz3d::addPointCloudNormals (const Mat &cloud, const Mat& normals, int level, float scale, const String& id)
{
return impl_->addPointCloudNormals(cloud, normals, level, scale, id);

View File

@ -114,7 +114,7 @@ void temp_viz::Viz3d::VizImpl::showPointCloud(const String& id, InputArray _clou
vtkSmartPointer<vtkIdTypeArray> cells = vertices->GetData ();
if (exist)
updateCells(cells, initcells, nr_points);
updateCells (cells, initcells, nr_points);
else
updateCells (cells, am_it->second.cells, nr_points);
@ -166,6 +166,13 @@ void temp_viz::Viz3d::VizImpl::showPointCloud(const String& id, InputArray _clou
}
}
void temp_viz::Viz3d::VizImpl::showPointCloud(const String& id, InputArray _cloud, const Color& color, const Affine3f& pose)
{
// Generate an array of colors from single color
Mat colors(_cloud.size(), CV_8UC3, color);
showPointCloud(id, _cloud, colors, pose);
}
bool temp_viz::Viz3d::VizImpl::addPointCloudNormals (const cv::Mat &cloud, const cv::Mat& normals, int level, float scale, const std::string &id)
{
CV_Assert(cloud.size() == normals.size() && cloud.type() == CV_32FC3 && normals.type() == CV_32FC3);