Depth based image sharpening
Pixel depth information is used to determine a weight to apply to neighboring pixels when using a sharpening filter. A difference between neighboring pixel depths is evaluated and pixels with pixel depths that exceed a threshold are given less weight than other pixels. A sharpening mask may be generated using adjusted pixel colors.
1. A computer-implemented method, comprising:
determining a first pixel depth corresponding to a first pixel;
determining a second pixel, the second pixel being within a threshold lateral distance of the first pixel and corresponding to a second pixel depth less than a threshold depth;
determining, based at least on the second pixel being within the threshold lateral distance of the first pixel and the second pixel depth being less than the threshold depth, a weight corresponding to the second pixel, the weight being based, at least in part, on a difference between the first pixel depth and the second pixel depth and one or more parameters of an image including the first pixel and the second pixel; and
adjusting a first pixel color, based at least in part on the weight and a second pixel color.
2. The computer-implemented method of claim 1 , further comprising:
applying a sharpening filter to the first pixel and the second pixel.
3. The computer-implemented method of claim 1 , further comprising:
determining an adjusted second pixel color, based at least in part on the second pixel color, the weight, and the first pixel color.
4. The computer-implemented method of claim 3 , further comprising:
adjusting the first pixel color, based at least in part on the adjusted second pixel color and the second pixel color.
5. The computer-implemented method of claim 1 , wherein the weight corresponding to the second pixel is directly proportional to the difference between the first pixel depth and the second pixel depth.
6. The computer-implemented method of claim 1 , further comprising:
receiving a stream of image data; and
selecting, from the stream, an image frame.
7. The computer-implemented method of claim 1 , further comprising:
providing an adjusted first pixel color to a sharpening filter for calculation of a mask.