Image processing circuit and method
11514580 · 2022-11-29
Assignee
Inventors
Cpc classification
G06V10/467
PHYSICS
G06V10/48
PHYSICS
International classification
G06V10/60
PHYSICS
G06V10/44
PHYSICS
G06V10/50
PHYSICS
G06V10/48
PHYSICS
Abstract
An image processing circuit capable of detecting an edge component includes: a selecting circuit acquiring the brightness values of pixels of an image according to the position of a target pixel and a processing region, wherein the pixels include N horizontal lines and M vertical lines; a brightness-variation calculating circuit generating N horizontal-line-brightness-variation values according to brightness variation of the N horizontal lines, and generating M vertical-line-brightness-variation values according to brightness variation of the M vertical lines; a brightness-variation determining circuit choosing a horizontal-line-brightness-variation representative value among the N horizontal-line-brightness-variation values, choosing a vertical-line-brightness-variation representative value among the M vertical-line-brightness-variation values, and choosing a brightness-variation representative value between the two representative values; an energy-variation calculating circuit generating an energy-variation value according to the brightness values of the pixels; and an edge-score calculating circuit generating an edge score of the target pixel according to the brightness-variation representative value and energy-variation value.
Claims
1. An image processing circuit capable of detecting an edge component of a target pixel of an image, comprising: a selecting circuit configured to acquire brightness values of select pixels of the image according to a position of the target pixel and a processing region, wherein the select pixels of the image includes N horizontal lines and M vertical lines, and each of the N and the M is an integer greater than one; a brightness-variation calculating circuit configured to generate N horizontal-line-brightness-variation values according to brightness variation of each of the N horizontal lines and generate M vertical-line-brightness-variation values according to brightness variation of each of the M vertical lines; a brightness-variation determining circuit configured to choose a horizontal-line-brightness-variation representative value among the N horizontal-line-brightness-variation values, choose a vertical-line-brightness-variation representative value among the M vertical-line-brightness-variation values, and choose a brightness-variation representative value between the horizontal-line-brightness-variation representative value and the vertical-line-brightness-variation representative value; an energy-variation calculating circuit configured to generate an energy-variation value according to the brightness values of the select pixels; and an edge-score calculating circuit configured to generate an edge score of the target pixel according to the brightness-variation representative value and the energy-variation value, wherein the edge score of the target pixel is indicative of the edge component of the target pixel.
2. The image processing circuit of claim 1, wherein the brightness-variation calculating circuit is configured to calculate an upward horizontal-line-brightness-variation value of an X.sup.th horizontal line of the N horizontal lines and a downward horizontal-line-brightness-variation value of the X.sup.th horizontal line and then choose one of the upward horizontal-line-brightness-variation value and the downward horizontal-line-brightness-variation value as a horizontal-line-brightness-variation value of the X.sup.th horizontal line, and the X is a positive integer equal to or smaller than the N; and the brightness-variation calculating circuit is configured to calculate an upward vertical-line-brightness-variation value of a Y.sup.th vertical line of the M vertical lines and a downward vertical-line-brightness-variation value of the Y.sup.th vertical line and then choose one of the upward vertical-line-brightness-variation value and the downward vertical-line-brightness-variation value as a vertical-line-brightness-variation value of the Y.sup.th vertical line, and the Y is a positive integer equal to or smaller than the M.
3. The image processing circuit of claim 2, wherein the brightness-variation calculating circuit performs the following steps to obtain the upward horizontal-line-brightness-variation value and the downward horizontal-line-brightness-variation value of the X.sup.th horizontal line: calculating a brightness difference between every two adjacent horizontal-line pixels of the X.sup.th horizontal line and thereby obtaining a plurality of horizontal-line brightness differences; summing up all positive number(s) of the plurality of horizontal-line brightness differences and thereby generating the upward horizontal-line-brightness-variation value of the X.sup.th horizontal line; and summing up absolute value(s) of all negative number(s) of the plurality of horizontal-line brightness differences and thereby generating the downward horizontal-line-brightness-variation value of the X.sup.th horizontal line; and the brightness-variation calculating circuit performs the following steps to obtain the upward vertical-line-brightness-variation value and the downward vertical-line-brightness-variation value of the Y.sup.th vertical line: calculating a brightness difference between every two adjacent vertical-line pixels of the Y.sup.th vertical line and thereby obtaining a plurality of vertical-line brightness differences; summing up all positive number(s) of the plurality of vertical-line brightness differences and thereby generating the upward vertical-line-brightness-variation value of the Y.sup.th vertical line; and summing up absolute value(s) of all negative number(s) of the plurality of vertical-line brightness differences and thereby generating the downward vertical-line-brightness-variation value of the Y.sup.th vertical line.
4. The image processing circuit of claim 2, wherein the brightness-variation calculating circuit chooses a smaller one between the upward horizontal-line-brightness-variation value of the X.sup.th horizontal line and the downward horizontal-line-brightness-variation value of the X.sup.th horizontal line as the horizontal-line-brightness-variation value of the X.sup.th horizontal line, and the brightness-variation calculating circuit chooses a smaller one between the upward vertical-line-brightness-variation value of the Y.sup.th vertical line and the downward vertical-line-brightness-variation value of the Y.sup.th vertical line as the vertical-line-brightness-variation value of the Y.sup.th vertical line.
5. The image processing circuit of claim 1, wherein the brightness-variation determining circuit chooses a maximum one among the N horizontal-line-brightness-variation values as the horizontal-line-brightness-variation representative value, chooses a maximum one among the M vertical-line-brightness-variation values as the vertical-line-brightness-variation representative value, and chooses a smaller one between the horizontal-line-brightness-variation representative value and the vertical-line-brightness-variation representative value as the brightness-variation representative value.
6. The image processing circuit of claim 1, wherein the energy-variation calculating circuit generates the energy-variation value according to a maximum brightness value and a minimum brightness value of the select pixels of the image.
7. The image processing circuit of claim 6, wherein the energy-variation calculating circuit generates the energy-variation value according to a difference between the maximum brightness value and the minimum brightness value.
8. The image processing circuit of claim 1, wherein the edge-score calculating circuit generates the edge score according to a difference between the energy-variation value and the brightness-variation representative value.
9. The image processing circuit of claim 1, wherein the selecting circuit is configured to acquire the brightness values of the select pixels of the image according to the position of the target pixel, a predetermined sampling interval, and the processing region.
10. The image processing circuit of claim 1, wherein the position of the target pixel is at a center of the processing region.
11. An image processing method capable of detecting an edge component of a target pixel of an image, comprising: acquiring characteristic values of select pixels of the image according to a position of the target pixel and a processing region, wherein the select pixels of the image includes N horizontal lines and M vertical lines, and each of the N and the M is an integer greater than one; generating N horizontal-line-characteristic-variation values according to characteristic variation of each of the N horizontal lines and generating M vertical-line-characteristic-variation values according to characteristic variation of each of the M vertical lines; determining a horizontal-line-characteristic-variation representative value according to the N horizontal-line-characteristic-variation values, determining a vertical-line-characteristic-variation representative value according to the M vertical-line-characteristic-variation values, and determining a characteristic-variation representative value according to the horizontal-line-characteristic-variation representative value and the vertical-line-characteristic-variation representative value; generating an energy-variation value according to the characteristic values of the select pixels; and generating an edge score of the target pixel according to the characteristic-variation representative value and the energy-variation value, wherein the edge score of the target pixel is indicative of the edge component of the target pixel.
12. The image processing method of claim 11, wherein the characteristic values of the select pixels are brightness values of the select pixels.
13. The image processing method of claim 11, wherein the step of generating the N horizontal-line-characteristic-variation values includes: calculating an upward horizontal-line-characteristic-variation value of an X.sup.th horizontal line of the N horizontal lines and a downward horizontal-line-characteristic-variation value of the X.sup.th horizontal line, wherein the X is a positive integer equal to or smaller than the N; and determining a horizontal-line-characteristic-variation value of the X.sup.th horizontal line according to the upward horizontal-line-characteristic-variation value and the downward horizontal-line-characteristic-variation value; and the step of generating the M vertical-line-characteristic-variation values includes: calculating an upward vertical-line-characteristic-variation value of a Y.sup.th vertical line of the M vertical lines and a downward vertical-line-characteristic-variation value of the Y.sup.th vertical line, wherein the Y is a positive integer equal to or smaller than the M; and determining a vertical-line-characteristic-variation value of the Y.sup.th vertical line according to the upward vertical-line-characteristic-variation value and the downward vertical-line-characteristic-variation value.
14. The image processing method of claim 13, wherein the step of calculating the upward horizontal-line-characteristic-variation value and the downward horizontal-line-characteristic-variation value of the X.sup.th horizontal line includes: calculating a characteristic difference between every two adjacent horizontal-line pixels of the X.sup.th horizontal line and thereby obtaining a plurality of horizontal-line characteristic differences; generating the upward horizontal-line-characteristic-variation value of the X.sup.th horizontal line according to all positive number(s) of the plurality of horizontal-line characteristic differences; and generating the downward horizontal-line-characteristic-variation value of the X.sup.th horizontal line according to all negative number(s) of the plurality of horizontal-line characteristic differences; and the step of calculating the upward vertical-line-characteristic-variation value and the downward vertical-line-characteristic-variation value of the Y.sup.th vertical line includes: calculating a characteristic difference between every two adjacent vertical-line pixels of the Y.sup.th vertical line and thereby obtaining a plurality of vertical-line characteristic differences; generating the upward vertical-line-characteristic-variation value of the Y.sup.th vertical line according to all positive number(s) of the plurality of vertical-line characteristic differences; and generating the downward vertical-line-characteristic-variation value of the Y.sup.th vertical line according to all negative number(s) of the plurality of vertical-line characteristic differences.
15. The image processing method of claim 13, wherein the step of determining the horizontal-line-characteristic-variation value of the X.sup.th horizontal line includes: choosing a smaller one between the upward horizontal-line-characteristic-variation value of the X.sup.th horizontal line and the downward horizontal-line-characteristic-variation value of the X.sup.th horizontal line as the horizontal-line-characteristic-variation value of the X.sup.th horizontal line; and the step of determining the vertical-line-characteristic-variation value of the Y.sup.th vertical line includes: choosing a smaller one between the upward vertical-line-characteristic-variation value of the Y.sup.th vertical line and the downward vertical-line-characteristic-variation value of the Y.sup.th vertical line as the vertical-line-characteristic-variation value of the Y.sup.th vertical line.
16. The image processing method of claim 11, wherein the step of determining the horizontal-line-characteristic-variation representative value includes: choosing a maximum one among the N horizontal-line-characteristic-variation values as the horizontal-line-characteristic-variation representative value; the step of determining the vertical-line-characteristic-variation representative value includes: choosing a maximum one among the M vertical-line-characteristic-variation values as the vertical-line-characteristic-variation representative value; and the step of determining the characteristic-variation representative value includes: choosing a smaller one between the horizontal-line-characteristic-variation representative value and the vertical-line-characteristic-variation representative value as the characteristic-variation representative value.
17. The image processing method of claim 11, wherein the step of generating the energy-variation value includes: generating the energy-variation value according to a maximum brightness value and a minimum brightness value of the select pixels of the image.
18. The image processing method of claim 17, wherein the step of generating the energy-variation value includes: generating the energy-variation value according to a difference between the maximum brightness value and the minimum brightness value.
19. The image processing method of claim 11, wherein the step of generating the edge score includes: generating the edge score according to a difference between the energy-variation value and the characteristic-variation representative value.
20. The image processing method of claim 11, wherein the step of selecting the characteristic values of the select pixels of the image includes: acquiring the characteristic values of the select pixels of the image according to the position of the target pixel, a predetermined sampling interval, and the processing region.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1)
(2)
(3)
(4)
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
(5) The present disclosure discloses an image processing circuit and method capable of detecting an edge of an object in an image in a cost-effective manner.
(6)
(7) Please refer to
(8) TABLE-US-00001 TABLE 1 (x.sub.−2, y.sub.−2) = b.sub.−2, −2 (x.sub.−1, y.sub.−2) = b.sub.−1, −2 (x.sub.0, y.sub.−2) = b.sub.0, −2 (x.sub.1, y.sub.−2) = b.sub.1, −2 (x.sub.2, y.sub.−2) = b.sub.2, −2 (x.sub.−2, y.sub.−1) = b.sub.−2, −1 (x.sub.−1, y.sub.−1) = b.sub.−1, −1 (x.sub.0, y.sub.−1) = b.sub.0, −1 (x.sub.1, y.sub.−1) = b.sub.1, −1 (x.sub.2, y.sub.−1) = b.sub.2, −1 (x.sub.−2, y.sub.0) = b.sub.−2, 0 (x.sub.−1, y.sub.0) = b.sub.−1, 0 (x.sub.0, y.sub.0) = b.sub.0, 0 (x.sub.1, y.sub.0) = b.sub.1, 0 (x.sub.2, y.sub.0) = b.sub.2, 0 (x.sub.−2, y.sub.1) = b.sub.−2, 1 (x.sub.−1, y.sub.1) = b.sub.−1, 1 (x.sub.0, y.sub.1) = b.sub.0, 1 (x.sub.1, y.sub.1) = b.sub.1, 1 (x.sub.2, y.sub.1) = b.sub.2, 1 (x.sub.−2, y.sub.2) = b.sub.−2, 2 (x.sub.−1, y.sub.2) = b.sub.−1, 2 (x.sub.0, y.sub.2) = b.sub.0, 2 (x.sub.1, y.sub.2) = b.sub.1, 2 (x.sub.2, y.sub.2) = b.sub.2, 2
(9) TABLE-US-00002 TABLE 2 (x.sub.−4, y.sub.−4) = b.sub.−4, −4 (x.sub.−2, y.sub.−4) = b.sub.−2, −4 (x.sub.0, y.sub.−4) = b.sub.0, −4 (x.sub.2, y.sub.−4) = b.sub.2, −4 (x.sub.4, y.sub.−4) = b.sub.4, −4 (x.sub.−4, y.sub.−2) = b.sub.−4, −2 (x.sub.−2, y.sub.−2) = b.sub.−2, −2 (x.sub.0, y.sub.−2) = b.sub.0, −2 (x.sub.2, y.sub.−2) = b.sub.2, −2 (x.sub.4, y.sub.−2) = b.sub.4, −2 (x.sub.−4, y.sub.0) = b.sub.−4, 0 (x.sub.−2, y.sub.0) = b.sub.−2, 0 (x.sub.0, y.sub.0) = b.sub.0, 0 (x.sub.2, y.sub.0) = b.sub.2, 0 (x.sub.4, y.sub.0) = b.sub.4, 0 (x.sub.−4, y.sub.2) = b.sub.−4, 2 (x.sub.−2, y.sub.2) = b.sub.−2, 2 (x.sub.0, y.sub.2) = b.sub.0, 2 (x.sub.2, y.sub.2) = b.sub.2, 2 (x.sub.4, y.sub.2) = b.sub.4, 2 (x.sub.−4, y.sub.4) = b.sub.−4, 4 (x.sub.−2, y.sub.4) = b.sub.−2, 4 (x.sub.0, y.sub.4) = b.sub.0, 4 (x.sub.2, y.sub.4) = b.sub.2, 4 (x.sub.4, y.sub.4) = b.sub.4, 4
(10) Please refer to
(11) Please refer to
It should be noted that the aforementioned exemplary implementation is for a better understanding rather than a limitation to the present invention. The brightness-variation calculating circuit 320 can use a known or self-developed algorithm and/or processing method (e.g., weighted algorithm and/or normalization processing method) to generate the N horizontal-line-brightness-variation values and the M vertical-line-brightness-variation values.
(12) Please refer to
(13) Please refer to
(14) Please refer to
(15) Below is described an exemplary implementation for a better understanding. Please refer to Table 3 below. Table 3 shows: the brightness values of select pixels within a 5×5 processing region; five horizontal pixel lines of the select pixels and the horizontal-line-brightness-variation values thereof that are emphasized in hold; and five vertical pixel lines of the select pixels and the vertical-line-brightness-variation values thereof that are emphasized in bold. According to Table 3, some horizontal pixel lines of the select pixels have upward brightness variations (i.e., the brightness of the next pixel in a horizontal line is brighter than the brightness of the current pixel in the horizontal line) and downward brightness variations (i.e., the brightness of the next pixel in a horizontal line is darker than the brightness of the current pixel in the horizontal line) concurrently, and thus some of the five horizontal-line-brightness-variation values, which can be determined by the aforementioned Step 4, of the five horizontal pixel lines are not zero. Therefore, the horizontal-line-brightness-variation representative value (e.g., the maximum one among the five horizontal-line-brightness-variation values) chosen by the brightness-variation determining circuit 330 is not zero. On the other hand, each of the five vertical pixel lines has no upward brightness variation, and thus all of the five vertical-line-brightness-variation values, which can be determined by the aforementioned Step 8, of the five vertical pixel lines are zero. Therefore, the vertical-line-brightness-variation representative value (e.g., the maximum one among the five vertical-line-brightness-variation values) chosen by the brightness-variation determining circuit 330 is zero. Next, the brightness-variation determining circuit 330 chooses one between the horizontal-line-brightness-variation representative value and the vertical-line-brightness-variation representative value (e.g., the smaller one between the two representative values, that is the vertical-line-brightness-variation representative value “0”) as the brightness-variation representative value. Afterward, the energy-variation calculating circuit 340 generates the energy-variation value (e.g., the difference “8” between the maximum brightness value “9” and the minimum brightness value “1” of Table 3) according to the brightness values of the select pixels of Table 3. At last, the edge-score calculating circuit 350 uses the brightness-variation representative value (e.g., the vertical-line-brightness-variation representative value “0”) and the energy-variation value (e.g., the difference “8”) to generate the edge score of the target pixel (e.g., (8−1)−0=7 as described in the preceding paragraph). The edge score can be utilized by a back-end image processing circuit which falls beyond the scope of the present disclosure.
(16) TABLE-US-00003 TABLE 3 horizontal- line- brightness- variation value (x.sub.−2,y.sub.−2) = 9 (x.sub.−1,y.sub.−2) = 1 (x.sub.0,y.sub.−2) = 9 (x.sub.1,y.sub.−2) = 1 (x.sub.2,y.sub.−2) = 9 16 (x.sub.−2,y.sub.−1) = 9 (x.sub.−1,y.sub.−1) = 1 (x.sub.0,y.sub.−1) = 9 (x.sub.1,y.sub.−1) = 1 (x.sub.2,y.sub.−1) = 9 16 (x.sub.−2,y.sub.0) = 5 (x.sub.−1,y.sub.0) = 1 (x.sub.0,y.sub.0) = 5 (x.sub.1,y.sub.0) = 1 (x.sub.2,y.sub.0) = 5 8 (x.sub.−2,y.sub.1) = 1 (x.sub.−1,y.sub.1) = 1 (x.sub.0,y.sub.1) = 1 (x.sub.1,y.sub.1) = 1 (x.sub.2,y.sub.1) = 1 0 (x.sub.−2,y.sub.2) = 1 (x.sub.−1,y.sub.2) = 1 (x.sub.0,y.sub.2) = 1 (x.sub.1,y.sub.2) = 1 (x.sub.2,y.sub.2) = 1 0 vertical- 0 0 0 0 0 line- brightness- variation value
(17) It should be noted that the brightness values of the aforementioned embodiments can be replaced by other image characteristic values according to the demand for implementation as long as such implementation is practicable.
(18)
(19) Since those having ordinary skill in the art can refer to the disclosure of the embodiment of
(20) To sum up, the present invention can effectively detect the edge of an object in an image in a cost-effective manner.
(21) The aforementioned descriptions represent merely the preferred embodiments of the present invention, without any intention to limit the scope of the present invention thereto. Various equivalent changes, alterations, or modifications based on the claims of present invention are all consequently viewed as being embraced by the scope of the present invention.