1. A method comprising: denoising an image by one or more computing devices, the denoising including for each of a plurality of pixels in the image: selecting one or more reference patches from the image that includes the pixel based at least in part on a structure of the one or more reference patches; and using the selected one or more reference patches to compute a display value for the pixel in the denoised image through comparison with one or more query patches; and outputting the denoised image by the one or more computing devices having the display values for the plurality of pixels.