Is the best way to determine image edges based on the similarities in color between a pixel and its neighbors with more weight given to the ones closer? This seems a lot like Gaussian filtering but the edges are obviously better maintained in the image here than in Gaussian filtering images. (Does it just seem similar because bilateral filtering uses Gaussian distribution?) Can someone explain what bilateral filtering is doing differently mathematically and intuitively?
jananisriram
The bilateral filter can completely change the shade or the tone of someone's skin. For example, in this picture, the right side looks like an image from a movie from many years ago, where someone is in a fantasy world, for example. The left side looks more realistic.
katherine-liu0
@muuncakez Bilateral filtering does resemble Gaussian filtering in its use of Gaussian distribution to give more weight to closer pixels. However, it adds an extra layer by also considering the intensity difference between neighboring pixels, effectively preserving edges while smoothing other areas. This dual approach allows it to maintain sharp edges by reducing smoothing across edges with significant intensity changes, unlike Gaussian filtering, which blurs indiscriminately. Bilateral filtering thus strikes a balance between reducing noise and preserving important structural details like edges.
buggy213
bilateral filter can be somewhat expensive to implement (due to fact that it can't easily be expressed as a convolution), but there are some ways to optimize it
one approach is to evaluate the "range weight" term with a set of fixed values rather than evaluating the difference in intensities pairwise between center pixel and those in filter support (at which point it is once again expressible as a convolution), then interpolating the closest "fixed values" results for each pixel based on its actual intensity.
andrewn3672
I'm slightly confused of when bilateral filters should be used. Intuitively, I understand it's to reduce the noise of images while also perserving the edges of the different objects in the scene, but it also seems to remove details in this given example that don't seem like noise. A lot of the details of the normal skin is lost and we end up with an image of a person that has very unrealistic skin in my opinion. Otherwise, I can see why this is very useful.
stephanie-fu
Re: when bilateral filters should be used: one cool use is to upsample signal! For example, if some image processing operation is expensive on some compute-constrained mobile device, the image can be downsampled aggressively, processed (colorized, tone-mapped, etc), and then upsampled with a joint bilateral filter.
GarciaEricS
It's interesting that the hair (at least the top of her hair) largely stays in tact. You wouldn't typically think of hair as being a bunch of edges, but the individual strands share a lot of the same properties as edges. I wonder how complex a kernel would need to be (our how complex a chain of kernels would be) to detect hair-like things and blur that out too, as the hair being unblurred here really stands out to me and detracts from the image in my opinion.
myxamediyar
Responding to GarciaEricS, I think that your filter would need to be quite complex to avoid damaging the image. I imagine that hair is rather high frequency, because of how thin it is. You would need to apply a low-pass filter, but also preserve the sharper edges of the face! I am not sure how you would do that...
Is the best way to determine image edges based on the similarities in color between a pixel and its neighbors with more weight given to the ones closer? This seems a lot like Gaussian filtering but the edges are obviously better maintained in the image here than in Gaussian filtering images. (Does it just seem similar because bilateral filtering uses Gaussian distribution?) Can someone explain what bilateral filtering is doing differently mathematically and intuitively?
The bilateral filter can completely change the shade or the tone of someone's skin. For example, in this picture, the right side looks like an image from a movie from many years ago, where someone is in a fantasy world, for example. The left side looks more realistic.
@muuncakez Bilateral filtering does resemble Gaussian filtering in its use of Gaussian distribution to give more weight to closer pixels. However, it adds an extra layer by also considering the intensity difference between neighboring pixels, effectively preserving edges while smoothing other areas. This dual approach allows it to maintain sharp edges by reducing smoothing across edges with significant intensity changes, unlike Gaussian filtering, which blurs indiscriminately. Bilateral filtering thus strikes a balance between reducing noise and preserving important structural details like edges.
bilateral filter can be somewhat expensive to implement (due to fact that it can't easily be expressed as a convolution), but there are some ways to optimize it
one approach is to evaluate the "range weight" term with a set of fixed values rather than evaluating the difference in intensities pairwise between center pixel and those in filter support (at which point it is once again expressible as a convolution), then interpolating the closest "fixed values" results for each pixel based on its actual intensity.
I'm slightly confused of when bilateral filters should be used. Intuitively, I understand it's to reduce the noise of images while also perserving the edges of the different objects in the scene, but it also seems to remove details in this given example that don't seem like noise. A lot of the details of the normal skin is lost and we end up with an image of a person that has very unrealistic skin in my opinion. Otherwise, I can see why this is very useful.
Re: when bilateral filters should be used: one cool use is to upsample signal! For example, if some image processing operation is expensive on some compute-constrained mobile device, the image can be downsampled aggressively, processed (colorized, tone-mapped, etc), and then upsampled with a joint bilateral filter.
It's interesting that the hair (at least the top of her hair) largely stays in tact. You wouldn't typically think of hair as being a bunch of edges, but the individual strands share a lot of the same properties as edges. I wonder how complex a kernel would need to be (our how complex a chain of kernels would be) to detect hair-like things and blur that out too, as the hair being unblurred here really stands out to me and detracts from the image in my opinion.
Responding to GarciaEricS, I think that your filter would need to be quite complex to avoid damaging the image. I imagine that hair is rather high frequency, because of how thin it is. You would need to apply a low-pass filter, but also preserve the sharper edges of the face! I am not sure how you would do that...