|
@@ -102,13 +102,13 @@ const calcScores = (data, target) => {
|
|
|
const deltaVec = centroid.map((c, i) => c - target.vector[i]);
|
|
|
const psiVec = stddev.map((s, i) => Math.hypot(s, deltaVec[i]));
|
|
|
const psi = Math.hypot(...psiVec);
|
|
|
- const theta = Math.acos(Math.min(1, vectorDot(tilt, target.unit))) * rad2deg;
|
|
|
+ const theta = Math.acos(Math.min(1, vectorDot(tilt, target.unit)));
|
|
|
const deltaC = chromaMean - target.chroma;
|
|
|
const deltaH = Math.abs(hue - target.hue) * rad2deg;
|
|
|
|
|
|
return {
|
|
|
...data,
|
|
|
- geoDiff: psi * theta,
|
|
|
+ arcDiff: psi * theta * 100,
|
|
|
|
|
|
psi,
|
|
|
psiVec,
|
|
@@ -117,7 +117,7 @@ const calcScores = (data, target) => {
|
|
|
psiB: psiVec[2],
|
|
|
psiC: Math.hypot(chromaDev, deltaC),
|
|
|
|
|
|
- theta,
|
|
|
+ theta: theta * rad2deg,
|
|
|
|
|
|
delta: Math.hypot(...deltaVec),
|
|
|
deltaVec,
|
|
@@ -503,9 +503,11 @@ const model = {
|
|
|
sortUseClusterProportion && (({ clusters }, i) => clusters[i].proportion),
|
|
|
sortUseInvClusterProportion && (({ clusters }, i) => clusters[i].inverseProportion)
|
|
|
);
|
|
|
+ const usingCluster =
|
|
|
+ sortUseBestCluster || sortUseClusterProportion || sortUseInvClusterProportion;
|
|
|
const getSortScore = (scores, i) =>
|
|
|
(sortUseWholeImage ? scores.total[metric] : 0) +
|
|
|
- getSortScoreClusterFactors(scores, i);
|
|
|
+ (usingCluster ? getSortScoreClusterFactors(scores, i) : 0);
|
|
|
|
|
|
Object.entries(metricScores).forEach(([name, scores]) => {
|
|
|
objectiveValues[name] = getSortScore(scores, bestClusterIndices[name]);
|