Image processing apparatus

Abstract: A method of processing an image includes steps of: obtaining data concerning the brightness of an original image; dividing the data concerning the brightness into a plurality of groups for each brightness domain on the basis of the histogram of the data concerning the brightness; preparing correction information for correcting the data concerning the brightness for each of the plurality of groups, and executing image processing to the original image on the basis of the correction information.

Description: BACKGROUND OF THE INVENTION This invention relates to an image processing method and image processing apparatus capable of dodging or shutting light method, and in particular, to an image processing method and image processing apparatus capable of electronically making the image processing for dodging for the image data read by an image reading means. In the case where a film (negative-film or positive-film) photographed in a condition with a large brightness difference is developed and printed on a photographic paper, it sometimes occurs that light portions present a uniformly white appearance losing a light tone (whitened or whitening) or dark portions present a uniformly black appearance losing a detailed tone (blackened or black fill-in). In order to solve the above-mentioned problems of whitening and black fill-in, a technique called 'dodging' or 'burning-in' is sometimes used. The above-mentioned dodging and burning-in (hereinafter referred to as 'dodging' inclusively in this specification) are the methods for obtaining a print without saturation in the light and dark portions, keeping a good contrast and gradation of each photographic object, by giving long time exposure selectively for the area considered to become uniformly white by using a shielding plate with a hole and giving short time exposure selectively for the area considered to become black fill-in by using a shielding plate, while giving usual exposure for the area of intermediate density. Further, in case of printing from a positive-film, a print without saturation can be obtained by the reversed operation of the above. Furthermore, in the case where an electronic image processing is used, there are like problems of uniform whitening and black fill-in in the final print too; hence, a method for eliminating the uniform whitening and black fill-in by compressing the dynamic range of the original image (described in Japanese laid open patent H9-182093), a method for eliminating the whitening and fill-in by carrying out the dodging image processing preparing a dodging mask from the original (described in Japanese laid open patent H9-18704), and so forth have been proposed. In the method described in the Japanese laid open patent H9-182093 to compress the dynamic range, it is produced the problem that the contrast and gradation of each photographic object can not be reproduced because the dynamic range is wholly compressed. Further, in the method described in the Japanese laid open patent H9-18704 to carry out dodging by preparing a dodging mask, the proper effect of dodging is also not to be obtained like the method described in the Japanese laid open patent H9-182093, because the original is subjected to lowpass filter processing and then a dodging mask having a gradation compressed by a gradation-compressing LUT is applied together with the original image. EP-A-0,772,158 discloses an image processing system in accordance with the pre-characterising portion of the independent claims. It describes a method for producing contrast enhanced digital images by producing a histogram having a first axis corresponding to a measurable property (e.g. luminance) and a second axis corresponding to a count of a particular value for the measurable property. The histogram is divided into clusters and histogram equalisation or stretching is performed on each cluster to modify the histogram. The modified histogram is used to adjust the value of the measurable property, e.g. luminance, to enhance the image contrast. EP-A-0,772,342 also discloses a histogram-based method of adjusting the dynamic range of digital image signals. Different rates of dynamic range compression are set for regions of the image signal in which the signal value is comparatively large and comparatively small. Dynamic range compression is carried out on the basis of the dynamic range compression rate thus set. EP-A-0,288,042 again discloses a histogram-based method of image processing in which the histogram of the image signals is divided into small regions by an automatic threshold value selecting method. A desired small region corresponding to a desired image portion is distinguished and the desired image signal range for that region is determined on the basis of the statistics for the histograms of the desired small region. Accordingly, it is an object of this invention to actualize an image processing method and an image processing apparatus capable of practising an image processing for dodging, i.e. getting rid of the saturation at the light portions and at the dark portions with the contrast and gradation reproduction. of each photographic object kept good. According to the present invention there is provided a method of processing an image, comprising the steps of: obtaining brightness data of an original image; and dividing the brightness data into a plurality of brightness groups on the basis of a histogram of the brightness data, wherein the plurality of brightness groups include at least a first brightness group having a first peak frequency therein and a second brightness group having a second peak frequency therein, characterised in that the method further comprises a step of preparing a first brightness correction value and a second brightness correction value and steps of adding the first brightness correction value into all the brightness data of the first brightness group and adding the second into all the brightness correction value into brightness data of the second brightness group, wherein the first brightness correction value and the second brightness correction value are determined in such a way that the first peak frequency and the second peak frequency are relatively shifted to come closer to each other and the range of brightness of the original image is reduced. One of the first and second brightness correction values may be zero so that only one of the first or second peak frequencies are shifted. On the other hand, one of the correction values may be positive and the other negative, so that the two peak frequencies are shifted towards each other. The method may further comprise producing a mask to correct the brightness data for each of the plurality of groups, and blurring the mask by using a blurring filter so as to prepare correction value. The producing step may produce the mask such that each brightness having the peak frequency in each brightness group comes relatively close to each other, and the data in the mask are equal for plural pixels belonging to the same brightness group amongst the plurality of brightness groups. The invention also provides image processing apparatus for performing the method, and extend to a computer program storage medium carrying a program to execute the method. Incidentally, in this specification, 'data concerning the brightness' means, in addition to the brightness, various pieces of information concerning the lightness of the photographic object such as the transmission (reflection) density of the original, the print exposure quantity E, logE, and the transmittance (reflectance) of the original. Further, in this specification, 'the set' means the peak of the histogram, the set as the positions of the image or the like. Furthermore, in this specification, 'a mask' means data composed of the data of a pixel group having the same size as the image, being the one for being subjected to various kinds of processes with the data of the corresponding pixels of the original image. In this invention, the original image data are divided into a plurality of groups or blocks on the basis of the data concerning the brightness of the original image. Then, a dodging mask for adding it to the image data of at least one of these plural blocks or groups, a correction value different to those added to the other blocks or groups, is prepared. Further, regarding the dividing of the data into a plurality of blocks or groups, a dividing process is carried out in accordance with the frequencies of emergence or with the manner of the arrangements at the respective image positions of the data concerning the brightness of the original image. Furthermore, image processing such as adding calculation is carried out for the respective pixels of this mask and those of the original image corresponding to them; hence, it is actualized the image processing for dodging to get rid of saturation at the light portions and dark portions, with the contrast and gradation reproduction of each of the photographic objects kept good. Further, in the above-mentioned image processing method, it is favorable that the image processing is such a processing as to add the data of the original image to the data of the mask for each of the corresponding pixels. Moreover, it is also favorable that the data is divided into a plurality of groups on the basis of the histogram of the data concerning the brightness; it is also favorable that the data is divided into a plurality of groups on the basis of the shape of the histogram. Furthermore, it is also favorable that the mask is the one for dodging for adding it to the data of at least one of the plural groups a correction value different to those added to the other groups. The invention will be further described by way of example with reference to the accompanying drawings, in which:- Fig. 1 is a block diagram showing each of the function blocks of the electrical structure of the image processing apparatus used in the first embodiment of this invention; Fig. 2 is a flow chart showing the steps of the procedure of the processing of the image processing apparatus used in the first embodiment of this invention; Fig. 3 is a schematic illustration showing the steps of the procedure of the image processing in the first embodiment of this invention; Figs. 4(a) to 4(c) are illustrations schematically showing how the histogram corresponds to an image in the first embodiment of this invention; Figs. 5(a) to 5(d) are illustrations schematically showing how the original mask is prepared; Figs. 6(a) to 6(c) are illustrations schematically showing how the histogram is divided and corrected in the first embodiment of this invention; Fig. 7 is an illustration showing an example of the dodging mask in the first embodiment of this invention; Fig. 8 is a flow chart showing the steps of the procedure of the main part of the processing in the second embodiment of this invention; Fig. 9 is an illustration for explaining the processing in the second embodiment of this invention; Fig. 10 is an illustration for explaining the processing in the second embodiment of this.invention; and Figs. 11(a) and (b) are illustrations for explaining the processing in the second embodiment of this invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT <THE FIRST EXAMPLE OF THE EMBODIMENT> The image processing apparatus as an apparatus carrying out the image processing method of an example of the embodiment of this invention will be explained with reference to the block diagram in Fig. 1. 100 is the scanner as the image reading means, which reads the desired image from a light transmitting original such as a photographic film or a light reflecting original such as a printed matter and outputs it as digital data. 200 is the image processing apparatus, the main part of this invention, and is provided with all the processing means to be described later. 300 is the printer as the image outputting means, which prints the image processed by the image processing apparatus 200. 400 is the display control portion, which carries out the display control of the image processed in the image processing apparatus 200 (generation of the image to be displayed). 500 is the display means such as a CRT display portion, which displays the image generated in the display control portion 400. Further, in this CRT display portion 500, it is possible to confirm the image to be printed by displaying it beforehand. In the following, each of the processing means in the image processing apparatus will be explained. 201 is the density value LUT, which is an LUT for converting the digital data from the scanner 100 into the data of negative-density data values. 210 is the reduction processing portion, which is the processing means for reducing the image obtained by the pre-scan to an image having a predetermined size. 220 is the brightness information generating portion, which is the processing means for generating the image having brightness information by making an average of the plural colors R, G, B or Y, M, C or the like. 230 is the histogram making portion, which is the processing means for making a histogram of the brightness values for the data of the image having the brightness information. 240 is the judgment process portion, which divides the sets of the emergence frequencies of these data concerning the brightness into a plurality of blocks at need, by the image judging process to be described later, and determines the correction values in accordance with at least one of these plural blocks. 250 is the original mask preparing portion, which is the processing means for preparing the original mask corresponding to the image, which is the base of the dodging mask, in accordance with the blocks divided by the aforesaid judgment processing. 260 is the blurring filter processing portion, which is the processing means for giving said original mask such amount of blur as to be required in the dodging mask processing by executing the blurring process to said original mask by a blurring filter. 270 is the enlargement processing portion, which is the processing means for producing the dodging mask by enlarging the original blurring mask to the size having the same number of pixels as the properly scanned image. Further, interpolation of pixels is also done at the time of enlargement processing. As for this interpolation technique, various kinds of the methods, for example, bilinear (linear interpolation) method, cubic convolution method, etc. are known, but any other method may be appropriate if it is the one capable of smooth interpolation processing. 280 is the combining portion, which is the processing means for combining the respective corresponding pixels of the proper-scan image and the dodging mask by an adding operation. Further, Fig. 2 is a flow chart showing the steps of the procedure of the processing of the image data practiced by the image processing apparatus 200. In the following, the explanation will be given in accordance with the steps of the procedure of the processing shown in Fig. 2. Furthermore, Fig. 3 is an illustration schematically showing the data produced and prepared with the processing, and Fig. 4 shows an example of an original image and its contents as well as the histogram produced from the original image. Further, figures on and after Fig. 5 are illustrations for explaining the respective processing. First, a negative-film with an original image recorded on it or the like is set on the scanner 100 to practice a pre-scan (S1 in Fig. 2). This pre-scan is the process for displaying the image to be printed previously before printing, and further by this display, for judging the necessity of the dodging processing and confirming the result; hence, the number of the pixels to be read may be small. For instance, in the case where the proper scan has 1024 (vertical) x 1536 (horizontal) pixels, the pre-scan should be of 256 x 384 pixels. Further, this pre-scan gives the data of 256 x 384 pixels x 3 colors by being practiced for the three colors R, G, B simultaneously or sequentially ((2) in Fig. 3). Further, the data obtained by this pre-scan are converted into the data of negative-density values by the density value LUT 201. Next, these data are reduction-processed by the reduction processing portion 210, and a reduced pre-scan image having a size suitable for the dodging processing ((3) in Fig. 3) is produced (S2 in Fig. 2). This reduced pre-scan image should be of 64 x 96 pixels x 3 colors, or of 128 x 192 pixels x 3 colors. It is favorable to carry out the reduction processing by simply averaging the data of neighboring four to sixteen pixels, because the effect of reduction of noises can be obtained. After that, the image for the brightness information is produced (S3 in Fig. 2), by making the reduced pre-scan image, which is a color image, a black-and-white image in the brightness information generating portion. In this case, a monochromatic image for the brightness information having 64 x 96 pixels is obtained ((4) in Fig. 3). Then, regarding the image for the brightness information, a histogram of the frequencies of emergence vs. brightness is prepared (S4 in Fig. 2), on condition that the original image is such one as is shown in Fig. 4(a) in this case. Further, the contents of the image are shown in Fig. 4(b) because the detailed color tone and gradation can not be shown in Fig. 4(a). In this image, the sky, a sea, green objects, a person, a pool, a handrail, the ground, etc. are included. In this case, after the above-mentioned image obtained by the pre-scan is reduction-processed (Fig. 5(a)) and the image for the brightness information is produced (Fig. 5(b), the histogram as shown in Fig. 4(c) is prepared from the image for the brightness information by the histogram making portion 230. Then, regarding this histogram, the judgment process portion 240 executes the image judging process, and divides the sets of emergence frequencies of the data concerning the brightness into a plurality of blocks (S5 in Fig. 2). In this case, the data are divided into two or more blocks by setting a threshold value using the discrimination criterion method or the like. Further, with reference to this histogram, if the maximum density and the minimum density are included in the predetermined range M, the dodging process is judged to be not necessary, and if they are out of the above-mentioned range M, the processing is continued; however, in the case where the image is displayed on the CRT display portion 500 and the operator instructs the dodging processing, a definite amount of dodging processing may be done regardless of the value of M. Furthermore, regarding the method for dividing the original image into a plurality of blocks or groups (hereinafter referred to simply as a plurality of blocks) on the basis of the data concerning the brightness of the original image, in this example of the embodiment, the dividing process is done by obtaining a threshold value of the data concerning the brightness through applying the discrimination criterion method to the histogram; however in addition to this, as the method for obtaining the threshold value, the one such that the threshold value is obtained from the shape of the peaks and dips of the histogram or from the shape and the inflection point of the accumulated density function is to be cited. Further, it may be appropriate to use the following methods: the method dividing the original image into a plurality of blocks by using the techniques such as the edge detection in the image field, the domain detection, and the pattern matching; and the one first dividing the original image roughly into a plurality of blocks by obtaining the threshold values of the brightness from said shape of the histogram or the accumulated density function, and next finely defining the domain borders by using the techniques such as said edge detection in the image field, domain detection, and pattern matching. In this case, it is appropriate to obtain first the data relating to the average values or the representative values of the data concerning the brightness of the image data in the determined domains, and next, from the relations of these data, to obtain the correction values corresponding the respective blocks. It is shown herein an example in which the image data are divided into two blocks by a single threshold value and the dodging mask having a single correction value is prepared on the basis of one of the blocks; however, it may be appropriate to prepare the dodging mask having a plurality of correction values by dividing the data into more blocks. Further, another example wherein the data are divided into three or more blocks by using two or more threshold values will be explained in detail later. In the case where the histogram of the brightness is the one as shown in Fig. 6(a), several peaks and the dips between them are detected from the shape of the histogram. Then, in this case, a dip bordering the highlight side to the shadow side is searched to be found, and this dip portion is made a dividing point (Fig. 6(b)). Further, the correction value by the dodging mask should be obtained in the judgment process portion 240, in order that the maximum density and the minimum density may be included in the predetermined range M. Now, the dodging mask shall be prepared in accordance with at least one of the plural blocks (S6 in Fig. 2). First, the original mask preparing portion 250 produces the image, which is binarized by making the brightness of this dividing point the threshold value, from the image for the brightness information (Fig. 5(c)). Further, the original mask is produced by reversing this binarized image (S6 in Fig. 2, (5) in Fig. 3, Fig. 5(d)). In this case, the data of 64 x 96 pixels x 1 (color), the same as the image for the brightness, can be obtained. Next, the blurring filter processing portion 260 executes the blurring filter processing of the order 3 x 3 - 5 x 5 to the original mask (S7 in Fig. 2). At this time, the blur processing is to be repeated plural number n times so that the mask may have a suitable amount of blur for dodging (S8 in Fig. 2). Then, the enlargement processing portion 270 executes the enlargement processing to the original mask which is given a suitable amount of blur to prepare the dodging mask enlarged to the same size (1024 (vertical) x 1536 (horizontal) pixels) as the proper-scan image obtained by the proper scan (S9 in Fig. 2, (6) in Fig. 3). In addition, it is shown in Fig. 7 the mask prepared by blur-processing and enlarging the original mask as described in the above. Further, by enlarging the original mask to the same size as the proper-scan image after it is blur-processed in the reduced original mask stage as stated in the above, it is made easy to cope with various kinds of proper-scan image sizes. Especially, even in the case where it is required to make the process speed high, it is easy to cope with those various sizes. After the dodging mask is prepared in the above-mentioned manner, or while the mask is being prepared, the proper scan is carried out to obtain the proper-scan image (S10 in Fig. 2, (7) in Fig. 3). This proper-scan image have the data of 1024 (vertical) x 1536 (horizontal) pixels x 3 colors. Then finally, in the combining portion 280, the proper-scan image is combined with the dodging mask (S11 in Fig. 2) to obtain the dodged output image ((8) in Fig. 3). In this case, the same dodging mask is combined with the data for the respective colors of the proper-scan image. In addition, this word 'combining' means doing adding operation with the respective data of the corresponding pixels of the dodging mask and the original image. In this case, it is carried out the processing to add the data of the dodging mask with the correction value having been obtained in the aforesaid judgment process portion 240 to the data for the respective colors of the proper-scan image. For instance, in order to suppress the whitening effect in the highlight area, it is suitable to add the dodging mask having a negative correction value. On the other hand, for suppressing the black fill-in in the shadow area, it is suitable to add the dodging mask having a positive correction value. Fig. 6(c) shows schematically how the whitening effect in the highlight area is prevented by the addition of the dodging mask with a negative correction value. As has been explained in detail up to now, in this example of the embodiment, a sufficient consideration is made so that the rough gradation such as the highlight and shadow in the blocks should not be varied to the utmost and it is practiced an image processing such that the brightness is shifted by the dodging mask; hence, it is actualized the dodging image processing to get rid of the saturation in the light area or in the dark area, with the contrast and the gradation reproduction of each of the photographic objects kept good. <THE SECOND EXAMPLE OF THE EMBODIMENT> Now, as the second example of the embodiment, an example wherein the histogram is divided by a plurality of threshold values will be explained. In this example of the embodiment, only the image judging process (S5 in Fig. 2) will be explained in detail with reference to the flow chart in Fig. 8. In other words, the explanation for the steps S1 (pre-scan) - S4 (making histogram) and S6 (preparing original mask) - S11 (combining dodging mask with proper-scan image) as shown in Fig. 2 will be omitted because they are approximately the same in both examples of the embodiment. First, scene discrimination before processing is carried out with reference to the histogram (S1 in Fig. 8). This scene discrimination before processing is a process judging if the dodging process is necessary or not; that is, by comparing the predetermined density range M with the density range N to be obtained from this histogram, the judgment is done in a manner such that the dodging process is necessary or not according as M < N or M ≥ N. Further, as for N, it is obtained by defining the maximum density as the point of X% from the top of the histogram, and the minimum density as the point of X% from the bottom of the histogram, where X is determined beforehand as any one of the values 0 - 5. Hereinafter, the explanation will be continued on condition that M < N and accordingly the dodging process is necessary (S2 in Fig. 8). Now, using discrimination criterion method, the histogram is divided into two blocks (the block in the highlight side and the block in the shadow side) by the threshold value Th0 (S3 in Fig. 8). In addition, the discrimination criterion method is a technique to determine the threshold value at the time of dividing into two the histogram used in making the image binarized or in other process. That is, at the time of dividing one histogram into two, the method determines the threshold value to make each of the histograms of the divided blocks arranged to be the smallest in a manner such that the covariance of the divided two groups becomes the smallest. Then, using the discrimination criterion method again, the block in the shadow side is further divided into two blocks by the threshold value Th1. Moreover, the block in the highlight side is further divided into two blocks by the threshold value Th2 (S4 in Fig. 8). Owing to the above, the histogram is divided into four blocks by the three threshold values. Further, instead of the above-mentioned method of determining the threshold value, the peaks and dips of the histogram are detected after it is smoothed by a suitable filter, and the threshold values may be determined successively from the largest one among the larger ones out of them. Next, in order to judge if the threshold values having divided the histogram in this manner are appropriate or not, the following characteristic values are calculated (S5 in Fig. 8). Here, the notations are set as follows: sig*: the standard deviation of the data in each range, av*: the average value of the data in each range, and wt*: the percentage [%] of the pixels present in the vicinity (± 2 [negative-density x 100], for example) of the threshold value. That is, in the example shown in Fig. 9, the detailed ones are as follows: sig1: the standard deviation of the data in the range of the minimum value - the maximum value, sig2: the standard deviation of the data in the range of the minimum value - the threshold value, sig3: the standard deviation of the data in the range of Th0 - the maximum value, sig4: the standard deviation of the data in the range of the minimum value - Th1, sig5: the standard deviation of the data in the range of Th1 - Th0, sig6: the standard deviation of the data in the range of Th0 - Th2, sig7: the standard-deviation of the data in the range of Th2 - the maximum value, sig8: the standard deviation of the data in the range of Th1 - the maximum value, sig9: the standard deviation of the data in the range of the minimum value - Th2, av1: the average value of the data in the range of the minimum value - the maximum value, av2: the average value of the data in the range of the minimum value - Th0, av3: the average value of the data in the range of the Th0 - the maximum value, av4: the average value of the data in the range of the minimum value - Th1, av5: the average value of the data in the range of Th1 - Th0, av6: the average value of the data in the range of the Th0 - Th2, av7: the average value of the data in the range of Th2 - the maximum value, av8: the average value of the data in the range of Th1 - the maximum value, av9: the average value of the data in the range of the minimum value - th2, wt1: the percentage of the pixels present in the vicinity of the threshold value Th0 [%], wt2: the percentage of the pixels present in the vicinity of the threshold value Th1 [%], wt3: the percentage of the pixels present in the vicinity of the threshold value Th2 [%], Now, it is judged if each of the threshold values are effective or not by the following three discrimination inequalities. Here, let C1, C2, and C3 be the predetermined discrimination constants respectively. (av3 - av2)/(sig2 + sig3) > C1, (sig2 + sig3)/sig1 < C2, and wt1 < C3. If the above three inequalities are established, the threshold value Th0 is effective. Further, if the following three inequalities are established, the threshold value Th1 is effective. (av5 - av4)/(sig4 + sig5) > C1, (sig6 + sig5)/sig2 < C2, and wt2 < C3. Furthermore, if the following three inequalities are established, the threshold value Th2 is effective. (av7 - av6)/(sig6 + sig7) > C1, (sig6 +sig7)/sig3 < C2, and wt3 < C3. Next, the correction values concerning the blocks divided by the effective threshold values are calculated (S6 in Fig. 8). Here, the explanation will be given on condition that the Th0 and Th1 are effective, and Th2 is ineffective. For this reason, as shown in Fig. 10, the following processing for calculating the correction values are to be continued, setting that the 'range 1' is from the minimum value to Th1, the 'range 2' is from Th1 to Th0, and the 'range 3 is from Th0 to the maximum value. That is, it is necessary that the maximum correction value L satisfies the following equation: L = (the maximum value - the minimum value) - M, in order that the density range to be obtained from the histogram may be included in the predetermined density range M. In addition, regarding this maximum correction value L, it is possible to set that it has a constant rate (0.1 - 0.5) for the designated scene. When this correction value is distributed equally to each of the range 1 - range 3, the coefficient of correction K is defined by the following equation: K = 1.0 - (av3 - av4)/{(av3 - av4) + L}. In this case, the respective correction values J1 - J3 for the range 1 - the range 3 are given by the following equations: J1 = (av1 - av4) x K, J2 = (av1 - av5) x K, and J3 = (av1 - av3) x K. Further, by adding the correction values of the respective ranges to the image data belonging to the respective ranges, it is possible to make the range of the brightness to be nearly included in the desired range. In addition, because the correction values are used as the blurred mask, it is possible that, microscopically viewing, some parts that are not included in the range are present; however, no problem will never occur in practical use. It is desirable that the correction values for the respective ranges J1 - J3 are restricted in the following ranges: |(J1) - (J2)| < (the density range of the range 1), |(J1) - (J2)| < (the density range of the range 2), |(J2) - (J3)| < (the density range of the range 2), and |(J2) - (J3)| < (the density range of the range 3). By the above-mentioned conditions, in the aforesaid histogram, for example, it can be solved a problem such that the resultant value of the correction for the lowest density belonging to the range 2 is made a smaller value than the resultant value of the correction for the lowest density (minimum density) belonging to the range 1, the darker block to make the image lacking in natural tone as a photograph. However, regarding the density ranges of the right-hand sides of the above inequalities, in the case where there are deviations in the emergence frequencies of the data in the respective ranges, sometimes no remarkable gradation reversing occurs even though a correction values larger than those defined by the inequalities are used. For instance, in the case where the histogram is present in the range 1 - range 3 as shown in Fig. 11(a), it appears the state where nearly no data are present in the neighborhood of the threshold value Th1. In this case, no problem occurs because it is small the amount of data (number of pixels) which makes the gradation completely reversed, even if the corrections exceeding the ranges of the above inequalities are executed as shown in Fig. 11(b). In addition, it is favorable that the amount of data which makes the gradation completely reversed should not be more than 10% of the amount of the data in the range which includes less image data than the other of the relating ranges (the range 1 and the range 2 in this case). Further, when the following definition are made: the number of data d1: the number of data, of which the value is made smaller than the minimum value of the data belonging to the range 1 by the correction, among the data belonging to the range 2, and the number of data d2: the number of data, of which the value is made larger than the maximum value of the data belonging to the range 2 by the correction, among the data belonging to the range 1, the number of the data Dr which makes the gradation completely reversed is expressed as follows: Dr = d1 + d2. In any one of the cases where the correction values are not within the range defined by the above-mentioned inequalities, the following additional correction value j, which varies in accordance with the image density data value, is defined and can be used by being added to the correction values J of the respective ranges determined to be within the possible ranges, because sufficient corrections can not be made by only the correction values defined by the above-mentioned inequalities. j[x] = (continuous correction coefficient) x {av1 - (image density data value)}, where, (continuous correction coefficient) = 1.0 - M/(j + M), and j = L - (|(J1)| + |(J2)| + |(J3)|). Accordingly, the final correction value C is obtained by the following equation corresponding to each density value x: C[x] = (additional correction value j[x] corresponding to x) + (the correction value J[class] of the range to which x belongs), where, the class is any one of 1 - 3. In the above mentioned manner, it is determined the equation for calculating the correction values at the time of preparing the dodging mask through dividing the histogram, the data of the original mask are converted by the equation for calculating the correction values, and the dodging mask is obtained by this blur processing. Further, when the correction value C[x] is obtained in the above-mentioned manner, it is desirable that the amount of blur at the time of blurring the original mask should be varied in accordance with the correction value. That is, it is favorable from the view point that more natural result of correction can be obtained, to cope with the variation of the correction value by changing the size of the blurring filter and the number of times of filtering in accordance with the correction value. In the above, the case where there are two effective threshold values has been shown, but in the case where there is only one effective threshold value, a similar processing is also possible. Further, according to this method, the correction value is obtained on the basis of the average value of the image information of a whole image field; hence, the dodging process can be actualized without the need to add any modification to the other various kinds of image processing algorithm such as density- and color- correction required in photographic printing. Moreover, because the practical dodging process is a simple one only adding the correction values to the original image, the processing for the scene which does not need the dodging process may be done by merely deleting the adding instruction only, or skipping it; therefore, the method has also an advantage that the selection to use or not to use the function is possible without giving any influence to the other necessary image processing algorithms. In the above embodiments mentioned above, after the proper-scan image is synthesized or combined with the blurring mask, it may be preferable to change the contrast of the entire image in accordance with the strength of the effect of the dodging (soft-focus). The processing in the image processing section 200 in the above examples may be conducted by a hardware or a software. In the case that the processing is conducted by a software, a program is read out from a medium in which the programs capable of conducting steps indicated in the flowchart of each example are memorized and then the image processing section 200 conducts the processing in accordance with,the program.

Claims: A method of processing an image, comprising the steps of: obtaining brightness data of an original image (S1-S4); and dividing the brightness data into a plurality of brightness groups on the basis of a histogram of the brightness data (S5), wherein the plurality of brightness groups include at least a first brightness group having a first peak frequency therein and a second brightness group having a second peak frequency therein, characterised in that the method further comprises a step (S6) of preparing a first brightness correction value and a second brightness correction value and steps of adding the first brightness correction value into all the. brightness data of the first brightness group and adding the second brightness correction value into all the brightness data of the second brightness group, wherein the first brightness correction value and the second brightness correction value are determined in such a way that the first peak frequency and the second peak frequency are relatively shifted to come closer to each other and the range of brightness of the original image is reduced. The method of claim 1, characterised in that one of the first and second brightness correction values is zero so that one of the first peak frequency and the second peak frequency is shifted. The method of claim 1, characterised in that one of the first and second brightness correction values is a positive value and the other one is a negative value so that the first peak frequency and the second peak frequency are shifted to come closer to each other. The method of claim 1, characterised in that the preparing step comprises: producing a mask to correct the brightness data for each of the plurality of groups (S6); and blurring the mask by using a blurring filter so as to prepare the correction value (S7). The method of claim 4, characterised in that the producing step produces the mask such that each brightness having the peak frequency in each brightness group comes relatively close to each other and the data in the mask are equal for plural pixels belonging to the same brightness group among the plurality of brightness groups. An apparatus for processing an image, comprising: a data obtaining section (201, 210, 220) for obtaining brightness data of an original image; a dividing section (230) for dividing the brightness data into a plurality of brightness groups on the basis of the histogram of the brightness data, wherein the plurality of brightness groups include at least a first brightness group having a first peak frequency therein and a second brightness group having a second peak frequency therein; characterised in that the apparatus further comprises a preparing section (240, 250, 260) to prepare a first brightness correction value and a second brightness correction value and an adding section to add the first brightness correction value into all the brightness data of the first brightness group and to add the second brightness correction value into all the brightness data of the second brightness group, wherein the preparing section (240, 250, 260) determines the first brightness correction value and the second brightness correction value in such a way that the first peak frequency and the second peak frequency are relatively shifted to come closer to each other and the range of brightness of the original image is reduced. The apparatus of claim 6, characterised in that the preparing section (240, 250, 260) comprises: a producing section (250) for producing a mask to correct the brightness data for each of the plurality of brightness groups; and a blurring section (260) for blurring the mask by using a blurring filter so as to prepare the correction value. The apparatus of claim 7, wherein the producing section (240, 250, 260) produces the mask such that each brightness having the peak frequency in each group comes relatively close to each other and the data in the mask are equal for plural pixels belonging to the same group among the plurality of brightness groups. A media in which a program to execute an image processing is stored and from which the program is read by a computer to execute the image processing comprising steps of: obtaining brightness data of an original image (S1-S4); and dividing the brightness data into a plurality of brightness groups on the basis of the histogram of the brightness data (S5), wherein the plurality of brightness groups include at least a first brightness group having a first peak frequency therein and a second brightness group having a second peak frequency therein, characterised in that the method further comprises a step (S6) or preparing a first brightness correction value and a second brightness correction value and steps of adding the first brightness correction value into all the brightness data of the first brightness group and adding the second brightness correction value into all the brightness data of the second brightness group, wherein the first brightness correction value and the second brightness correction value are determined in such a way that the first peak frequency and the second peak frequency are relatively shifted to come closer to each other and the brightness range of the original image is reduced. The media of claim 9, characterised in that one of the first and second brightness correction values is zero so that one of the first peak frequency and the second peak frequency is shifted. The media of claim 9, characterised in that one of the first and second brightness correction values is a positive value and the other one is a negative value so that the first peak frequency and the second peak frequency are shifted to come closer to each other. The media of claim 9, characterised in that the preparing step comprises: producing a mask to correct the brightness data for each of the plurality of groups (S6); and blurring the mask by using a blurring filter so as to prepare the correction value (S7). The media of claim 9, characterised in that the producing step produces the mask such that each brightness having the peak in each brightness group comes relatively close to each other and the data in the mask are equal for plural pixels belonging to the same brightness group among the plurality of brightness groups.

Inventors: NOMURA SHOUICHI, NOMURA, SHOUICHI
Applicants: KONISHIROKU PHOTO IND, KONICA CORPORATION
Application year: 1999
Main classification: H04N1
IPC codes: H04N1