Advertisement
Guest User

Untitled

a guest
Dec 10th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. % DEI Practical assignment 2018/19
  2. % Objective: 3D HCI Gesture learning
  3.  
  4. %% Acquisition
  5. function sol = funcion(nombre,et)
  6. % load(nombre); % Load dataset
  7. %
  8. % figure;imagesc(scan3d.img(:,:,:,1)); %Show images
  9. %
  10. % scan3dmano = scan3d;
  11. %
  12. % for i = 1:scan3d.numImages
  13. % maskAuxColor = createMaskColor(scan3dmano.img(:,:,:,i),100,250,50,200,50,200);
  14. %
  15. % % Depth direct
  16. % maskAux = createMaskDepth(scan3dmano.depth(:,:,i),800);
  17. %
  18. % % Colour + Depth
  19. % maskC=maskAux & maskAuxColor;
  20. % N = medfilt2(maskC);
  21. %
  22. % s = regionprops(N,'Area','Centroid');
  23. % centro = [0,0];
  24. % for j = 1:size(s)
  25. % if s(j).Area==max([s.Area])
  26. % centro = s(j).Centroid;
  27. % end
  28. % end
  29. %
  30. % imshow(N)
  31. %
  32. % m{i,1} = centro(1);
  33. % m{i,2} = centro(2);
  34. % m{i,3} = et;
  35. %
  36. % end
  37. fid = fopen(nombre);
  38. data = textscan(fid,'%f%f%f%f','HeaderLines',0,'CollectOutput',1);
  39. data = data{:};
  40. fid = fclose(fid);
  41. data(:,1);
  42.  
  43. j=1;
  44. k=1;
  45. coord = [0 0 0];
  46. prof = [0 0 0 0];
  47. for i = 3:size(data)
  48. if data(i,1) == 40
  49.  
  50. else
  51. if mod(i,2) == 1
  52. coord(j,1) = data(i,1);
  53. coord(j,2) = data(i,2);
  54. coord(j,3) = data(i,3);
  55. j = j + 1;
  56. else
  57. prof(k,1) = data(i,1);
  58. prof(k,2) = data(i,2);
  59. prof(k,3) = data(i,3);
  60. prof(k,4) = et;
  61. k = k + 1;
  62. end;
  63.  
  64. end;
  65.  
  66. end;
  67.  
  68. total = [coord prof];
  69. sol=total;
  70. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement