imwrite fails for small images less than 64 rows high
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Varun Munjal
am 30 Jun. 2014
Beantwortet: Anand
am 1 Jul. 2014
If I create an unsigned 16 bit array which is greater than 8192 columns wide and try to write it as a tiff image, it seems like it needs to be at least 64 rows high or Matlab 2014a throws an exception. To get around it, the 'RowsPerStrip' tag needs to be set manually to an integer value.
e.g:
x = ones([63 8192], 'uint16');
imwrite(x, 'C:\test\test.tif', 'tiff', 'Compression', 'none');
works fine.
BUT:
x = ones([63 8193], 'uint16');
imwrite(x, 'C:\test\test.tif', 'tiff', 'Compression', 'none');
gives an exception:
Error using wtifc
TIFF library error - '_TIFFVSetField: 4x8000.tif: Bad value 0 for "RowsPerStrip" tag.'
HOWEVER:
x = ones([64 8193], 'uint16');
imwrite(x, 'C:\test\test.tif', 'tiff', 'Compression', 'none');
works fine.
ALSO:
x = ones([63 8193], 'uint16');
imwrite(x, 'C:\test\test.tif', 'tiff', 'Compression', 'none', 'RowsPerStrip', 16);
works fine.
This was not a problem in 2011b
0 Kommentare
Akzeptierte Antwort
Anand
am 1 Jul. 2014
This looks like a bug.
Please contact MathWorks Tech Support by creating a Service Request:
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Hamamatsu Hardware finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!