image comparison - pixel by pixel or other method

Post your work in progress addons and get feedback

Post » Mon Nov 16, 2015 4:10 pm

Hi All,

I am using canvas (R0j0hound) plugin, where I will draw similar as other image and then I wanted to do comparison of 2 images pixel by pixel or similar.

can anyone make plugin for this :

https://github.com/Huddle/Resemble.js

or
https://github.com/tcorral/IM.js/
or
http://stackoverflow.com/questions/9136 ... vas-or-any

Need help on this.
Image
B
50
S
12
G
1
Posts: 254
Reputation: 4,456

Post » Wed Nov 25, 2015 4:56 pm

@R0j0hound @SirG @rexrainbow @zenox98 .. your help appreciated

I create myself but somehow it is not working and giving error in getContext().

http://290px.com/imjs.zip
Image
B
50
S
12
G
1
Posts: 254
Reputation: 4,456

Post » Thu Nov 26, 2015 4:02 pm

sorry, i don`t have enough time now (((
ImageImage
B
80
S
26
G
7
Posts: 191
Reputation: 10,420

Post » Sun Nov 29, 2015 7:18 am

How about compare the string from exp: imageUrl or exp: AsJSON in canvas plugin?
B
108
S
26
G
268
Posts: 4,456
Reputation: 150,247

Post » Sun Nov 29, 2015 7:40 am

@rexrainbow ... concept is for drawing competition .... so in player will draw in canvas then canvas will be compared with main image.
Image
B
50
S
12
G
1
Posts: 254
Reputation: 4,456

Post » Fri Dec 04, 2015 10:06 pm

@socialpilgrim
As rex said you could use the asjson expression to load the image into a array for faster comparison than using rgbAt().

Here's an example with three examples:
https://www.dropbox.com/s/5c5ei994g3fjt ... .capx?dl=1
/examples30/imageCompare.capx

Since it's for a drawing competition I find that just comparing the alpha gives a more meaningful percentage. Just checking all the pixels like with your links gives a 90% similarity to a blank canvas.

Anyways I implemented three methods in the capx.
The first follows the examples in your links and gives a percentage and rms number. I guess rms could be used as a way to compare.

The second only looks at the colored areas of both images and gives a pretty good measurement.

The last one finds the bounds of both drawings and compares both as if they were the same size. This allows a small box to match a big one.
Last edited by R0J0hound on Thu May 25, 2017 6:00 pm, edited 1 time in total.
B
92
S
32
G
107
Posts: 5,280
Reputation: 69,971

Post » Sat Dec 05, 2015 8:01 am

@R0J0hound - thanks for the big help, my 90% problem is solved with Alpha compare, which majorly I was looking for.

Just wanted to know if I am doing wrong ...In compare all even if I compare with right "blank" image, it gives me % around 93% ... does it mean it is comparing while pixels as well.

And what is RMS .

Regards
Image
B
50
S
12
G
1
Posts: 254
Reputation: 4,456

Post » Sat Dec 05, 2015 8:28 am

Yeah the compare all will do that. It's probably a bit flawed now that I think about it since it's comparing per component instead of per pixel.
So a transparent pixel rgba(0,0,0,0) will be 75% similar to a black pixel rgba(0,0,0,255) instead of not at all.
Fix that and a blank image should give a lower percentage.

"rms" is a term used in your last link. It's basically the distance between the two pictures.
B
92
S
32
G
107
Posts: 5,280
Reputation: 69,971

Post » Thu May 25, 2017 11:13 am

You still have that capx so I can take a peek?

@R0J0hound wrote:socialpilgrim
As rex said you could use the asjson expression to load the image into a array for faster comparison than using rgbAt().

Here's an example with three examples:
https://dl.dropboxusercontent.com/u/542 ... mpare.capx

Since it's for a drawing competition I find that just comparing the alpha gives a more meaningful percentage. Just checking all the pixels like with your links gives a 90% similarity to a blank canvas.

Anyways I implemented three methods in the capx.
The first follows the examples in your links and gives a percentage and rms number. I guess rms could be used as a way to compare.

The second only looks at the colored areas of both images and gives a pretty good measurement.

The last one finds the bounds of both drawings and compares both as if they were the same size. This allows a small box to match a big one.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,567

Post » Thu May 25, 2017 6:02 pm

@lennaert
link updated
B
92
S
32
G
107
Posts: 5,280
Reputation: 69,971

Next

Return to Work in Progress Addons

Who is online

Users browsing this forum: No registered users and 3 guests