Browse Source

업데이트 'step1_parse_video.m'

Hio-Been Han 6 months ago
parent
commit
b0d1920f17
1 changed files with 1 additions and 63 deletions
  1. 1 63
      step1_parse_video.m

+ 1 - 63
step1_parse_video.m

@@ -13,7 +13,7 @@ if nargin < 1, resize_shape = [448 448]; end
 if nargin < 2, crop_flag = false; end
 
 %% (1) Get file info & set save directory
-[file_list, vid_directory] = uigetfile('*.mp4','MultiSelect','on');
+[file_list, vid_directory] = uigetfile('*.*','MultiSelect','on');
 if ischar(file_list),  file_list = {file_list}; end
 img_directory = [ 'data/frames/'];
 if ~isdir(img_directory), mkdir(img_directory); end
@@ -62,65 +62,3 @@ for fileIdx = 1:length(file_list)
 end
 end
 
-%% Subfunc
-function mask = image_ROI_selection(I, textInput)
-if nargin == 1, textInput = ''; end
-figure(1), set(gcf, 'Color', [1 1 1]);
-colormap(gray);
-imshow(uint8(I), 'DisplayRange', [], 'InitialMagnification',600/max(size(I))*100 );
-title( textInput )
-
-%%-- Display instructions to user
-%title('click points to make an initial contour, right click to close contour and finish');
-disp('click points to make an initial contour,');
-disp('right click to close contour and finish');
-
-%%-- begin getting points
-[y1 x1 b] = ginput(1);
-xi = x1;
-yi = y1;
-if(b ~= 1) return; end
-
-[ny nx c] = size(I);
-mask = zeros(ny,nx);
-
-while(1)
-    x2 = x1;  y2 = y1;
-    [y1 x1 b] = ginput(1);
-    if(b ~= 1),  x1 = xi;  y1 = yi;   end
-    lx = x2-x1;  ly = y2-y1;
-    len = ceil((lx^2+ly^2)^(1/2))+1;
-    x = round(x1:(lx)/(len-1):x2);    y = round(y1:(ly)/(len-1):y2); %make another one for y
-    if(length(x) == 0),  x = round(x1) * ones(1,len); end
-    if(length(y) == 0)
-        y = round(y1) * ones(1,len);
-    end
-    
-    this_index2 = sub2ind(size(mask),x, y);
-    if size(this_index2) == [1 1]
-        title('Try Again!', 'FontSize', 18)
-        sprintf Try_Again!
-    end
-    
-    try    mask(this_index2) = 1; end
-    idx = find(mask==1);
-    backup_mask = mask;
-    %%-- draw the users line in the image (color or grayscale)
-    if(c-1)
-        Ir = I(:,:,1); Ig = I(:,:,2); Ib = I(:,:,3);
-        Ir(idx) = 0;
-        Ig(idx) = 255;
-        Ib(idx) = 0;
-        I(:,:,1) = Ir; I(:,:,2) = Ig; I(:,:,3) = Ib;
-    else
-        I(idx) = 255;
-    end
-    imshow(uint8(I),'DisplayRange', [], 'InitialMagnification', 600/max(size(I))*100);
-    title( textInput )
-    if(b ~= 1) break; end
-end
-
-mask = bwfill(mask, 'holes');
-% mask = ~mask;
-end
-