博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
perform_farthest_point_sampling_mesh
阅读量:4042 次
发布时间:2019-05-24

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

function [points,D] = perform_farthest_point_sampling_mesh( vertex,faces, points, nbr_iter, options )% perform_farthest_point_sampling - samples points using farthest seeding strategy%% [points,D] = perform_farthest_point_sampling_mesh( vertex,faces, points, nbr_iter, options );%%   points can be [] or can be a (nb.points,1) matrix of already computed %       sampling locations.%%   See also: perform_fast_marching_mesh.%   %   Copyright (c) 2007 Gabriel Peyreoptions.null = 0;if nargin<3    nb_iter = 1;end[vertex,faces] = check_face_vertex(vertex,faces);n = size(vertex,2);L1 = getoptions(options, 'constraint_map', zeros(n,1) + Inf );if nargin<2 || isempty(points)    % initialize farthest points at random    %points = round(rand(1,1)*(n-1))+1;    points = 1;    % replace by farthest point    [points,L] = perform_farthest_point_sampling_mesh( vertex,faces, points, 1, options );    points = points(end);    nbr_iter = nbr_iter-1;    L = min(zeros(n,1) + Inf, L1);else    % initial distance map    L = min(zeros(n,1) + Inf, L1);endfor i=1:nbr_iter    if nbr_iter>5        progressbar( i, nbr_iter );    end    options.nb_iter_max = Inf;    options.constraint_map = L;    D = my_eval_distance(vertex,faces, points(end), options);    D = min(D,L); % known distance map to lanmarks    L = min(D,L1); % cropp with other constraints    % remove away data    D(D==Inf) = 0;    % compute farhtest points    [tmp,I] = max(D(:));    points = [points,I(1)];end%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%function D = my_eval_distance(vertex,faces,  x, options)options.null = 0;if length(x)>1    D = zeros(n)+Inf;    for i=1:length(x)        D = min(D, my_eval_distance(vertex,faces,x(i)));    end    return;end[D,Z,Q] = perform_fast_marching_mesh(vertex, faces, x, options);

转载地址:http://vvxdi.baihongyu.com/

你可能感兴趣的文章
NSNotificationCenter 用法总结
查看>>
C primer plus 基础总结(一)
查看>>
剑指offer算法题分析与整理(一)
查看>>
剑指offer算法题分析与整理(三)
查看>>
Ubuntu 13.10使用fcitx输入法
查看>>
pidgin-lwqq 安装
查看>>
mint/ubuntu安装搜狗输入法
查看>>
C++动态申请数组和参数传递问题
查看>>
opencv学习——在MFC中读取和显示图像
查看>>
retext出现Could not parse file contents, check if you have the necessary module installed解决方案
查看>>
Matlab与CUDA C的混合编程配置出现的问题及解决方案
查看>>
python一句话之利用文件对话框获取文件路径
查看>>
PaperDownloader——文献命名6起来
查看>>
如何将PaperDownloader下载的文献存放到任意位置
查看>>
C/C++中关于动态生成一维数组和二维数组的学习
查看>>
JVM最简生存指南
查看>>
Java的对象驻留
查看>>
logback高级特性使用(二) 自定义Pattern模板
查看>>
JVM并发机制探讨—内存模型、内存可见性和指令重排序
查看>>
可扩展、高可用服务网络设计方案
查看>>