save from .jpg to .txt

2 次查看(过去 30 天)
Tulips
Tulips 2012-7-6
hi,can I know how to save .jpg file that contains pixels value to a .txt file. fyi, i'm not sure why my .txt file is empty after I save as .txt file and also use ascii syntax.thanks!

回答(1 个)

Walter Roberson
Walter Roberson 2012-7-7
MyImage = imread('MyJPEG.jpg');
save( 'MyTextJPEG.txt', 'MyImage', -ascii );
  1 个评论
Ravi Rahul Kumar Shah
it should be
MyImage = imread('MyJPEG.jpg');
save( 'MyTextJPEG.txt', 'MyImage', '-ascii' );

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Low-Level File I/O 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by