标签:
cd cd D:\Projects_Face_Detection\Datasets\afw
d:
dir /b/s/p/w *jpg > Path_Images.txt
1.ground_truth矩阵转pts文件
shape = phisTr; for i = 1:1345 imgpathlistfile = strcat(‘C:\Users\Administrator\Desktop\COFW\‘,int2str(i), ‘.pts‘); file = fopen(imgpathlistfile,‘w‘); fprintf(file,‘%s\n‘,‘version: 1‘); fprintf(file,‘%s\n‘,‘n_points: 29‘); fprintf(file,‘%s\n‘,‘{‘); for j = 1:29 fprintf(file, ‘%f\t‘, shape(i, j)); fprintf(file, ‘%f\n‘, shape(i, 29+j)); end fprintf(file,‘}‘); fclose(file); end
2.raw2bmp
% fid = fopen(‘w-041-14.raw‘, ‘r‘); % data = fread(fid, ‘*uint8‘); % image = reshape(data, 768, 576, 3); % image = imrotate(image, -90); % imshow(image); % imwrite(image, ‘m-001-1.bmp‘); imgpathlistfile = strcat(‘D:\AR database\dbf1‘, ‘\1.txt‘); imgpathlist = textread(imgpathlistfile, ‘%s‘, ‘delimiter‘, ‘\n‘); for i = 1:length(imgpathlist) fid = fopen(imgpathlist{i}, ‘r‘); data = fread(fid, ‘*uint8‘); image = reshape(data, 768, 576, 3); image = imrotate(image, -90); imgename = strcat(imgpathlist{i}(1:end-3), ‘bmp‘); imwrite(image, imgename); end
标签:
原文地址:http://www.cnblogs.com/xuanyuyt/p/4680993.html