Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- files = dir('images/*.bmp');
- for file = files'
- i = imread(strcat('images/',file.name));
- file.name
- [r, c] = size(i);
- a = zeros(r/2, c/2);
- for x=2:2:r,
- for y=2:2:c,
- if i(x,y) > 100,
- a(x/2,y/2) = 255;
- else
- a(x/2,y/2) = 0;
- end;
- end;
- end;
- imwrite(logical(a), strcat('images/Converted/',file.name));
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement