tuttelikz

Get parameters first [+++]

Sep 1st, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.93 KB | None | 0 0
  1. clear all; close all; clc;
  2.  
  3. OpenfilePath = 'C:\Users\TBL\Documents\MATLAB\1708_AMORE\10_MR\backhand';
  4. SavefilePath = 'C:\Users\TBL\Documents\MATLAB\1708_AMORE\10_MR\backhand';
  5. max_step = 500;
  6. read_file_name = 'Image0001.jpg';
  7. img = imread([OpenfilePath,'\' ,read_file_name]);
  8. %img = imread('Image0499.jpg');
  9.  
  10. %img = rgb2gray(img);
  11. %imshow(img);
  12. [H,W] = size(img);
  13.  
  14. %% Parameters setup
  15. [lm,li] = max(img(5:H,51:W));
  16. minDepth = min(li)
  17. maxDepth = max(li)
  18. %%
  19.  
  20. diff = 20; %it was 2
  21. l_crop = 70;
  22. r_crop = 1;
  23. t_crop = 14+minDepth-0.75.*minDepth;
  24. b_crop = 0.75*(H-maxDepth);
  25. %b_crop = 2*minDepth;
  26. %%
  27. up = H-2;%443
  28. gsigma = 4;
  29. down = 222;
  30. % %% Preprocessing
  31. [img_crop,H_crop,W_crop] = crop(img,H,W,l_crop,r_crop,t_crop,b_crop);
  32. % imshow(img_crop)
  33. % imshow(img_crop)
  34.  
  35. %%
  36. [lm,li] = max(img_crop(:,1));
  37. [rm,ri] = max(img_crop(:,W_crop));
  38. li
  39. ri
  40. %shif = ri-li;
  41. %rotDeg = atand(shif/W_crop)
Advertisement
Add Comment
Please, Sign In to add comment