Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % DEI Practical assignment 2018/19
- % Objective: 3D HCI Gesture learning
- %% Acquisition
- function sol = funcion(nombre,et)
- % load(nombre); % Load dataset
- %
- % figure;imagesc(scan3d.img(:,:,:,1)); %Show images
- %
- % scan3dmano = scan3d;
- %
- % for i = 1:scan3d.numImages
- % maskAuxColor = createMaskColor(scan3dmano.img(:,:,:,i),100,250,50,200,50,200);
- %
- % % Depth direct
- % maskAux = createMaskDepth(scan3dmano.depth(:,:,i),800);
- %
- % % Colour + Depth
- % maskC=maskAux & maskAuxColor;
- % N = medfilt2(maskC);
- %
- % s = regionprops(N,'Area','Centroid');
- % centro = [0,0];
- % for j = 1:size(s)
- % if s(j).Area==max([s.Area])
- % centro = s(j).Centroid;
- % end
- % end
- %
- % imshow(N)
- %
- % m{i,1} = centro(1);
- % m{i,2} = centro(2);
- % m{i,3} = et;
- %
- % end
- fid = fopen(nombre);
- data = textscan(fid,'%f%f%f%f','HeaderLines',0,'CollectOutput',1);
- data = data{:};
- fid = fclose(fid);
- data(:,1);
- j=1;
- k=1;
- coord = [0 0 0];
- prof = [0 0 0 0];
- for i = 3:size(data)
- if data(i,1) == 40
- else
- if mod(i,2) == 1
- coord(j,1) = data(i,1);
- coord(j,2) = data(i,2);
- coord(j,3) = data(i,3);
- j = j + 1;
- else
- prof(k,1) = data(i,1);
- prof(k,2) = data(i,2);
- prof(k,3) = data(i,3);
- prof(k,4) = et;
- k = k + 1;
- end;
- end;
- end;
- total = [coord prof];
- sol=total;
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement