Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement the comparison of images ignore translation for #217 #222

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Cheese-Bar
Copy link
Contributor

PR Details

Description

  • Add a public function compareImagesIgnoreBackground() in ImageComparison, which provide an enhancement to compare two pictures while ignore there position in the same pure bacground.
  • Three different test cases are added to confirm it's correctness.
  • Fix a small path error in shouldProperlyHandleBug180FromRoot().

Related Issue

Motivation and Context

  • Users sometimes only care if the content in the image has been modified, not the background, such as ignore the leading line space in issue [IMPROVEMENT] - Ignoring linespaces and comparing only text and styling changes #217 .
  • Therefore, I added a method that automatically counts the pixels in the image with the most pixels and uses them as background values. Then select the subgraph of the non-background region for comparison.

How Has This Been Tested

Three test cases were added to the unit test, respectively testing issue 217, the white background with the same content that should MATCH, and the green background with modified content that should MISMATCH.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Cheese-Bar and others added 2 commits April 24, 2022 20:27
…son, which provide an enhancement to compare two pictures while ignore there position in the same pure bacground. Three different test cases are added to confirm it's correctness. The related issue is romankh3#217
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants