interpretation of imread output array values

조회 수: 10 (최근 30일)
Timothy Dunning
Timothy Dunning 2023년 2월 22일
편집: DGM 2023년 2월 22일
hi, I'm trying to use imread to get an array representation of an image, then search that array for places where a specific colour occurs. I can't seem to find any doumentation on how the double, presented in the array, represents the colour at that location. How do I know which number represents which colour so that i can search for it?
  댓글 수: 7
Stephen23
Stephen23 2023년 2월 22일
"True, but imread() doesn't support indexed images in JPG or JP2."
Could you please show a reference to indexed JPG and JP2 image formats.
I do not see how spatial image compression using frequencies/wavelets could be indexed.
DGM
DGM 2023년 2월 22일
편집: DGM 2023년 2월 22일
It doesn't make sense to me either, and likewise, I can't find any mention of such a thing existing
... except the statement from the webdocs:
Indexed JPEG 2000 images are not supported. Only JP2 compatible color spaces are supported for JP2/JPX files. By default, all image channels are returned in the order they are stored in the file.
Which seems to suggest that maybe there exist some non-compliant files that are indexed. I don't know why else they'd point out that imread() can't read such a thing.
Even if this is all just a poorly-worded comment about being incompatible with things that don't exist, I tried to to phrase my original statement to be safe either way.

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

채택된 답변

Timothy Dunning
Timothy Dunning 2023년 2월 22일
The file is an RGB .jpg and it produces a 3D array where each value is a uint8 in the range 0-255 representing the rgb colour scale. Thanks for the help.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by