ColorChecker function does not work?

8 vues (au cours des 30 derniers jours)
Roger Breton
Roger Breton le 30 Jan 2024
Commenté : Roger Breton le 30 Jan 2024
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 commentaires
Roger Breton
Roger Breton le 30 Jan 2024
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 le 30 Jan 2024
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]

Connectez-vous pour commenter.

Réponses (0)

Produits


Version

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by