NEW:active "import obj color" in command line

jira: none
Change-Id: I8bc5d4a1eea116305037b8194ff1d2e8aab83ce9
(cherry picked from commit 7df9f9d27d174b30a54ed27756d4a4a157557019)
(cherry picked from commit b97d44dae4854c342b835d3fd5265a22aec5d174)
This commit is contained in:
zhou.xu
2024-06-18 17:25:12 +08:00
committed by Noisyfox
parent b54c5769ff
commit cfa00b938f
10 changed files with 77 additions and 44 deletions

View File

@@ -243,6 +243,7 @@ set(lisbslic3r_sources
Arrange.cpp
NormalUtils.cpp
NormalUtils.hpp
ObjColorUtils.cpp
ObjColorUtils.hpp
Orient.hpp
Orient.cpp

View File

@@ -0,0 +1,14 @@
#include "ObjColorUtils.hpp"
bool obj_color_deal_algo(std::vector<Slic3r::RGBA> & input_colors,
std::vector<Slic3r::RGBA> & cluster_colors_from_algo,
std::vector<int> & cluster_labels_from_algo,
char & cluster_number)
{
QuantKMeans quant(10);
quant.apply(input_colors, cluster_colors_from_algo, cluster_labels_from_algo, (int) cluster_number);
if (cluster_number == -1) {
return false;
}
return true;
}

View File

@@ -3,7 +3,7 @@
#include <ctime>
#include "opencv2/opencv.hpp"
#include "libslic3r/Color.hpp"
class QuantKMeans
{
public:
@@ -260,3 +260,8 @@ public:
return image8UC3;
}
};
bool obj_color_deal_algo(std::vector<Slic3r::RGBA> &input_colors,
std::vector<Slic3r::RGBA>& cluster_colors_from_algo,
std::vector<int>& cluster_labels_from_algo,
char & cluster_number);