Guest User

Untitled

a guest
Jan 19th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. function [input network] = CreateNetwork( path, width, height )
  2. %CREATENETWORK Summary of this function goes here
  3. % Detailed explanation goes here
  4. img = imread(path);
  5. img = 1-im2double(img(:,:,1));
  6. img = img == 1;
  7.  
  8. colormap(gray);
  9. img = 1-img;
  10. imagesc(img);
  11.  
  12. tileW = size(img, 2) / width;
  13. tileH = size(img, 1) / height;
  14.  
  15. cols = (im2col(img, [round(tileH) round(tileW)],'distinct'));
  16.  
  17. input = unique(cols', 'rows', 'stable')';
  18. T = input * 2 - 1;
  19.  
  20. network = newhop(T);
  21.  
  22. end
Add Comment
Please, Sign In to add comment