简体   繁体   English

从点创建3D逻辑蒙版

[英]Create 3D logical mask from points

I have a set of 3D points specifying points on a surface of an object. 我有一组3D点,它们指定对象表面上的点。 From these points, i need to construct a 3D logical mask. 从这些观点出发,我需要构建一个3D逻辑蒙版。 How can I solve this with matlab? 如何使用Matlab解决此问题? Hope to get some insights. 希望能获得一些见识。

If you have the "Curve Fitting Toolbox" you could fit a surface formula to the data. 如果您拥有“曲线拟合工具箱”,则可以将曲面公式拟合到数据中。 And if you now the exact type (like a ball, cone, ...) you can define that as formular to fit to. 而且,如果您现在使用的是确切的类型(例如球,圆锥等),则可以将其定义为适合的公式。

Maybe you can provide some example data. 也许您可以提供一些示例数据。

% parameters
num_coordinates = 100;
max_coordinate = 20;
% generate random coordinate
x = sort(randi(max_coordinate, [num_coordinates, 1]));
y = sort(randi(max_coordinate, [num_coordinates, 1]));
z = sort(randi(max_coordinate, [num_coordinates, 1]));
% create the mask
mask = false(max_coordinate, max_coordinate, max_coordinate);
for k = 1 : length(x)
    mask(x(k), y(k), z(k)) = true;
end

If speed is important, I suppose there is a faster solution. 如果速度很重要,我想有一个更快的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM