average diffusion distance

    xiaoxiao2025-02-10  21

    average diffusion distance(ADD) 

    定义见: [1]

    说明见: [2]

    主要代码:

    % test for farthest point sampling on 3D meshes %%%%%%%%%%%%%% sphere %%%%%%%%%%%%%%%% % name = 'sphere40.obj'; % X0=read_obj(name); % vertex=X0.xyz'; %坐标 % faces=X0.tri'; %三角形顺序索引 %%%%%%%%%%%%%% elephant %%%%%%%%%%%%%%%% [vertex,faces] = read_mesh('elephant-50kv'); vertex = vertex'; faces = faces'; %dis=squareform(pdist(vertex));%euclidian distance numvert = size(vertex, 1); colorvector = (1:numvert)'/ numvert; %figure(1); %scatter3(vertex(:,1),vertex(:,2),vertex(:,3),10,colorvector,'filled'); L = cotmatrix(vertex,faces); M = massmatrix(vertex,faces,'voronoi'); M = diag(M); M = M * ones(1,size(L,2)); L = L./M;% the discrete Laplacian matrix eigennum = 51; [U,S] = eigs(L, eigennum, 'sr'); %[U,S,V] = svds(L,size(L,1)); eigenvals=diag(S); t = 1 / (2 * eigenvals(2)); % select time eigenvals = eigenvals(eigenvals<-log(0.1)/t);% choose eigen number eigennum = min(eigennum - 1, size(eigenvals,1) - 1); e_minus_lambda_t = exp(-eigenvals(2:eigennum+1).*t); e_minus_lambda_t = ones(size(U,1),1)*e_minus_lambda_t'; X = U(:,2:eigennum+1).*e_minus_lambda_t; %figure(2); %scatter3(X(:,1),X(:,2),X(:,3),10,colorvector,'filled'); dis=squareform(pdist(X).^2);%diffusion distance D = sum(dis, 2); col = D; col = perform_histogram_equalization(col, linspace(0,1,length(col))); options.face_vertex_color = col; clf; hold on; plot_mesh(vertex, faces, options); colormap jet(256); camlight; shading interp; 最终结果:

    正如[1]说的那样,the ADD presents highvalues for boundary and extrema points, and small valuesfor points in the center of the segment.

    [1]A Hierarchical Segmentation of Articulated Bodies

    [2]Symmetry-Aware Nonrigid Matching of Incomplete 3D Surfaces

    完整源代码

    转载请注明原文地址: https://ju.6miu.com/read-1296280.html
    最新回复(0)