renamed detect_obj to detect_sources