Tests and modifications in demo_dico_matching.m