How can i change ppm image resolution when I using Imread?
Mostrar comentarios más antiguos
For example,
a = imread("xxxx.ppm")
xxxx image resolution has default 255
So when I reading 1023 resolution ppm files, data is forcibly multiplied by 20.
How can I change ppm image resolution when I Using Imread?
please help me,
I'm sorry for the lack of readability because My English skill are not good
Thanks for reading.
3 comentarios
Angelo Yeo
el 3 de Jun. de 2024
I think I need more information.
(1) Can you provide an example "ppm" file and a script for reproduction?
(2) What do you mean by "data is forcibly multiplied by 20"? How did you confirm this?
Maybe I'm misreading things. According to the webdocs, imread() supposedly reduces all PPM files to uint8 output regardless of bitdepth -- but that doesn't seem to actually be true.
% this is uint10-scale data stored at 6B per pixel (uint16)
% this is an ascii-encoded (P3) PPM, which is what you should have
inpict = imread('pep_u10u16.ppm.fakename.txt');
% it's all there
[min(inpict(:)) max(inpict(:))]
% show it (in unit-scale)
imshow(double(inpict)/1023)
So since it works with this image containing uint10-scale data in a uint16 PPM, it's not clear why it wouldn't work with yours, unless I'm misinterpreting what your file is.
Again, you would have to attach the image file for us to know anything about the actual problem. For all I know, the file is being read correctly, but it wasn't written the way you think it was. I suspect they simply weren't written correctly.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
