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

Fix image comparison #1291

Merged
merged 20 commits into from Feb 28, 2013
Merged

Commits on Feb 27, 2013

  1. Added new test suite, test_compare_images.

    This tests the image comparison function itself. Currently, all three cases
    fail, due to a buggy comparison algorithm.
    
    In particular, test_image_compare_scrambled shows the algorithm massively
    under-computing the error, and test_image_compare_shade_difference shows the
    algorithm massively over-computing the error.
    mgiuca-google committed Feb 27, 2013
    Configuration menu
    Copy the full SHA
    3dcc2cb View commit details
    Browse the repository at this point in the history
  2. Remove the alpha channel from the expected and actual images.

    (This regressed when the PIL code was migrated to numpy.)
    mgiuca-google committed Feb 27, 2013
    Configuration menu
    Copy the full SHA
    2f139f2 View commit details
    Browse the repository at this point in the history
  3. testing/compare: Fix image comparison RMS calculation.

    The previous implementation did not compute the RMS error. It computed the RMS
    in the difference of the number of colour components of each value. While this
    computes 0 for equal images, it is incorrect in general. In particular, it does
    not detect differences in images with the same pixels in different places. It
    also cannot distinguish small changes in the colour of a pixel from large ones.
    mgiuca-google committed Feb 27, 2013
    Configuration menu
    Copy the full SHA
    82ecfcf View commit details
    Browse the repository at this point in the history
  4. Do not divide RMS by 10000 when testing against tolerance.

    This was arbitrary and made no sense. Increased all tolerances by a factor of
    10000. Note that some are ridiculously large (e.g., 200 out of 255).
    mgiuca-google committed Feb 27, 2013
    Configuration menu
    Copy the full SHA
    125d235 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    a344de6 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    7a9a71b View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    4e12012 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    62a548d View commit details
    Browse the repository at this point in the history
  9. test_compare_images: Added two new test cases, testing a whole-image …

    …and sub-image 1-pixel offset.
    mgiuca-google committed Feb 27, 2013
    Configuration menu
    Copy the full SHA
    6edf6bc View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    9701a43 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    c855310 View commit details
    Browse the repository at this point in the history
  12. testing/compare: Remove "retry ignoring pixels with differences of on…

    …ly 1."
    
    This was introduced in 1283feb, presumably to hack around the fact that 1-pixel
    differences can make a very large error value. This is not necessary any more,
    since the root cause has been fixed."
    mgiuca-google committed Feb 27, 2013
    Configuration menu
    Copy the full SHA
    23b03aa View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    80f89a1 View commit details
    Browse the repository at this point in the history
  14. test_compare_images: Replace cosine_peak-nn test images with new base…

    …line images
    
    derived from basn3p02 in pngsuite tests.
    These are much smaller images than the cosine tests.
    mgiuca-google committed Feb 27, 2013
    Configuration menu
    Copy the full SHA
    91c969a View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    64ae6c8 View commit details
    Browse the repository at this point in the history
  16. tests: Removed existing custom tolerance values, since they are irrel…

    …evant under the new algorithm.
    
    Added a few new tolerance values, for output I am seeing that is valid but slightly different to the baseline image.
    mgiuca-google committed Feb 27, 2013
    Configuration menu
    Copy the full SHA
    8d44f75 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    38b6157 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    9d3e774 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    afc50bf View commit details
    Browse the repository at this point in the history
  20. Reduce the tolerance for test_mathtext from 50 down to 32.

    This is possible due to anti-aliasing.
    mgiuca-google committed Feb 27, 2013
    Configuration menu
    Copy the full SHA
    9410fcf View commit details
    Browse the repository at this point in the history