Implement background option in segment_photometry