优化信息
This commit is contained in:
1 parent
e8e84643f6
commit
ebc1cfdf64
3 files changed
+13
-3
No files matched your search
@@ -69,10 +69,11 @@ ColorComparisonFace::ColorComparisonFace(const std::string& dir) : outputDir(dir
|
|||||||
// 添加颜色信息(带图像区域)
|
// 添加颜色信息(带图像区域)
|
||||||
void ColorComparisonFace::addColorInfo(int faceId,
|
void ColorComparisonFace::addColorInfo(int faceId,
|
||||||
const MeshColor& gaussianColor,
|
const MeshColor& gaussianColor,
|
||||||
|
const MeshColor& originalColor,
|
||||||
const cv::Mat& imageRegion,
|
const cv::Mat& imageRegion,
|
||||||
float distance, float threshold,
|
float distance, float threshold,
|
||||||
const std::string& filename) {
|
const std::string& filename) {
|
||||||
ColorInfo info = {faceId, gaussianColor, imageRegion.clone(), distance, threshold, filename};
|
ColorInfo info = {faceId, gaussianColor, originalColor, imageRegion.clone(), distance, threshold, filename};
|
||||||
faceViewColorMap[faceId][filename].push_back(info);
|
faceViewColorMap[faceId][filename].push_back(info);
|
||||||
printf("addColorInfo faceId=%d", faceId);
|
printf("addColorInfo faceId=%d", faceId);
|
||||||
}
|
}
|
||||||
@@ -272,11 +273,17 @@ void ColorComparisonFace::createBatchComparison(int maxBlocksPerRow, int maxFace
|
|||||||
|
|
||||||
// 添加颜色值
|
// 添加颜色值
|
||||||
cv::putText(faceImage,
|
cv::putText(faceImage,
|
||||||
cv::format("Gaussian: R=%d, G=%d, B=%d",
|
cv::format("Gauss: (%d,%d,%d)",
|
||||||
info.gaussianColor[0], info.gaussianColor[1], info.gaussianColor[2]),
|
info.gaussianColor[0], info.gaussianColor[1], info.gaussianColor[2]),
|
||||||
cv::Point(blockX + 10, infoY + 60),
|
cv::Point(blockX + 10, infoY + 60),
|
||||||
cv::FONT_HERSHEY_SIMPLEX, 0.35, cv::Scalar(0, 0, 0), 1);
|
cv::FONT_HERSHEY_SIMPLEX, 0.35, cv::Scalar(0, 0, 0), 1);
|
||||||
|
|
||||||
|
cv::putText(faceImage,
|
||||||
|
cv::format("Orgin: (%d,%d,%d)",
|
||||||
|
info.originalColor[0], info.originalColor[1], info.originalColor[2]),
|
||||||
|
cv::Point(blockX + 140, infoY + 60),
|
||||||
|
cv::FONT_HERSHEY_SIMPLEX, 0.35, cv::Scalar(0, 0, 0), 1);
|
||||||
|
|
||||||
// 添加距离和阈值
|
// 添加距离和阈值
|
||||||
cv::putText(faceImage,
|
cv::putText(faceImage,
|
||||||
cv::format("Distance: %.4f", info.distance),
|
cv::format("Distance: %.4f", info.distance),
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ private:
|
|||||||
struct ColorInfo {
|
struct ColorInfo {
|
||||||
int faceId;
|
int faceId;
|
||||||
MeshColor gaussianColor;
|
MeshColor gaussianColor;
|
||||||
|
MeshColor originalColor;
|
||||||
cv::Mat imageRegion; // 存储实际图像区域
|
cv::Mat imageRegion; // 存储实际图像区域
|
||||||
float distance;
|
float distance;
|
||||||
float threshold;
|
float threshold;
|
||||||
@@ -47,6 +48,7 @@ public:
|
|||||||
// 添加颜色信息(带图像区域)
|
// 添加颜色信息(带图像区域)
|
||||||
void addColorInfo(int faceId,
|
void addColorInfo(int faceId,
|
||||||
const MeshColor& gaussianColor,
|
const MeshColor& gaussianColor,
|
||||||
|
const MeshColor& originColor,
|
||||||
const cv::Mat& imageRegion,
|
const cv::Mat& imageRegion,
|
||||||
float distance, float threshold,
|
float distance, float threshold,
|
||||||
const std::string& filename);
|
const std::string& filename);
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ using namespace MVS;
|
|||||||
#define TEXOPT_INFERENCE_TRWS 2
|
#define TEXOPT_INFERENCE_TRWS 2
|
||||||
#define TEXOPT_INFERENCE TEXOPT_INFERENCE_LBP
|
#define TEXOPT_INFERENCE TEXOPT_INFERENCE_LBP
|
||||||
#define MASK_FACE_OCCLUSION
|
#define MASK_FACE_OCCLUSION
|
||||||
// #define TEST
|
#define TEST
|
||||||
|
|
||||||
// #define USE_CUDA
|
// #define USE_CUDA
|
||||||
|
|
||||||
@@ -1807,6 +1807,7 @@ bool MeshTexture::ListCameraFaces(FaceDataViewArr& facesDatas, float fOutlierThr
|
|||||||
if (g_colorComparisonFace) {
|
if (g_colorComparisonFace) {
|
||||||
g_colorComparisonFace->addColorInfo(idxFace,
|
g_colorComparisonFace->addColorInfo(idxFace,
|
||||||
gaussianMeshColor,
|
gaussianMeshColor,
|
||||||
|
originalColor,
|
||||||
imageRegion,
|
imageRegion,
|
||||||
colorDistance, threshold, filename);
|
colorDistance, threshold, filename);
|
||||||
printf(" ✅ 面 %d 已添加到批处理器\n", idxFace);
|
printf(" ✅ 面 %d 已添加到批处理器\n", idxFace);
|
||||||
|
|||||||
Reference in new issue
Block a user