mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Test with fixed initial colors
This commit is contained in:
parent
10bfcb00b7
commit
adf6dece20
@ -524,6 +524,19 @@ namespace hyperion
|
||||
ColorCluster<ColorRgbScalar> clusters[CLUSTER_COUNT];
|
||||
|
||||
// initial cluster colors
|
||||
switch (CLUSTER_COUNT) {
|
||||
case 4:
|
||||
clusters[4].newColor = ColorRgbScalar(ColorRgb::YELLOW);
|
||||
case 3:
|
||||
clusters[3].newColor = ColorRgbScalar(ColorRgb::RED);
|
||||
case 2:
|
||||
clusters[2].newColor = ColorRgbScalar(ColorRgb::WHITE);
|
||||
case 1:
|
||||
clusters[1].newColor = ColorRgbScalar(ColorRgb::GREEN);
|
||||
case 0:
|
||||
clusters[0].newColor = ColorRgbScalar(ColorRgb::BLACK);
|
||||
break;
|
||||
default:
|
||||
for(int k = 0; k < CLUSTER_COUNT; ++k)
|
||||
{
|
||||
int randomRed = rand() % static_cast<int>(256);
|
||||
@ -532,6 +545,8 @@ namespace hyperion
|
||||
|
||||
clusters[k].newColor = ColorRgbScalar(randomRed, randomGreen, randomBlue);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// k-means
|
||||
double min_rgb_euclidean {0};
|
||||
|
Loading…
x
Reference in New Issue
Block a user