the image size in matlab now equal the actual size at computer

4 visualizaciones (últimos 30 días)
Abdullah
Abdullah el 31 de Mzo. de 2017
Comentada: Abdullah el 31 de Mzo. de 2017
Hell My issue is when I use imread to any image then i type whos it gives me the image size by Bytes but its not equal to the actual image size at the computer, its always bigger.
  1 comentario
Jan
Jan el 31 de Mzo. de 2017
Editada: Jan el 31 de Mzo. de 2017
Yes, hell you are right. ;-) What exactly is your question?

Iniciar sesión para comentar.

Respuesta aceptada

KSSV
KSSV el 31 de Mzo. de 2017
You see when you read the image using imread, what you have in hand is a RGB matrix or binary matrix depending on the image read. The data has the pixel values of the image and these are numbers either in double or uint. When you type whos matlab shows the Bytes size of this matrix. The sizes which you are comparing are obviously different. If you want to get the size of image in matlab...try
info = dir('my image')
info will be a structure, check bytes there. This is the size which you are looking.

Más respuestas (2)

Jan
Jan el 31 de Mzo. de 2017
Editada: Jan el 31 de Mzo. de 2017
Correct. This is the purpose of the whos command. It shows the memory used for storing a variable. This is the number of elements multiplied by the number of bytes per element. For cells this is the number of elements multiplied by the byte size of a pointer.
Therefore the size shown by whos is expected to be larger than the number of elements.
If you want to get the size in pixels, use size. If you want the file size, see KSSV's answer.

Abdullah
Abdullah el 31 de Mzo. de 2017
thanks a lot @KSSV it did solve the problem

Categorías

Más información sobre Image Processing Toolbox en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by