hist and edges detection simple codes