Depth2HHA
Depth2HHA copied to clipboard
【Code Share】transfer dataset to depth image and rawdepth image
trafficstars
I'd like to share some code.
nyufile = fullfile('dataset/', 'nyu_depth_v2_labeled.mat');
outDir = fullfile('output/', 'sgupta', 'datasets', 'nyud2', 'datacopy');
mkdir(fullfile(outDir, 'rawdepth'));
mkdir(fullfile(outDir, 'depth'));
mkdir(fullfile(outDir, 'images'));
dt = load(nyufile, 'rawDepths');
for i = 1:1449,
imwrite(uint16(cropIt(dt.rawDepths(:,:,i))*1000), fullfile(outDir, 'rawdepth', sprintf('img_%04d.png', i + 5000)));
end
dt = load(nyufile, 'depths');
for i = 1:1449,
imwrite(uint16(cropIt(dt.depths(:,:,i))*1000), fullfile(outDir, 'depth', sprintf('img_%04d.png', i + 5000)));
end
dt = load(nyufile, 'images');
for i = 1:1449,
imwrite(uint8(cropIt(dt.images(:,:,:,i))), fullfile(outDir, 'images', sprintf('img_%04d.png', i + 5000)));
end
I'd like to share some code.
nyufile = fullfile('dataset/', 'nyu_depth_v2_labeled.mat'); outDir = fullfile('output/', 'sgupta', 'datasets', 'nyud2', 'datacopy'); mkdir(fullfile(outDir, 'rawdepth')); mkdir(fullfile(outDir, 'depth')); mkdir(fullfile(outDir, 'images')); dt = load(nyufile, 'rawDepths'); for i = 1:1449, imwrite(uint16(cropIt(dt.rawDepths(:,:,i))*1000), fullfile(outDir, 'rawdepth', sprintf('img_%04d.png', i + 5000))); end dt = load(nyufile, 'depths'); for i = 1:1449, imwrite(uint16(cropIt(dt.depths(:,:,i))*1000), fullfile(outDir, 'depth', sprintf('img_%04d.png', i + 5000))); end dt = load(nyufile, 'images'); for i = 1:1449, imwrite(uint8(cropIt(dt.images(:,:,:,i))), fullfile(outDir, 'images', sprintf('img_%04d.png', i + 5000))); end
yes,this is better than old.i work it with this code!