필터 지우기
필터 지우기

Finding l a b of a specific colour

조회 수: 1 (최근 30일)
Noah Noah
Noah Noah 2022년 3월 15일
답변: Image Analyst 2022년 3월 15일
Hello, I need to know what the respective average l a b components are of a lab colour space of specific colours.
I have white = [255,128,128] and I'm unsure what the lab components are of blue,yellow,green and red.
Could someone help me find out how to get them please?
Thank you.

답변 (1개)

Image Analyst
Image Analyst 2022년 3월 15일
That is not white - it's pink. To get the CIE LAB values, using book formulas, then it depends if your numbers are floating point or integers. If they're doubles, you must divide by 255 (that's why the answer from @_ didn't work).
% If values are doubles, you must get them into a range of 0-1 by dividing by 255:
lab_pink = rgb2lab([255,128,128] / 255)
lab_pink = 1×3
68.2137 48.1889 22.6959
% If values are uint8 then no scaling is needed:
lab_pink = rgb2lab(uint8([255,128,128]))
lab_pink = 1×3
68.2137 48.1889 22.6959

Community Treasure Hunt

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

Start Hunting!

Translated by