Help regarding the Munsell and Kubelka-Munk Toolbox - RGB to Munsell conversion

조회 수: 24 (최근 30일)
Hello,
I am currently having trouble, and in need of help.
For some project of mine I am trying to use the Munsell and Kubelka-Munk Toolbox that can be found here https://www.munsellcolourscienceforpainters.com/MunsellAndKubelkaMunkToolbox/MunsellAndKubelkaMunkToolbox.html .
Basically I am trying to convert an rgb combination into a Munsell specification.
However I am retrieving the following error :
"ERROR: No optimal colour file for Illuminant C.
Output argument "InsideLimits" (and maybe others) not assigned during call to "IsWithinMacAdamLimits"."
And as I am very new in the colored image analysis domain, I have no clue as to why am I retrieving such error from the IsWithinMacAdamLimits function.
%some random red picture
sample = imread('my_image_test.jpg');
%Retrieve the averaged rgb data for simplification of the case
r = mean(mean(sample(:,:,1))); g = mean(mean(sample(:,:,2))); b = mean(mean(sample(:,:,3)));
rgb = round([r,g,b]);
%Get the routine to work
[MunsellSpec, MunsellVec, InMacAdamLimitsFlag, Status] = sRGBtoMunsell(rgb);
I would be glad if someone had some insight as to where am I doing things wrong.
Feel free to incquire more information or underline somethings I am not clear about (this is my first time posting on the mathworks forum, so I don't really know the conventions in details).
Thank you for reading me,
P.S.
I know this not a question directly related to Matlab, but probably more related to the fields of colors, but I hoped that perhaps someone already worked with such concepts or even with the toolbox I mentionned.

채택된 답변

Stephen23
Stephen23 2020년 11월 23일
편집: Stephen23 2020년 11월 23일
The function sRGBtoMunsell calls the function xyYtoMunsell which calls the function IsWithinMacAdamLimits . The author wrote some unusual "features" in the code, such as using disp and return instead of actual error or assert calls... but that "error" message (which is not really an error, just some displayed text) is easy to find on line 161. The code around that point makes it clear that the function must load a file named 'OptimalColoursForIlluminantC.txt', and such a file is listed on the page which you linked to. So basically you get the "error" because you are missing a file which that function needs.
Solution: download OptimalColoursForIlluminantC.txt from that page and put in the same location as where you saved those Mfiles.
  댓글 수: 1
Kyop
Kyop 2020년 11월 23일
I see,
I did think that a file was missing at some point but didn't find it when I searched in the code, I guess I didn't look well enough.
Thank you very much for your quick reply and your help!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Subplots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by