You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to understand why getDifferencePercent(BufferedImage img1, BufferedImage img2) on line 138 of the ImageComparisonUtil class is returning a different result than the percent calculated in line 313 of the ImageComparison class.
The algorithm used to acquire the count of different pixels in populateTheMatrixOfTheDifferences() on line 234 seems to be similar to what's being done in getDifferencePercent(BufferedImage img1, BufferedImage img2) but the end result isn't the same.
It seems like if I'm trying to set an allowed percentage difference using setAllowingPercentOfDifferentPixels() I can't use the output of getDifferencePercent as a gauge since that value doesn't match what's calculated during the image comparison inside isAllowedPercentOfDifferentPixels(long countOfDifferentPixels)
The text was updated successfully, but these errors were encountered:
I ran into the same issue when writing my own project: getDifferencePercent was returning an incorrect percentage. It seems that it was calculating the total number of different pixels incorrectly - instead of increasing an overall counter for each different pixel it was summing a long of differences from getRGB method.
I'm trying to understand why
getDifferencePercent(BufferedImage img1, BufferedImage img2)
on line 138 of the ImageComparisonUtil class is returning a different result than the percent calculated in line 313 of the ImageComparison class.The algorithm used to acquire the count of different pixels in
populateTheMatrixOfTheDifferences()
on line 234 seems to be similar to what's being done ingetDifferencePercent(BufferedImage img1, BufferedImage img2)
but the end result isn't the same.It seems like if I'm trying to set an allowed percentage difference using
setAllowingPercentOfDifferentPixels()
I can't use the output of getDifferencePercent as a gauge since that value doesn't match what's calculated during the image comparison insideisAllowedPercentOfDifferentPixels(long countOfDifferentPixels)
The text was updated successfully, but these errors were encountered: