skip the check for A channel (#5989)

This commit is contained in:
Xiang Zhang 2020-12-02 11:23:54 -08:00 committed by GitHub
parent cdacee6696
commit b4e6cc59c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -274,6 +274,8 @@ namespace ImageTestHelper {
// So we use error rate.
UINT errors = 0;
for (uint32_t i = 0; i < size; i++, pActualByte++, pExpectedByte++) {
// Only the check the first three channels, which are (B, G, R)
if((i + 1) % 4 == 0) continue;
auto diff = (*pActualByte - *pExpectedByte);
if (diff > epsilon) {
errors++;

View file

@ -768,9 +768,10 @@ bool VerifyHelper(ImageFeatureValue actual, ImageFeatureValue expected) {
// hard code, might need to be modified later.
const float cMaxErrorRate = 0.06f;
byte epsilon = 20;
UINT errors = 0;
for (uint32_t i = 0; i < size; i++, pActualByte++, pExpectedByte++) {
// Only the check the first three channels, which are (B, G, R)
if((i + 1) % 4 == 0) continue;
auto diff = std::abs(*pActualByte - *pExpectedByte);
if (diff > epsilon) {
errors++;