Skip to content

[QUESTION] Difference Percentage Calculations Don't Match #233

@PeerHalvorsen

Description

@PeerHalvorsen

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)

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions