File size: 1,127 Bytes
6d3a596
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
tic;
load data45;
mkdir('data45');
path = '.\data45\';



n = 20; %% Number of frames in each mat file.............

for i=1:n

    colorImage = squeeze(color(:,:,:,i));

    depthImage = depth(:,:,i);

    infraredImage = infrared(:,:,i);

    

    ptCloud_c = pcfromkinect(depthDevice, depthImage, colorImage, 'colorCentric');

    ptCloud_d = pcfromkinect(depthDevice, depthImage, colorImage, 'depthCentric');

    ptCloud_ci = pcfromkinect(depthDevice, infraredImage, colorImage, 'colorCentric');

    

    img1 = ptCloud_c.Color; depth1 = uint8(ptCloud_c.Location*256);

    img2 = ptCloud_d.Color; depth2 = uint8(ptCloud_d.Location*256);

    infra1 = uint8(ptCloud_c.Location*256);

    

    file1 = strcat(path,'img',num2str(i),'_cc.png'); file2 = strcat(path,'depth',num2str(i),'_cc.png');

    file3 = strcat(path,'img',num2str(i),'_dc.png'); file4 = strcat(path,'depth',num2str(i),'_dc.png');

    file5 = strcat(path,'infra',num2str(i),'_cc.png');

    

    

    imwrite(img1,file1); imwrite(depth1,file2); 

    imwrite(img2,file3); imwrite(depth2,file4);

    imwrite(infra1, file5);

    i

end



toc;