用MATLAB標人臉特徵點程式碼
阿新 • • 發佈:2019-01-02
function [] = Make1Lndmk( )
Fname='04000_lights_27_01.ppm';
PoseID='27';
TOLNUM=24; % The number of landmarks
cd(['/vol/vssp/3dmm/PIE/',PoseID,'/1']);
tmp=imread(Fname); %read the input image
imshow(tmp);
hold on;
OutLmk= fopen(['~/Desktop/',Fname(1:end-7),'.did'],'w'); %landmark file generated
landmark=[];
for k=1:TOLNUM
a=ginput(1);
landmark=[landmark;a];
plot(a(1),a(2),'r.');
fprintf(OutLmk,'%.2f %.2f\n',a(1),a(2));
end
hold off;
fclose(OutLmk);
figure();
imshow(tmp);
hold on;
for k=1:TOLNUM
plot(landmark(k,1),landmark(k,2),'y*');
text(landmark(k,1),landmark(k,2),['\color{yellow} ' num2str(k)]);
Fname='04000_lights_27_01.ppm';
PoseID='27';
TOLNUM=24; % The number of landmarks
cd(['/vol/vssp/3dmm/PIE/',PoseID,'/1']);
tmp=imread(Fname); %read the input image
imshow(tmp);
hold on;
OutLmk= fopen(['~/Desktop/',Fname(1:end-7),'.did'],'w'); %landmark file generated
landmark=[];
for k=1:TOLNUM
a=ginput(1);
landmark=[landmark;a];
plot(a(1),a(2),'r.');
fprintf(OutLmk,'%.2f %.2f\n',a(1),a(2));
end
hold off;
fclose(OutLmk);
figure();
imshow(tmp);
hold on;
for k=1:TOLNUM
plot(landmark(k,1),landmark(k,2),'y*');
text(landmark(k,1),landmark(k,2),['\color{yellow} ' num2str(k)]);
end
cd('~')
print(2,'-dpng','~\abc.png');
end