QiuJueqin / color-correction-toolbox

Camera Color Correction Toolbox
MIT License
65 stars 20 forks source link

Error in ccmtrain.m #1

Closed pjcosta104 closed 2 years ago

pjcosta104 commented 4 years ago

If I try to execute the following MATLAB commands (MAT files are included for your convenience)

load(fullfile(Sdir,'target_responses.mat')); load(fullfile(Sdir,'camera_responses.mat')); [Mcor, scale, predicted_responses, errs_train] = ccmtrain(Target,Reference,'loss','ciede00','bias',false,'targetcolorspace','sRGB','preservewhite',true);

% then I receive the following errors

Error using parseParameterInputsML>findParm (line 166) Unrecognized parameter name: 'PlotFcns'.

Error in parseParameterInputsML (line 44) pidx = findParm(args{k},parms, ...

Error in parseParameterInputsML (line 14) pstruct = parseParameterInputsML(fieldnames(parms),options,args);

Error in coder.internal.parseParameterInputs (line 86) pstruct = parseParameterInputsML(parms,options,varargin);

Error in optimoptions

Error in ccmtrain (line 207) options = optimoptions(@fmincon,...

% If I then remove line 212 if ccmtrain.m, the following error occurs

Unrecognized function or variable 'eml_option'.

Error in optim.coder.validate.checkProducts

Error in fmincon

Error in ccmtrain (line 219) matrix = fmincon(costfun, matrix0(:), [], [], Aeq, beq, [], [], [], options);

% How does one circumvent these errors?

Thank you in advance and sincerely,

Dr. Peter Costa

% P.S. I could not upload the MAT files I wanted to include. Here they are in raw form

Target Target =

0.8627    0.4510    0.5137
0.8627    0.4510    0.5137
0.8745    0.5333    0.6314
0.8863    0.6784    0.7529
0.9961    1.0000    0.9961
0.8824    0.8157    0.8667
0.5529    0.2706    0.3804
0.5569    0.3137    0.4588
0.5647    0.4039    0.5412
0.6275    0.5961    0.7020
0.8118    0.6471    0.7843
0.4745    0.2275    0.3647
0.4902    0.2706    0.4431
0.4980    0.3490    0.5216
0.5569    0.5176    0.6706
0.6863    0.3804    0.6431
0.2353    0.1098    0.2431
0.2431    0.1294    0.2941
0.2471    0.1686    0.3451
0.2627    0.2471    0.4235
0.9176    0.8588    0.7490
0.9137    0.9098    0.5020
0.8706    0.7686    0.8118
0.7137    0.4471    0.3451
0.8902    0.8863    0.8549
0.8902    0.7098    0.3451
0.9176    0.9059    0.6275
0.8157    0.6471    0.7216
0.5725    0.2431    0.1725
0.3725    0.3373    0.2392
0.8667    0.5725    0.1020
0.9059    0.8824    0.4039
0.7529    0.5020    0.6196
0.2235    0.0392    0.0078
0.2235    0.1804    0.0941
0.3647    0.6902    0.7490
0.8510    0.8863    0.9059
0.2549    0.2784    0.3294
0.3373    0.3569    0.4039
0.5569    0.5725    0.6157
0.0353    0.3333    0.3176
0.4431    0.5725    0.8157
0.1490    0.1686    0.2275
0.2078    0.2353    0.2902
0.3608    0.3961    0.4627
0.0118    0.2000    0.1569
0.2275    0.3686    0.7529
0.0745    0.0941    0.1451
0.1059    0.1255    0.1804
0.1922    0.2157    0.2863
0.0078    0.0078    0.0078
0.3294    0.0627    0.1098
0.5804    0.2039    0.4196
0.9176    0.9059    0.6157
0.8980    0.8980    0.3725

Reference Reference =

1.0000    0.2542    0.5333
1.0000    0.2542    0.5271
1.0000    0.3564    0.6795
1.0000    0.5395    0.7913
0.9911    1.0000    0.9911
0.8879    0.7454    0.8550
0.8228    0.1248    0.4020
0.8148    0.1812    0.5089
0.7379    0.2961    0.5906
0.6584    0.5520    0.7379
0.8879    0.5457    0.8148
0.7231    0.0976    0.3916
0.7231    0.1470    0.4969
0.6514    0.2423    0.5776
0.5841    0.4621    0.7157
0.8714    0.2270    0.7084
0.3763    0.0307    0.2747
0.3813    0.0545    0.3467
0.3419    0.1022    0.4020
0.2961    0.2016    0.4851
0.9823    0.8070    0.6939
0.8796    0.9216    0.4397
0.9216    0.7011    0.8148
0.9301    0.3050    0.3467
0.8388    0.7758    0.7231
1.0000    0.6308    0.2346
0.9047    0.8963    0.5520
0.9301    0.5520    0.7454
0.8228    0.0999    0.1946
0.4020    0.3050    0.2086
1.0000    0.4735    0.0086
0.9131    0.8796    0.2747
0.9301    0.3864    0.6654
0.4233         0    0.0356
0.2789    0.1590    0.0802
0.1070    0.7605    0.7605
0.7991    0.8550    0.8963
0.2307    0.2664    0.3467
0.3185    0.3419    0.4233
0.5457    0.5583    0.6308
     0    0.4342    0.3372
0.2789    0.5395    0.8632
0.1248    0.1651    0.2462
0.1812    0.2232    0.3050
0.3372    0.3916    0.4851
     0    0.2747    0.1683
0.0561    0.3419    0.8469
0.0595    0.0887    0.1529
0.0908    0.1195    0.1946
0.1651    0.2086    0.3095
0.0006         0    0.0018
0.5647         0    0.1441
0.8632    0.0437    0.4564
0.9131    0.9047    0.5457
0.8879    0.9387    0.3005
QiuJueqin commented 4 years ago

@pjcosta104 It looks like a version problem. Which version of optimization tool and MATLAB are you using? The code is fine in all my machines with MATLAB higher than r2018a. Or maybe you can try to comment out 'PlotFcns',[] in optimoptions function