Detecting regions of interest in images