Method and apparatus for correcting pixel values in a digital image

Abstract: A method and apparatus is provided for editing continuous tone digital images in which regions containing defects, called "defect regions", are unnoticeable or less visually discernible. These digital images may have one color channel (gray side) or multiple color channels. A deviation is determined of the non-defect pixels along each line segment from their models. The line segment is selected having the lowest deviation, and then corrected values of the selected defect pixel are calculated based on the values of at least two non-defect pixels in the selected line segment on either side of the selected defect pixel. In another embodiment, the corrected values of the selected defect pixel are based on intermediate values for the selected defect pixel which are calculated for each line segment, and which contribute to the corrected values relative to calculated weights based on the deviations for the line segments.

Description: This invention relates generally to improving the quality of digital images, and more particularly, relates to a method and apparatus for correcting long and narrow regions of defect pixels in a two-dimensional continuous tone digital image. A digital image is a two-dimensional array of pixel elements. Examples of two-dimensional pixel arrays for digital images are 768 x 512 pixels or 1024 x 1024 pixels. Each pixel of a digital image may be represented by digital values which provide the intensity and color of the image. A digital image may be composed of a single color channel (gray scale) or multiple color channels, such as RGB or YCC, where each pixel in the digital image has a value for each color channel of an image. Generally, these digital images are called continuous tone digital images. Often, a digital image will have pixels regions with noisy or corrupted pixel values due to defects in the original digitized image or defects introduced into the image by the digitizing process. Pixels within such regions are referred to as defect pixels and pixels outside those regions are referred to as non-defect pixels. Prior automatic image editing systems have had limited success in reconstructing these defect pixels regions. Typically, these systems attempt to reconstruct the regions by estimating values for each defect pixel using values from the closest non-defect pixel or by averaging the values from a number of the closest non-defect pixels. For example, in EP 0 624 848 A2, the gray levels of defect pixels are replaced by a weighted average of original gray levels of "normal" (i.e., non-defect or corrected defect) pixels within a small distance of the defect pixel. Although this reconstruction is adequate in small compact defect regions of only a few pixels in size, it fails to provide proper reconstruction of larger (for example, long and narrow) defect regions. This results in reconstructed defect regions which are often visually inconsistent with the non-defect pixels in the image. One reason for this inconsistency is that the selection of non-defect pixels used in estimating values of defect pixels may be improper, which causes blurring of the reconstructed image in the defect region. Another reason for this inconsistency may be the result of improper reconstruction of edges of objects in the image which intersect the defect regions. This results in reconstructed edges appearing bent or discontinuous. A problem to be solved by the invention is to reconstruct defect regions which are visually consistent with the non-defect pixels in the image. An apparatus and method in accordance with the present invention includes a programmed computer system which operates on a set of instructions for correcting defect pixels in a digital image, and which is coupled to an image reader, an image output device, and an user interface. The method set forth in the set of instructions includes the steps of: selecting one of the defect pixels; allocating a plurality of line segments through the selected defect pixel, wherein each line segment is composed of the defect pixels and the non-defect pixels in the source image about the selected defect pixel; determining at least one representative model of the non-defect pixel signals along each line segment; determining the deviation of the non-defect pixel signals along each line segment from the model corresponding to the line segment; selecting the line segment having the lowest deviation; and determining corrected pixel signals for the selected defect pixel based on at least two non-defect pixel signals in the selected line segment. An apparatus in accordance with the invention includes means for selecting one of the defect pixels in the defect region; means for allocating a plurality of line segments through the selected defect pixel, wherein each line segment is composed of pixels in the source image about the selected defect pixel; means for determining for each channel of each line segment a representative model of the non-defect pixel values; means for determining for each channel of each line segment the deviation of the non-defect pixel values in the line segment from their representative model; means for determining a total deviation for each line segment based on the deviation for each channel of the line segment; means for selecting the line segment having the lowest total deviation from among the plurality of line segments; and means for determining a value for each channel of the selected defect pixels based on the values of at least two of the non-defect pixels in the selected line segment. The advantage of the apparatus and method of the present invention is that the estimated defect pixel values in the reconstructed defect region of the source image are visually more consistent in color with the non-defect pixels in the image than in prior automatic image editing systems. This is particularly true for defect regions which are long and narrow. This ultimately results in a corrected image having superior quality in the reconstructed defect regions, which are either unnoticeable or visually less discemible to the human eye. Figure 1 is a block diagram of an apparatus for correcting values of defect pixels in a digital image in accordance with the present invention; Figure 2(a) is a pictorial view of a digital image with a defect pixel region; Figure 2(b) is a pictorial view of a defect map for the digital image in Figure 2(a); Figure 2(c) is a pictorial view of the window operator used during correction of defect pixels in the digital image in Figure 2(a); Figure 2(d) is a pictorial view of a corrected digital image after correction of the defect pixels in the digital image in Figure 2(a); Figure 3 is a flow chart illustrating a method for correcting defect pixels in a digital image in accordance with the present invention; Figure 4 is a flow chart illustrating a process for estimating corrected values for a defect pixel; Figure 5 is a flow chart of another embodiment illustrating a process for estimating corrected values for a defect pixel; Figure 6 is a flow chart illustrating an alternative embodiment for defining the line segments in the process for estimating corrected values for a defect pixel in Figures 4 and 5; Figure 7 is a pictorial view of the digital image of Figure 2(a) illustrating a line segment being defined as described in Figure 6; and Figure 8 is a pictorial view of an example illustrating line segments defined about a defect pixel. An apparatus 8 in accordance with the present invention includes a programmed computer system 10 coupled to an image reader 20, an image output device 24, and a user interface 22. Computer system 10 operates according to a set of instructions to correct digital images by correcting values of defect pixels within a defect region in the digital images. With the apparatus and method, defect regions in digital images can be corrected so that regions are entirely unnoticeable to a viewer or less visually discernible because values for defect pixels have been estimated which are consistent with the overall image. Referring more specifically to Figure 1, computer system 10 includes a processor 12, a memory 14 and a hard disk 18, which are coupled together with an internal bus 16 for communicating both data and addresses between these components. Preferably, digital images are stored on hard disk 18 in system 10. Image reader 20 is coupled to computer system 10, and provides a digital image to the computer system 10 via internal bus 16. This digital image is stored in memory 14. In this particular embodiment, image reader 20 is a digital scanner or digital camera, such as Kodak Professional Photo-CD 4045 Film Scanner, although any type of device for providing a digital image may be used. Computer system 10 may also receive digital images from other sources, such as digital images stored in hard disk 18. Each digital image is composed of an array of pixel values having one or more color channels. Image output device 24 is coupled to computer system 10. In this particular embodiment, output device 24 may be any type of digital image output device, such as a video display, a printer, an external nonvolatile memory storage device, or a transmission line to other computers within a network. Images stored in memory 14 may be output to image output device 24 through internal bus 16. User interface 22, such as a keyboard or mouse device, is coupled to computer system 10 and allows for a user to control and interact with apparatus 8, such as building of a defect map of the digital image stored in memory 14. User inputs through user interface 22 are described later. Referring to Figures 2(a-d) and 3, the operation of apparatus 8 will be discussed. When computer system 10 is started at step 98, system 10 receives a digital image from image reader 20 and stores the image in memory 14 (step 100). Alternatively, this image may have already been stored in memory 14. The image stored in memory 14 will hereinafter be referred to as the "source image." An example of the source image 25 is shown in Figure 2(a) with defect region 26. The source image may be comprised of a single color channel (monochrome), or have multiple color channels, such as RGB. Once the source image is stored in memory 14, then in step 102 the defect regions in the source image are located. Preferably, this is performed by the user identifying the approximate image areas containing the defect regions through user interface 22, and then processor 12 automatically detecting the defect pixels in those areas identified by the user. One system for identifying defect pixels is disclosed in U.S. Patent Application Serial No. 08/057,942 filed May 4, 1993, now abandoned in favor of Continuation bearing Serial No. 08/412,351 in the name of Robert T. Gray and assigned to the same assignee as this application. Briefly, this defect pixel identification system automatically identifies small local regions of an image which are anomalous in both brightness/color, local contrast, and size, and outputs a map of the defect pixels in the image. Alternatively, the defect pixels may be selected manually by the user, which can be performed by a user generating a digital mask via user interface 22 (for example, by a graphic "painting" software application) identifying the defect pixels. Once the defect regions are located, a defect map is built and stored in memory 14 (step 104). In the defect map, pixels with a specified value correspond to defect pixels in the source image. One example of a defect map is shown in Figure 2(b) for the defect region 26 of the source image 25 in Figure 2(a). In this example, defect pixels are represented by bits set to zero (black), and non-defect pixels are represented by bits set to one (white). Next, a window operator is set, preferably centered, on a first pixel in the source image (step 106). An example of the window operator 27 in operation is shown in Figure 2(c). In computer system 10, the window operator is used in performing correction of defect pixel values in the source image. The window operator defines a region of interest in the source image about a pixel centered within the region. In the preferred embodiment, the shape and size of this window operator is a square region, where each side or boundary of the square region is X in size. However in another embodiment, the window operator may be a circular region having a diameter X. This window operator is used by processor 12 to scan across each pixel in the lines of the source image. The scanning pattern of the window operator is not critical as long as all defect pixels are visited during scanning. For example, a raster-scan pattern may be used. In step 107, a check is made to determine whether this pixel set within the window operator is a defect pixel by referencing the defect map stored in memory 14. If the pixel is a non-defect pixel, then in step 109 the values of this non-defect pixel are stored in an area of memory 14 which is allocated for storing the corrected source image ("corrected image"). If the pixel is a defect pixel, then the defect pixel is selected ("PIXEL SEL ") for subsequent correction (step 108). Next, a corrected value in each channel of PIXEL SEL is estimated (step 110). Figure 2(c) shows an illustration of window operator 27 and the estimation of corrected values for a defect pixel in the defect region 26 of the source image 25. The process for estimating corrected values is described in greater detail in Figure 4. Referring to Figure 4, the process for estimating corrected values for PIXEL SEL is started at step 198. The line segment size is set to X for every direction (step 200). Preferably, X is at least twice the maximum width of the defect region in the source image. A SET of line segments or vectors is defined or allocated through PIXEL SEL wherein each line segment is composed of both defect and non-defect pixels in the source image on one or both sides of PIXEL SEL (step 202). In this embodiment, the total number of pixels defect and non-defect pixels, in each line segment is maintained the same, which corresponds to the square window operator. Alternatively, each line segment can have the same length X defined as the Euclidean distance, which corresponds to the circular window operator. However, in other embodiments the total number of pixels in each line segment may vary depending on the defect pixel and line segment, as will be described later. SET is composed of N number of line segments, where each line segment is represented by the following notation: In SET, n refers to each line segment (n=1 to N). Each line segment n has pixels having values for K number of color channels. The nth line segment is referred to as LS n . The kth channel of the nth line segment in SET is referred to as LS n,k . For example, where SET has 4 line segments (N=4), and each pixel has 3 channel values (K=3), the 2nd channel of the 3rd line segment in SET is LS 3,2 . Preferably, the line segments are each at equal radial angles at 45° or 22.5° intervals with respect to each other about PIXEL SEL , although the angles can vary as needed. The number of line segments in SET depends on size of this angle. For example, radial angles at 45° intervals provide 4 line segments in SET, while radial angles at 22.5° intervals provides 8 line segments in SET. Preferably, each line segment is composed of pixels which are less than 0.5 pixel distance away from a line through PIXEL SEL at the radial angle associated with each respective line segment. Referring to Figure 8, an example of a SET of 4 line segments (H, V, D1, and D2) is shown at 45° spacing to each other, where each line segment is composed of a total of 22 pixels and has 11 pixels on each side of PIXEL SEL . Referring back to Figure 4, once the SET of line segments is defined, then at step 204 any line segments which do not contain a minimum threshold number of non-defect pixels on each side of PIXEL SEL are considered not valid line segments, and are removed from SET. Preferably, the minimum threshold is set to one-half the number of pixels on one side of a line segment. For example, if each line segment has 8 pixels, then 4 pixels are on each side of PIXEL SEL and the minimum threshold is 2 pixels. Accordingly, any line segment which does not have at least 2 non-defect pixels on each side of PIXEL sel is removed from SET. Next, a check is then performed to determine whether the remaining number of line segments N in SET is greater than zero (step 206). If N is not greater than zero, then the "no" branch is taken to step 207 where all the line segments previously removed are replaced in SET. Once the line segments are replaced, a query is made to determine whether any of the line segments have non-defect pixels (step 209). If there are no non-defect pixels in the line segments of SET, then the "no" branch is taken to step 211 where the line segment size X is increased by Y. This accordingly expands the window operator region by Y, thereby increasing the possibility that when SET is redefined line segments will include non-defect pixels. A new SET of line segments is redefined through PIXEL SEL at this increased line segment size at step 202, and the process as described above is repeated. If the line segments at step 209 contain any non-defect pixels, then the "yes" branch is taken to step 213 where an estimated value for each channel k of PIXEL SEL is calculated based on the weighted average of the non-defect pixels in SET. These weights are determined by their respective distances from PIXEL SEL . The calculation for estimating values for each channel k of PIXEL SEL at step 213 preferably is as follows: where: i = index for each non-defect pixel in SET; Q = total number of non-defect pixels in SET; Pi,k = the value of the k th channel of the i th non-defect pixel in SET; and W i = the weight for the i th non-defect pixel in SET, where W i = x i -x SEL 2 + y i -y SEL 2 -1/2 x i and y i = the x and y coordinates of the i th non-defect pixel in SET in the source image, and x SEL and y SEL = the x and y coordinates of PIXEL SEL in the source image Once the estimation of values for PIXEL SEL is completed (step 218) processing then goes to step 112 in Figure 3. If at step 206 the number of line segments N is greater than zero, then the "yes" branch is taken to step 208 where a functional model is calculated for the non-defect pixel values for each channel k of each line segment in SET. The functional model calculation is performed by fitting the values of the non-defect pixels in a line segment to a mathematical model, such as a flat field fit, linear fit, or quadratic fit. This fitting is based on the values of the non-defect pixels, and the distances between them. A variety of techniques may be used for modeling the non-defect pixel values, and the particular technique chosen will affect model accuracy, and require a different minimum number of non-defect pixels. One example of this technique is shown in W. PRESS, S. TEUKOLSKY, W. VETTERLING, AND B. FLANNERY, NUMERICAL RECIPES IN FORTRAN, Ch. 15 (2d ed., 1992). In the preferred embodiment, the functional model calculation at step 208 uses a linear least-squares fit, which requires at least one non-defect pixel lying on each side of PIXEL SEL . Earlier performed step 204 may be used to assure that this minimum is met for all line segments in SET. Next at step 210, a mean square fitting error (MSE) is calculated of the non-defect pixel values from the functional model for each channel of each line segment in SET. The MSE calculation is a statistical measure of the deviation of the non-defect pixel values in a line segment from an estimate of their values based on their functional fit. Thus, the lower a MSE value the more consistent to the model are the non-defect pixel values. For a given channel and line segment, MSE is calculated by determining the difference between the value of each non-defect pixel from its value estimated along the functional model. The resulting difference for each non-defect pixel is then squared, and the sum of these squares is averaged to obtain the MSE. (In the case of a flat field fit for the functional model calculation, the MSE is equivalent to the variance of the non-defect pixels in the line segment.) Mean square fitting error of the k th channel of the n th line segment (MSE n,k ) is calculated by: where: M n = number of non-defect pixels in LS n ; i = index for each non-defect pixel in LS n from 1 to M n ; P i,n,k = the actual value of the i th non-defect pixel in channel k in LS n ; and P i,n,k = the functional model estimate value of the i th non-defect pixel in channel k in LS n . Then at step 212, a calculation is performed for each line segment wherein each channel of the line segment is combined to provide a total mean square fitting error value (MSE Total n ), where: K = the total number of channels (for RGB, K=3) ; and k = index for each channel from 1 to K. The line segment having the lowest MSE Total is then selected (step 214). The selected line segment represents the preferred line segment for determining estimated values for PIXEL SEL . An estimated value for each channel k of PIXEL SEL is then interpolated using at least one non-defect pixel of the selected line segment on each side of PIXEL SEL (step 216). In this manner, by selecting the line segment with the lowest total mean square fitting error, the line segment representing non-defect pixels which are most consistent to their functional model across all channels is used in determining the estimated values for PIXEL SEL . Once the estimation of values for PIXEL SEL is completed (step 218) then processing goes to step 112 in Figure 3. Referring to Figure 8, an example of the processing in Figure 4 is described below. Figure 8 shows an expanded view of a source image with a defect region extending from Region 1 to Region 2, wherein each region is composed of pixels with similar pixel values, which are distinct between regions. There are 4 line segments in SET labeled H, V, D1 and D2, which are defined through PIXEL SEL at the center or intersection of the line segments (step 202). Once defined, line segment H and D2 are removed from SET because each has a side without any non-defect pixels, and therefore is below a minimum threshold of 4 non-defect pixels (step 204). Next, a functional model is fitted and a mean square fitting error is calculated for remaining line segments V and D1 (steps 208-210). In the single color channel (K=1) example of Figure 8, the mean square fitting error for line segment D1 is lower than the mean square fitting error for line segment V. This is due to the excessive fitting error for dissimilar non-defect pixel values along line segment V extending through Region 1 and Region 2. In contrast, the non-defect pixels of line segment D1 all lie within Region 1 and have uniform pixel values. Thus line segment D1 has a lower fitting error than line segment V. Consequently, at step 214 line segment D1 is selected, and at step 216 PIXEL SEL is replaced with an estimate value based upon the non-defect pixels in line segment D1. Referring to Figure 5, an alternative embodiment for estimating corrected values for PIXEL SEL is illustrated. Corresponding steps in Figure 5 have numeral designations which correspond to those in Figure 4 and will not be described again. Accordingly, once the mean square error calculations are made at step 210, then a weight (w n,k ) is calculated at step 220 for each channel k for each line segment n in SET, where: As shown by the equation (5), the lower the mean square fitting error for a given line segment in a given channel, the greater will be the calculated weight. Next, an intermediate estimate value of PIXEL SEL (IGL i,k ) is interpolated for each channel k for each line segment in SET (step 222). Once the interpolated process is completed, a final estimate value of PIXEL SEL (FGL SEL k ) is calculated for each channel k (step 224), where: Thus, the final estimate value of PIXEL SEL is based upon a contribution of each of the calculated intermediate estimate values for each channel of each line segment relative to their respective weights. To illustrate this, if for example the line segments are those shown in Figure 8, then intermediate estimate values for PIXEL SEL are calculated for line segments V and D1 because all other line segments were removed at step 204. But, since line segment D1 has a lower mean square fitting error than line segment V, the intermediate estimate value for line segment D1 contributes significantly more to the final estimate value of PIXEL SEL than the intermediate estimate value for line segment V. Once the estimation of values for PIXEL SEL is completed (step 216) then processing goes to step 112 in Figure 3. Referring back to Figure 3, once estimated values for PIXEL SEL are calculated, then at step 112 they are stored in the corrected image area of memory 14. A check is then made at step 114 to determine whether the end of the source image has been reached. In other words, have all pixels in the source image been scanned by the window operator. If not, then the "no" branch is taken to step 115 where the window operator is advanced, and set, preferably centered, to the next pixel in the image and steps 107-114 are repeated as previously described. Once the end of image is reached, the "yes" branch is taken from step 114 to step 116, where the corrected image stored in memory 14 is output to the image output device 24 at step 116 and the end of the process at step 118. An example of the corrected image is shown in Figure 2(d), wherein the defect 26 has been corrected and is no longer visually discernible. In two alternative embodiments, the size of each line segment at step 202 in Figures 4 and 5 is variable along its respective radial line through PIXEL SEL . Thus, step 200 for setting the line segment size is no longer needed. Line segments are extended on both sides of PIXEL SEL . The composition of each line segment is determined by extending each line segment along a vector (that is, its respective radial line) from each side of PIXEL SEL as described below. In the first alternative embodiment, line segments are separately extended on each opposite side of PIXEL SEL on a vector along its respective radial line until each side is composed of a certain number of non-defect pixels, ND, (not shown or described with respect to Figures 4 and 5). Preferably, ND represents two or three non-defect pixels. If a line segment cannot be extended on either side of PIXEL SEL to include ND non-defect pixels, then that line segment is not included in SET. This can occur because the line segment extension reached the outer edge of the source image (or defect map) or a maximum distance from PIXEL SEL without locating ND non-defect pixels. Once both sides of any line segment include ND non-defect pixels, it is assured that the line segment has a proper number of non-defect pixels for subsequent processing. Referring to Figures 6 and 7, the second alternative embodiment will now be discussed. Figure 6 is a flow chart describing the extension of one side of line segment LS n from PIXEL SEL . Starting at step 226, multiplier A is first set to 1 (step 228). Variable Q is then set to a desired initial number of non-defect pixels from PIXEL SEL , and variable E to a desired increment number of non-defect pixels (step 230). Next, the first Q adjacent non-defect pixels for the line segment LS n extension from PIXEL SEL is set as Group 1 along a vector corresponding to line segment LS n radial line (step 232). A series of stopping conditions for extending line segment LS n are then checked. First, if Group 1 cannot be established either due to the lack of Q adjacent non-defect pixels or that the edge of the source image (or defect map) was reached, then path 262 from step 232 is followed to step 260 where line segment LS n is not included in SET. Next a check is performed to determine whether the number of pixels in Group 1 exceeds a maximum threshold of line segment non-defect pixels TH MAX (step 236). If so, then the "yes" branch is taken to step 257 where the line segment LS n extension stops at the pixel in Group 1 before TH MAX was exceeded. TH MAX represents the maximum number of non-defect pixels any one side of PIXEL SEL may be composed of. If the number of pixels in Group 1 does not exceed TH MAX , then the "no" branch is taken to step 238 where the first Q + (A*E) adjacent non-defect pixels from PIXEL SEL along the same vector as Group 1 is set as Group 2. If Group 2 cannot be established either due to a lack of Q + (A*E) adjacent non-defect pixels, or that the edge of the source image (or defect map) was reached, then path 263 is taken to step 261 where line segment LS n extension stops at the last pixel in Group 1. Q represents a base number of non-defect pixels in line segment LS n , and E represents the number of successive non-defect pixels added to that base number in each iteration of the extension process, as will be shown below. Figure 7 illustrates an example of extending line segment LS n along a vector 28 from PIXEL SEL in defect region 26 of source image 25. The black dots along vector 28 in Figure 7 represent adjacent non-defect pixels from PIXEL SEL (not drawn to scale). In this example, Q equals 3 and E equals 2. Thus, Group 1 comprises the first three adjacent non-defect pixels closest the PIXEL SEL , and Group 2 comprises five non-defect pixels, that is, the three non-defect pixels in Group 1 and the next two adjacent non-defect pixels from PIXEL SEL after the non-defect pixels of Group 1. Next, a functional model is calculated for each channel k of the pixels in each group. Then, at step 240 a mean square fitting error (MSE g,k ) is calculated for each channel k of their non-defect pixels from their model, where g = 1 and 2, representing Group 1 and Group 2 respectively. Functional model and MSE calculations were described earlier in reference to Figure 4. Next, the MSE's for each channel of each group are summed to provide a sum mean square error value (SMSE g ) for each group g (step 242), where: In the preferred embodiment SMSE g is calculated only when necessary that is the SMSE 2 is stored as SMSE 1 for the next extension step. Next, a RATIO is calculated for the sum mean square errors of Group 2 to Group 1, RATIO = SMSE 2 /Max [SMSE 1 , TH 2 ], where TH 2 is greater than 0 and the Max function selects the greater of the two terms SMSE 1 , and TH 2 (step 244). The next three checks are based upon SMSE 1 , SMSE 2 and RATIO. The first check is performed only once at the beginning of the extension process when A = 1. The first check is whether the sum mean square error calculated for Group 1, SMSE 1 , is greater than a first threshold, TH 1 (step 246). If so, then the "yes" branch is taken to step 254 where line segment LS n is not included in SET. The second check is whether the sum mean square error of Group 2, SMSE 2 , is greater than the first threshold, TH 1 (step 247). The third check is whether RATIO is greater than a third threshold, TH 3 (step 248). These three thresholds TH 1 , TH 2 , and TH 3 are empirically determined such that the more statistically consistent the values of the non-defect pixels are within each group to their model, the further line segment LS n will extend from PIXEL SEL . Preferably, these thresholds are selected to provide that TH 1 is greater than TH 2 , and TH 3 is greater than 1. If all three checks at steps 246, 247, and 248 are false, then their "no" branches are taken to step 250 where the Group 1 pixels are replaced with the pixels of Group 2. Then, A is indexed by one (step 251) and steps 236-248 are repeated as previously described, wherein Group 2 now includes the next E adjacent non-defect pixels from PIXEL SEL in addition to the pixels of Group 1. Using Figure 7 as an example, Group 1 now has five non-defect pixels from PIXEL SEL and Group 2 has seven non-defect pixels from PIXEL SEL along vector 28. If either the second check (step 247) or third check (step 248) is true, then their "yes" branch is taken to step 253 where the line segment LS n extension stops at the last non-defect pixel furthest from PIXEL SEL in Group 1. Groups 1 and 2 will continue to be expanded in the above manner until at least one stopping condition is satisfied. Once the extension of one side of line segment LS n from PIXEL SEL is completed, without an indication of non-inclusion in SET, the above process is repeated for the other side of line segment LS n . In this manner, the total composition of defect and non-defect pixels for each side of line segment LS n is determined or fixed. The above is repeated for each line segment through PIXEL SEL . Finally, the SET of line segments defined at step 202 comprises the line segments which are extended on both sides of PIXEL SEL without a non-inclusion indication. Of the above two alternative embodiment, the second embodiment is preferred because it employs statistical analysis of non-defect pixel values (for example, SMSE) in extending line segments, rather than a constant number of non-defect pixels ND. Further, in the second embodiment, those skilled in the art can appreciate other types of stopping conditions may also be used than those described to provide different line segment extension criteria. Preferably in this apparatus, once non-defect pixels have been estimated and stored in the corrected image (steps 110 and 112 in Figure 3), their estimated corrected values are not used in subsequent correction of other non-defect pixels in the source image. However, where after a single scan of the source image defect pixels remain uncorrected, corrected pixel values alternatively can be used in a second scan for correcting defect pixels. This may be required where the defect region is very large, or the defect region lies near the boundaries of the source image. From the foregoing description, it will be apparent that there has been provided an improved method and apparatus for correcting pixel values in a digital image. Variations and modifications in the herein described system in accordance with the invention will undoubtedly suggest themselves to those skilled in the art. Accordingly, the foregoing description should be taken as illustrative and not in a limiting sense. 8 Apparatus 10 Computer System 12 Processor 14 Memory 16 Internal Bus 18 Hard disk 20 Image reader 22 User interface 24 Image output device 25 Source Image Example 26 Defect Example 27 Window Operator Example 28 Vector 98-261 Steps 262-263 Paths

Claims: A method for correcting one or more defect pixels in a source image with non-defect pixels and the defect pixels, each of the defect pixels and the non-defect pixels being represented by at least one defect pixel signal and non-defect pixel signal, respectively, the method comprising the steps of: selecting one of the defect pixels; allocating a plurality of line segments through the selected defect pixel, wherein each line segment is composed of the defect pixels and the non-defect pixels about the selected defect pixel; determining at least one representative model of the non-defect pixel signals along each line segment; determining the deviation of the non-defect pixel signals along each line segment from the model corresponding to the line segment; selecting the line segment having the lowest deviation; and determining corrected pixel signals for the selected defect pixel based on at least two of the non-defect pixel signals in the selected line segment. A method as claimed in Claim 1 wherein one or more of the defect pixels are located within a defect region of the source image, and the step of selecting one of the defect pixels includes selecting one of the defect pixels in the defect region. A method as claimed in Claim 1 wherein: the defect pixel signals represent channel signals of their corresponding defect pixels; the non-defect pixel signals represent channel signals of their corresponding non-defect pixels; the model determining step further comprises determining a representative model based upon corresponding channel signals of the non-defect pixels along each line segment; and the deviation determining step further comprises determining a deviation of corresponding channel signals of the non-defect pixels along each line segment from the model of the channel signals of the non-defect pixels along the line segment. A method as claimed in Claim 3 wherein: the deviation determining step further comprises the step of determining a total for each line segment based on the deviation of the channel signals of the non-defect pixels; the line segment selecting step further comprises the step of selecting the line segment having the lowest total; and the pixel signals determining step further comprises determining corrected channel signals for the selected defect pixel based on the channel signals of at least two of the non-defect pixels in the selected line segment. An apparatus for correcting values of defect pixels in a source image having a programmed computer with memory for storing the source image, the stored source image comprising a plurality of pixels having signals representing values of one or more color channels, and a defect region comprising the pixels within the plurality having corrupted values, wherein the pixels in the defect region are defect pixels, and the pixels outside the defect region are non-defect pixels, the apparatus comprising: means for selecting one of the defect pixels in the defect region; means for allocating a plurality of line segments through the selected defect pixel, wherein each line segment is composed of pixels in the source image about the selected defect pixel; means for determining for each channel of each line segment a representative model of the non-defect pixel values; means for determining for each channel of each line segment the deviation of the non-defect pixel values in the line segment from their representative model; means for determining a total deviation for each line segment based on the deviation for each channel of the line segment; means for selecting the line segment having the lowest total deviation from among the plurality of line segments; and means for determining a value for each channel of the selected defect pixel based on the values of at least two of the non-defect pixels in the selected line segment.

Inventors: COK DAVID ROY, GRAY ROBERT TERRY, MATRASZEK TOMASZ ANDRZEJ, COK, DAVID ROY, GRAY, ROBERT TERRY, MATRASZEK, TOMASZ ANDRZEJ, Cok, David Roy, c/o Eastman Kodak Co., Gray, Robert Terry, c/o Eastman Kodak Co., Matraszek, Tomasz Andrzej, c/o Eastman Kodak Co.
Applicants: EASTMAN KODAK CO, EASTMAN KODAK COMPANY
Application year: 1996
Main classification: G06T5
IPC codes: G06T5