필터 지우기
필터 지우기

How 'imread' function works in Matlab?

조회 수: 7 (최근 30일)
Mohammed Sadeq
Mohammed Sadeq 2017년 2월 21일
댓글: Mohammed Sadeq 2017년 2월 22일
Hi,
I am using 'imread' function in Matlab to read images produced by X-Ray CT. Those images are in the greyscale.
When I use the 'imread' function, Matlab returns an array with the same size of the image but with numbers inside the cells (matrix is attached). The number represent a single pixel in that image while the minimum number is 3107 and the maximum is 40899.
I want to know how those numbers are calculated?
Thanks..

채택된 답변

Walter Roberson
Walter Roberson 2017년 2월 22일
The png file you posted is 8 bits per channel, uint8, 3 channel, with a transparency (alpha) channel that is set to all 255 (uint8) which is completely opaque.
The .mat file you posted relates to a different image, and is a matrix of uint16 values.
Are you asking how the uint16 is represented inside the file? If so then the answer is that they are stored in http://stackoverflow.com/questions/2384111/png-file-format-endianness "Network Byte Order", more commonly known as "Big Endian". That is a byte order in which the most significant of the bytes occurs first and then the less significant. That is the opposite of the order used by the x86 architecture, but it is the same as the order reflected by dec2hex and sprintf() with '%x' format.
What do the values correspond to, what units are they? I would put it to you that the images have been extracted from DICOM files without the relevant headers. See http://www.idlcoyote.com/fileio_tips/hounsfield.html
  댓글 수: 1
Mohammed Sadeq
Mohammed Sadeq 2017년 2월 22일
Thanks for your complete answer. I will accept it.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Adam
Adam 2017년 2월 21일
They aren't 'calculated', they are read in from the file as the name 'imread' and the help suggest.
  댓글 수: 2
Mohammed Sadeq
Mohammed Sadeq 2017년 2월 22일
Hi Adam,
If they are read from the image it means that they are calculated (or measured) somehow based on bits in each pixel. The numbers (3107 and 40899) came from somewhere. I want to know from where.
Thanks for your answer..
Adam
Adam 2017년 2월 22일
imread literally reads what is stored in the file. How those numbers were calculated comes from whatever process was used to create the image and save it originally.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by