
num_cluster = 12;
T = cluster(Z, 'maxclust', num_cluster);
for i = 1 : num_cluster
    mkdir(['J:\Research\papers\TPAMI11\experiment\atomic_pose\', num2str(i)]);
end

for i = 1 : length(T)
    disp(i);
    im = imread(imgfilepath{i});
    imwrite(im, ['J:\Research\papers\TPAMI11\experiment\atomic_pose\', num2str(T(i)), '\', imgfilename{i}]);
end

for i = 1 : num_cluster
    disp(num2str(length(find(T == i))));
end