imwrite doesnt work help
1 回表示 (過去 30 日間)
古いコメントを表示
Hi,
I have a grayscale image with size '3520x4280 uint8'. Now I want to compress this image with imwrite by using 'Compression' tool. I call;
imwrite(image1,'test.jpg','Compression','rle');
However I get this error message:
Error using writejpg>set_jpeg_props (line 173)
Expected input to match one of these strings:
quality, comment, bitdepth, mode
The input, ''compression'', did not match any of the valid strings.
Error in writejpg (line 50)
props = set_jpeg_props(data,varargin{:});
Error in imwrite (line 473)
feval(fmt_s.write, data, map, filename, paramPairs{:});
I use MatlabR2013a. Does anyone know what I missed? Thanks a lot
0 件のコメント
回答 (1 件)
Steven Lord
2016 年 9 月 23 日
Looking at the documentation for imwrite it appears that the 'Compression' parameter is only supported with HDF5 or TIFF, and only HDF5 supports 'rle' compression. My guess is that you tried to adapt an example that wrote an HDF5 file to write a .jpg file, but forgot or didn't realize that you needed to remove the 'Compression' arguments.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で HDF5 についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!