|
|
|
|
@ -2959,7 +2959,7 @@ void MeshTexture::CreateVirtualFaces6(FaceDataViewArr& facesDatas, FaceDataViewA
@@ -2959,7 +2959,7 @@ void MeshTexture::CreateVirtualFaces6(FaceDataViewArr& facesDatas, FaceDataViewA
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
float maxLuminance = 150.0f; |
|
|
|
|
float minLuminance = 20.0f; |
|
|
|
|
float minLuminance = 80.0f; |
|
|
|
|
if (bHasInvalidView) |
|
|
|
|
{ |
|
|
|
|
if (validViews.size()<=0) |
|
|
|
|
@ -3000,28 +3000,47 @@ void MeshTexture::CreateVirtualFaces6(FaceDataViewArr& facesDatas, FaceDataViewA
@@ -3000,28 +3000,47 @@ void MeshTexture::CreateVirtualFaces6(FaceDataViewArr& facesDatas, FaceDataViewA
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//*
|
|
|
|
|
if (validIndices.empty()) { |
|
|
|
|
for (int n = 0; n < nSize; ++n) { |
|
|
|
|
const Color& viewColor = sortedViews[n].second; |
|
|
|
|
float viewLuminance = MeshTexture::GetLuminance(viewColor); |
|
|
|
|
|
|
|
|
|
if ((viewLuminance<=maxLuminance)&& |
|
|
|
|
(viewLuminance>=minLuminance)){ |
|
|
|
|
validIndices.push_back(n); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//*/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
float maxColorDeviation2 = 0.05f; |
|
|
|
|
if (validIndices.empty()) { |
|
|
|
|
for (int n = 0; n < nSize; ++n) { |
|
|
|
|
const Color& viewColor = sortedViews[n].second; |
|
|
|
|
float colorDistance = cv::norm(avgColor - viewColor); |
|
|
|
|
|
|
|
|
|
if (colorDistance <= maxColorDeviation) { |
|
|
|
|
if (colorDistance <= maxColorDeviation2) { |
|
|
|
|
validIndices.push_back(n); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//*/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
float totalLuminance = MeshTexture::GetLuminance(totalColor); |
|
|
|
|
float avgLuminance = totalLuminance / nSize; |
|
|
|
|
for (int n = 0; n < nSize; ++n) { |
|
|
|
|
const Color& viewColor = sortedViews[n].second; |
|
|
|
|
float viewLuminance = MeshTexture::GetLuminance(viewColor); |
|
|
|
|
float luminanceDistance = cv::norm(avgLuminance - viewLuminance); |
|
|
|
|
// printf("luminanceDistance=%f\n", luminanceDistance);
|
|
|
|
|
|
|
|
|
|
if (luminanceDistance <= maxLuminanceDeviation) { |
|
|
|
|
// validIndices.push_back(n);
|
|
|
|
|
validIndices.push_back(n); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//*/
|
|
|
|
|
|
|
|
|
|
// 如果所有视图都被排除,保留原始平均值
|
|
|
|
|
if (validIndices.empty()) { |
|
|
|
|
@ -3029,17 +3048,6 @@ void MeshTexture::CreateVirtualFaces6(FaceDataViewArr& facesDatas, FaceDataViewA
@@ -3029,17 +3048,6 @@ void MeshTexture::CreateVirtualFaces6(FaceDataViewArr& facesDatas, FaceDataViewA
|
|
|
|
|
// virtualFaceData.color = avgColor;
|
|
|
|
|
// virtualFaceData.quality = avgQuality;
|
|
|
|
|
// virtualFaceData.color = sortedLuminViews[0].second;
|
|
|
|
|
|
|
|
|
|
for (int n = 0; n < nSize; ++n) { |
|
|
|
|
float lumin = sortedLuminViews[n].first; |
|
|
|
|
|
|
|
|
|
if (lumin>=minLuminance&&lumin<=maxLuminance) |
|
|
|
|
{ |
|
|
|
|
// virtualFaceData.quality = avgQuality;
|
|
|
|
|
// virtualFaceData.color = sortedLuminViews[0].second;
|
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
// 使用过滤后的视图重新计算平均值
|
|
|
|
|
|