フィルターのクリア

Plotting Delaunay Triangulation Upright

2 ビュー (過去 30 日間)
Abdulmu'min Musa
Abdulmu'min Musa 2018 年 8 月 27 日
I have been able to read an image, plot its coordinates and did the delaunay triangulation to get the shape model. I got my results but the delaunay triangulation is upside down. How can i make it upright and maybe fit it to the image. Here are my codes.
clc; I = imread('06-5m.jpg'); subplot (1,3,1), imshow(I), title('Face image') filename = 'C:\Users\ENGR. KAYODE\Desktop\IMM DB4\6-5.txt'; delimiter = '\t'; startRow = 2; formatSpec = '%f%f%[^\n\r]'; fileID = fopen(filename,'r'); dataArray = textscan(fileID, formatSpec, 'Delimiter', delimiter, 'HeaderLines' ,startRow-1, 'ReturnOnError', false); fclose(fileID); X = dataArray{:, 1}; Y = dataArray{:, 2};
hold on; a=size(I); x=X(:,1); y=Y(:,1); subplot (1,3,2) plot(((a(2)*x)-1),((a(1)*y)-1),'r.','LineWidth',2,'MarkerSize',10) title('Face Coordinates') hold off; subplot(1,3,3) TRI = delaunay((a(2)*x),(a(1)*y)); trimesh(TRI,(a(2)*x),(a(1)*y),zeros(size(x))); view(2) title ('Delaunay Triangulation')
Attached is the picture of the result.

回答 (0 件)

カテゴリ

Help Center および File ExchangeDelaunay Triangulation についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by