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

Image comparison #364

Closed
tbreloff opened this issue Sep 21, 2015 · 5 comments
Closed

Image comparison #364

tbreloff opened this issue Sep 21, 2015 · 5 comments

Comments

@tbreloff
Copy link
Contributor

See https://groups.google.com/forum/?hl=en#!topic/julia-dev/UwZ6L6cTLms for reference. The goal would be a comparison function that would give a measure of difference between two images (for writing tests, and maybe other uses).

Also mentioned was a visual comparison of the images, with a 3rd grayscale image which is the difference (of some to-be-determined measure) between each pixel.

@lobingera
Copy link

As mentioned in the thread, pdiff (as in pdiff.sourceforge.org) might be a solution, even if it does not provide a metric but tests against a threshold. pdiff as SW is GPLed, so there are the two options of taking it literally and update the build script, so that it can be accessed by a julia Package and live with the GPL OR re-implement based on the implementation and get the GPL on board as derivative work.

Reading the paper (http://pdiff.sourceforge.net/metric.html) shows the steps of a possible implementation in a clear way, so a clean-room implementation (without GPL as license) could be done. The comparison builds on two color transformations XYZ and Lab which i see avaiable in ColorTypes.jl and a convolution filter (laplace pyramid e.g. here http://academic.research.microsoft.com/Publication/268112/the-laplacian-pyramid-as-a-compact-image-code).

In any case, Images would provide the infrastructure for a comparison framework (testing size and binary equality, first and testing a perceptual metric as option).

@timholy
Copy link
Member

timholy commented Sep 28, 2015

Already implemented in #367. #373 is eating up all my time right now, though, and I don't want to merge anything until that gets done.

@lobingera
Copy link

Do you have a reference for the algorithm in #367?

@timholy
Copy link
Member

timholy commented Sep 29, 2015

No, but it's essentially obvious: blurring reduces the impact of differences due to "same content, small shifts in alignment." (I've noticed different Cairo library versions producing what I think are small shifts, though I didn't look carefully.) Very simple, but very effective for many real-world issues we want to resolve in automated tests.

@timholy
Copy link
Member

timholy commented Jan 28, 2017

Closed by #367.

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

No branches or pull requests

3 participants