Created
June 6, 2018 13:50
-
-
Save zhulianhua/5e07a0d794eedaab6bdfef3329379822 to your computer and use it in GitHub Desktop.
matlab 图像二进制化并保存为ASCII文件
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IMG = imread('xxx.jpg'); % image data | |
L = im2bw(IMG); % image data to logical data | |
I = int8(L); % convert to 8 bit integer | |
dlmwrite('data.dat', I, ' ') % write ascii file, using space(' ') as delimeter | |
% open data.dat to view it |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I = fliplr(I);
or
I = flipud(I);
or
I = rot90(I);