|
|
|
|
@ -1274,8 +1274,11 @@ bool MeshTexture::ListCameraFaces(FaceDataViewArr& facesDatas, float fOutlierThr
@@ -1274,8 +1274,11 @@ bool MeshTexture::ListCameraFaces(FaceDataViewArr& facesDatas, float fOutlierThr
|
|
|
|
|
int faceCount = 0; |
|
|
|
|
|
|
|
|
|
for (unsigned int faceId : regionFaces) { // 修改为 unsigned int
|
|
|
|
|
if (faceId < faceColorsGaussian.size()) { |
|
|
|
|
Mesh::Color gaussianColor = faceColorsGaussian[faceId]; |
|
|
|
|
printf("faceId=%d, faceColorsGaussian.size=%d\n", faceCount, faceColorsGaussian.size()); |
|
|
|
|
// 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; |
|
|
|
|
sumG += gaussianColor.g; |
|
|
|
|
sumB += gaussianColor.b; |
|
|
|
|
@ -1283,6 +1286,8 @@ bool MeshTexture::ListCameraFaces(FaceDataViewArr& facesDatas, float fOutlierThr
@@ -1283,6 +1286,8 @@ bool MeshTexture::ListCameraFaces(FaceDataViewArr& facesDatas, float fOutlierThr
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
printf("faceCount=%d\n", faceCount); |
|
|
|
|
|
|
|
|
|
if (faceCount > 0) { |
|
|
|
|
MeshColor avgColor( |
|
|
|
|
static_cast<unsigned char>(sumR / faceCount), |
|
|
|
|
@ -1664,9 +1669,10 @@ bool MeshTexture::ListCameraFaces(FaceDataViewArr& facesDatas, float fOutlierThr
@@ -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]);
|
|
|
|
|
Color imageColor = Color(imageData.image(j,i)); |
|
|
|
|
// 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
@@ -1694,6 +1700,13 @@ bool MeshTexture::ListCameraFaces(FaceDataViewArr& facesDatas, float fOutlierThr
|
|
|
|
|
#endif |
|
|
|
|
// 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 |
|
|
|
|
bool bFilter = (colorDistance > threshold) ? true : false; |
|
|
|
|
@ -1735,7 +1748,7 @@ bool MeshTexture::ListCameraFaces(FaceDataViewArr& facesDatas, float fOutlierThr
@@ -1735,7 +1748,7 @@ bool MeshTexture::ListCameraFaces(FaceDataViewArr& facesDatas, float fOutlierThr
|
|
|
|
|
if (g_colorComparisonFace) { |
|
|
|
|
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
@@ -10351,7 +10364,8 @@ void MeshTexture::GenerateTexture(bool bGlobalSeamLeveling, bool bLocalSeamLevel
|
|
|
|
|
std::vector<std::vector<cv::Point>> contours = {trianglePoints}; |
|
|
|
|
// 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]);
|
|
|
|
|
Mesh::Color originalColor= faceOriginalColors[idxFace]; |
|
|
|
|
// printf("idxFace(%d) originalColor:%d, %d, %d\n", idxFace, originalColor[0], originalColor[1], originalColor[2]);
|
|
|
|
|
|