没有高斯颜色的时候测试
This commit is contained in:
1 parent
497f7b619b
commit
3f4decc2fe
1 file changed
+20
-6
@@ -1274,14 +1274,19 @@ bool MeshTexture::ListCameraFaces(FaceDataViewArr& facesDatas, float fOutlierThr
|
|||||||
int faceCount = 0;
|
int faceCount = 0;
|
||||||
|
|
||||||
for (unsigned int faceId : regionFaces) { // 修改为 unsigned int
|
for (unsigned int faceId : regionFaces) { // 修改为 unsigned int
|
||||||
if (faceId < faceColorsGaussian.size()) {
|
printf("faceId=%d, faceColorsGaussian.size=%d\n", faceCount, faceColorsGaussian.size());
|
||||||
Mesh::Color gaussianColor = faceColorsGaussian[faceId];
|
// if (faceId < faceColorsGaussian.size())
|
||||||
|
{
|
||||||
|
// Mesh::Color gaussianColor = faceColorsGaussian[faceId];
|
||||||
|
Mesh::Color gaussianColor = Mesh::Color(0.0,0.0,0.0,1.0);
|
||||||
sumR += gaussianColor.r;
|
sumR += gaussianColor.r;
|
||||||
sumG += gaussianColor.g;
|
sumG += gaussianColor.g;
|
||||||
sumB += gaussianColor.b;
|
sumB += gaussianColor.b;
|
||||||
faceCount++;
|
faceCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printf("faceCount=%d\n", faceCount);
|
||||||
|
|
||||||
if (faceCount > 0) {
|
if (faceCount > 0) {
|
||||||
MeshColor avgColor(
|
MeshColor avgColor(
|
||||||
@@ -1664,9 +1669,10 @@ bool MeshTexture::ListCameraFaces(FaceDataViewArr& facesDatas, float fOutlierThr
|
|||||||
//*/
|
//*/
|
||||||
//*
|
//*
|
||||||
|
|
||||||
if (idxFace<faceColorsGaussian.size())
|
// if (idxFace<faceColorsGaussian.size())
|
||||||
{
|
{
|
||||||
Mesh::Color gaussianColor = faceColorsGaussian[idxFace];
|
// Mesh::Color gaussianColor = faceColorsGaussian[idxFace];
|
||||||
|
Mesh::Color gaussianColor = Mesh::Color(0.0,0.0,0.0,1.0);
|
||||||
// printf("idxFace(%d) gaussianColor:%d, %d, %d\n", idxFace, gaussianColor[0], gaussianColor[1], gaussianColor[2]);
|
// printf("idxFace(%d) gaussianColor:%d, %d, %d\n", idxFace, gaussianColor[0], gaussianColor[1], gaussianColor[2]);
|
||||||
Color imageColor = Color(imageData.image(j,i));
|
Color imageColor = Color(imageData.image(j,i));
|
||||||
// printf("idxFace(%d) imageColor:%f, %f, %f\n", idxFace, imageColor[0], imageColor[1], imageColor[2]);
|
// printf("idxFace(%d) imageColor:%f, %f, %f\n", idxFace, imageColor[0], imageColor[1], imageColor[2]);
|
||||||
@@ -1694,6 +1700,13 @@ bool MeshTexture::ListCameraFaces(FaceDataViewArr& facesDatas, float fOutlierThr
|
|||||||
#endif
|
#endif
|
||||||
// continue;
|
// continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float brightnessPerceptual = (0.299f * originalMeshColor.r + 0.587f * originalMeshColor.g + 0.114f * originalMeshColor.b) / 255.0f;
|
||||||
|
// printf("brightnessPerceptual=%f\n", brightnessPerceptual);
|
||||||
|
|
||||||
|
if (brightnessPerceptual>0.4f)
|
||||||
|
continue;
|
||||||
|
|
||||||
//*/
|
//*/
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
bool bFilter = (colorDistance > threshold) ? true : false;
|
bool bFilter = (colorDistance > threshold) ? true : false;
|
||||||
@@ -1735,7 +1748,7 @@ bool MeshTexture::ListCameraFaces(FaceDataViewArr& facesDatas, float fOutlierThr
|
|||||||
if (g_colorComparisonFace) {
|
if (g_colorComparisonFace) {
|
||||||
testFacePixelsByView[idxView][idxFace].push_back(cv::Point(i, j));
|
testFacePixelsByView[idxView][idxFace].push_back(cv::Point(i, j));
|
||||||
|
|
||||||
printf("testFacePixels imageView(%s), idxFace(%d) push_back (%d, %d)\n", filename.c_str(), idxFace, i, j);
|
// printf("testFacePixels imageView(%s), idxFace(%d) push_back (%d, %d)\n", filename.c_str(), idxFace, i, j);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -10351,7 +10364,8 @@ void MeshTexture::GenerateTexture(bool bGlobalSeamLeveling, bool bLocalSeamLevel
|
|||||||
std::vector<std::vector<cv::Point>> contours = {trianglePoints};
|
std::vector<std::vector<cv::Point>> contours = {trianglePoints};
|
||||||
// cv::fillPoly(patch, contours, cv::Scalar(0, 0, 0));
|
// cv::fillPoly(patch, contours, cv::Scalar(0, 0, 0));
|
||||||
|
|
||||||
Mesh::Color gaussianColor = faceColorsGaussian[idxFace];
|
// Mesh::Color gaussianColor = faceColorsGaussian[idxFace];
|
||||||
|
Mesh::Color gaussianColor = Mesh::Color(0.0,0.0,0.0,1.0);
|
||||||
// printf("idxFace(%d) gaussianColor:%d, %d, %d\n", idxFace, gaussianColor[0], gaussianColor[1], gaussianColor[2]);
|
// printf("idxFace(%d) gaussianColor:%d, %d, %d\n", idxFace, gaussianColor[0], gaussianColor[1], gaussianColor[2]);
|
||||||
Mesh::Color originalColor= faceOriginalColors[idxFace];
|
Mesh::Color originalColor= faceOriginalColors[idxFace];
|
||||||
// printf("idxFace(%d) originalColor:%d, %d, %d\n", idxFace, originalColor[0], originalColor[1], originalColor[2]);
|
// printf("idxFace(%d) originalColor:%d, %d, %d\n", idxFace, originalColor[0], originalColor[1], originalColor[2]);
|
||||||
|
|||||||
Reference in new issue
Block a user