1. A method for filtering an image using a guided image filter, comprising: retrieving the image to be filtered, a guidance image, and confidence values associated with the image to be filtered; computing a filtering output from filter input values derived from the image to be filtered and confidence values associated with the filter input values using a linear transformation of the guidance image in a window, wherein coefficients for the linear transformation are computed from confidence-weighted average values obtained for the window; and outputting the computed filtering output.