fix some bug about haar and match_template.