function q = cost_simannealing (f,h,g) q = energy ( conv2(f,h) - g ) ./ energy (g);