主权项 |
1. A method for processing edges in an image, comprising:
a) calculating, by an electronic apparatus, a first-direction gradient along a first direction and a second-direction gradient along a second direction with respect to a cross-shaped pattern centered at a target pixel within a region of an input image; b) determining whether the first-direction gradient is greater than a first comparison gradient by the electronic apparatus, wherein the first comparison gradient is determined according to the second-direction gradient; c) obtaining, by the electronic apparatus, a first estimated pixel value based on pixel values of a first plurality of pixels along the second direction within the cross-shaped pattern as an estimated pixel value of the target pixel when a determination result of step (b) is affirmative; d) determining, by the electronic apparatus, whether the second-direction gradient is greater than a second comparison gradient when the determination result of step (b) is negative, wherein the second comparison gradient is determined according to the first-direction gradient; e) obtaining, by the electronic apparatus, a second estimated pixel value based on pixel values of a second plurality of pixels along the first direction within the cross-shaped pattern as the estimated pixel value of the target pixel when a determination result of step (d) is affirmative; and f) outputting, by the electronic apparatus, a pixel value of the target pixel when the determination result of step (d) is negative. |