MATLAB中的3D pointCloud索引

时间:2015-09-28 10:25:08

标签: matlab matlab-cvst point-clouds labeling

我有一组创建点云的3D点。 Ii可以使用此代码在MATLAB中读取和显示它

ptCloud1 = pcread('sub2a.ply')
figure
showPointCloud(ptCloud1)

我需要为密集点云显示中的每个点添加标签。我怎么能这样做?

1 个答案:

答案 0 :(得分:2)

您可以使用text

为图表添加文字
  

struct childrensBooks { char *title; //use of pointers to store memory for title char *author; //use of pointers to store memory for author char *publisher; //use of pointers to store memory for publisher int copyright; double price; }; struct childrensBooks *book1 = (struct childrensBooks *) malloc(sizeof(struct childrensBooks)); //Structure of book #1 { book1->title = (char *)malloc(100); book1->author = (char *)malloc(100); book1->publisher = (char *)malloc(100); book1->copyright = 1997; book1->price = 8.99 memcpy(book1->title, "We're Going on a Bear Hunt", 26); memcpy(book1->author, "Michael Rosen", 13); memcpy(book1->publisher, "Little Simon", 12); book1->copyright = 1989; book1->price = 7.99; fprintf(stderr, "%s was written by %s\n. Publisher is %s. Copyright %d\n. Retail price is $%.2d\n.", book1->title, book1->author, book1->publisher, book1->copyright, book1->price); 将文本放在三维坐标中。

因此,您需要坐标:

text(x,y,z,str)

您可以在其中查看sprintf的格式选项以获取有关小数位数的帮助。只需使用str = sprintf('x:%f, y:%f, z:%f',x,y,z); text(x,y,z,str) 将其添加到您的图中即可。