prolog image understanding