博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Farthest sampling on 3d mesh with mesh kept
阅读量:4041 次
发布时间:2019-05-24

本文共 1186 字,大约阅读时间需要 3 分钟。

3D mesh的farthest sampling与2D 图片的采样原理类似(http://blog.csdn.net/seamanj/article/details/52028904).

随机给个初始点,然后根据初始点,然后算出最远的n-1个点,  n为我们需要采样的个数

最后以这个n个点为初始点,算出mesh上的距离场

主要代码:

% test for farthest point sampling on 3D meshesn = 300;name = 'elephant-50kv';[vertex,faces] = read_mesh(name);options.name = name;if size(vertex,1)>size(vertex,2)    vertex = vertex';endif size(faces,1)>size(faces,2)    faces = faces';endsave_images = 0;% plot sampling locationi = 0;landmark = [];for nbr_landmarks = [50]% 500 1000 2000 5000 10000]  % 100:50:500    i = i+1;        disp('Perform farthest point sampling.');    landmark = perform_farthest_point_sampling_mesh( vertex,faces, landmark, nbr_landmarks-length(landmark) );    %这步会根据farthest point sampling原则选出nbr_landmarks-length(landmark)个样本点    % compute the associated triangulation    [D,Z,Q] = perform_fast_marching_mesh(vertex, faces, landmark);    %初始点为landmark,然后算距离    % display    col = D; col(col==Inf) = 0;    col = perform_histogram_equalization(col, linspace(0,1,length(col)));    options.face_vertex_color = col;    hold on;    plot_mesh(vertex, faces, options);    hold off;    colormap jet(256);    camlight;    shading interp;end

运行结果如下:

你可能感兴趣的文章
01Java基础语法-19. 循环跳转控制语句
查看>>
Django框架全面讲解 -- Form
查看>>
socket,accept函数解析
查看>>
今日互联网关注(写在清明节后):每天都有值得关注的大变化
查看>>
”舍得“大法:把自己的优点当缺点倒出去
查看>>
[今日关注]鼓吹“互联网泡沫,到底为了什么”
查看>>
[互联网学习]如何提高网站的GooglePR值
查看>>
[关注大学生]求职不可不知——怎样的大学生不受欢迎
查看>>
[关注大学生]读“贫困大学生的自白”
查看>>
[互联网关注]李开复教大学生回答如何学好编程
查看>>
[关注大学生]李开复给中国计算机系大学生的7点建议
查看>>
[关注大学生]大学毕业生择业:是当"鸡头"还是"凤尾"?
查看>>
[茶余饭后]10大毕业生必听得歌曲
查看>>
gdb调试命令的三种调试方式和简单命令介绍
查看>>
C++程序员的几种境界
查看>>
VC++ MFC SQL ADO数据库访问技术使用的基本步骤及方法
查看>>
VUE-Vue.js之$refs,父组件访问、修改子组件中 的数据
查看>>
Vue-子组件改变父级组件的信息
查看>>
Python自动化之pytest常用插件
查看>>
Python自动化之pytest框架使用详解
查看>>