Slightly better similarity samples
authorCyril Roussillon <>
Fri, 13 May 2016 12:43:41 +0000 (13:43 +0100)
committerKlaus Ethgen <Klaus@Ethgen.de>
Sun, 15 May 2016 08:37:35 +0000 (09:37 +0100)
commit49df4e25014e2ce1792ad0c0fd01f7d781b0e491
tree44def29860f8c7839317cdc72be60f78e00d301b
parent3d8ad9bdcd0685452c6891e9040b8cdbbe4c1b55
Slightly better similarity samples

Slight modification of the image_sim_fill_data, that creates the
similarity signature. When the image size is not a multiple of 32, all
cells had size w/32, so the last w%32 pixels were just ignored, and more
importantly it was not symmetric at all when the signature was built
from the other side, which is annoying for my comparison algorithm. So I
changed the cell size (x_inc) from a constant one to
"round(w_left/n_left)", in order to spread the spare pixels (eg to split
42 pixels into 4 cells, it results in 11,10,11,10 instead of
10,10,10,10). With an image of size w with w%32=16, my
rotation-invariant algorithm results in a similarity of
0.951000 with the original version, and 0.999968 with this modification
(apparently lossless jpeg rotation is not perfectly lossless).

Signed-off-by: Klaus Ethgen <Klaus@Ethgen.de>
src/similar.c