Here is a cropped sample of masked blurring.
The mask (shown on the right) was made by overlaying all of the surfaces with a distance shader, moving the sun to the zenith and disabling the atmosphere, shadows and GI in the render.
This resulting image was added as an alpha channel to the rendered image where you can use it to create a selection for blurring the image, or as a distance shader for Photoshop's lens blur (I did the latter)