Plotting Delaunay Triangulation Upright
조회 수: 1 (최근 30일)
이전 댓글 표시
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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Delaunay Triangulation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!