필터 지우기
필터 지우기

ColorChecker function does not work?

조회 수: 12 (최근 30일)
Roger Breton
Roger Breton 2024년 1월 30일
댓글: Roger Breton 2024년 1월 30일
I am trying to follow the example here:
I use this code:
cfa = rawread("DSC_0136.NEF");
J = demosaic(cfa,"rggb");
A_sRGB = lin2rgb(J);
montage({J,A_sRGB})
title("Original Image Before and After Gamma Correction")
chart_sRGB = colorChecker(A_sRGB);
% chart_sRGB = colorChecker(rgb, sensitivity=0);
DisplayChart(chart_sRGB)
But I keep running into this error:
Error using colorChecker
Color patches were not detected. Try adjusting the Sensitivity parameter or turning off the Downsample parameter.
This is my test NEF:
Why is the functioon failing?
I tried varying the sensitivity from 0 to 1 and turning downsampling off to no avail.
Is the function not designed to operate on a picture of the chart that's full-frame?
  댓글 수: 10
Roger Breton
Roger Breton 2024년 1월 30일
From the ColorChecker documentation, I discovered that it was possible to manually detect the chart by supplying the corner points? So I used the MathWorks ColorChecker chart that "works", giving this output:
chart =
colorChecker with properties:
Image: [876×1312×3 uint8]
RegistrationPoints: [4×2 double]
ColorROIs: [24×1 struct]
... to try to "reverse-engineer" the chart object?
I imported the image into Adobe Illustrator and looked up the "RegistrationPoints" array onto the image. Using these coordinates, I tried to create the chart object using this code:
cornerPoints = [1113,632;638,636;632,323;1110,320];
chart = colorChecker(rgbImage,"RegistrationPoints",cornerPoints);
This method may not be elegant but if it allows me to experiment with the more advanced functions I want to get at like "measure WhiteBalance", it's worth the effort! So here is my result:
I should not have to work this hard...
Roger Breton
Roger Breton 2024년 1월 30일
The RegistrationPoints order is:
[Lower Right X, Lower Right Y; Lower Left X, Lower Left Y; Upper Left X, Upper Left Y; Upper Right X, Upper Right Y]

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

답변 (0개)

태그

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by