Image converting method and image converting apparatus

- Oki Data Corporation

An image converting apparatus has: a parameter setting unit which sets parameters for converting each pixel of an input image into predetermined chromaticity coordinate values; a chromaticity coordinate converting unit which obtains conversion chromaticity coordinate values obtained by converting each pixel by the set parameters; a color region obtaining unit which obtains a color region including 2-dimensional conversion chromaticity coordinate values obtained by projecting each conversion chromaticity coordinate value onto a unit plane; an area calculation processing unit which calculates an area of the color region obtained every parameter and obtains parameter values at the time of the maximum area value; and an image converting unit which converts the input image by the parameter values. The image data unbalanced in color arrangement of an object is converted into image data obtained under an ideal white light source.

Skip to: Description  ·  Claims  · Patent History  ·  Patent History
Description
BACKGROUND OF THE INVENTION

[0001] 1. Field of the Invention

[0002] The invention relates to an image converting method and an image converting apparatus for converting image data influenced by a colored light source upon photographing into image data obtained under an ideal white light source.

[0003] 2. Related Background Art

[0004] When an object to be photographed is photographed by using, for example, a fluorescent lamp as a light source, image data in which the object is bluish is obtained. An image converting method called a gray world (hereinafter, simply referred to as a gray world) is used to eliminate such an influence of the colored light source.

[0005] According to the gray world, it is presumed that a color obtained by averaging chromaticity coordinate values of respective pixels of the image data becomes chromaticity coordinate values showing achromatic gray, and by converting the image data by using such chromaticity coordinate values showing the achromatic gray, that is, by executing what is called a chromatic adaptation conversion, bluishness is eliminated. That is, the gray world is a method of obtaining the same image data as that photographed under an ideal white light source in which spectra are uniformed as shown in FIG. 6. A technique using the gray world has been disclosed in a patent literature 1 (JPA-2002-232901).

[0006] According to the conventional gray world, the conversion is performed to the image data by using the chromaticity coordinate values obtained by averaging the chromaticity coordinate values of the respective pixels. That is, the averaging of the chromaticity coordinate values of the respective pixels is performed to obtain average values of the chromaticity coordinate values which take into consideration of a frequency of occurrence of the color of each pixel. Therefore, average values of chromaticity coordinate values of image data obtained by photographing, for example, a small white sandy beach, a blue sea, and a blue sky, as objects, by using a digital camera or the like are not chromaticity coordinate values showing the achromatic gray but chromaticity coordinate values which are deviated to blue and based on blue. Therefore, even if the conversion is executed by using those chromaticity coordinate values, the image data cannot be properly converted into the image data which is obtained under the ideal white light source.

SUMMARY OF THE INVENTION

[0007] It is, therefore, an object of the invention to provide an image converting method and an image converting apparatus which can convert image data whose photographed object is unbalanced in color arrangement into the image data which is obtained under an ideal white light source.

[0008] According to the first aspect of the invention, to accomplish the above object, there is provided an image converting method comprising the steps of: converting chromaticity coordinate values which each pixel of an input image consisting of a plurality of pixels has into a 2-dimensional chromaticity coordinate plane and obtaining 2-dimensional conversion chromaticity coordinate values of each pixel; obtaining an outline of a color region defined by the 2-dimensional conversion chromaticity coordinate values of the plurality of pixels converted into the 2-dimensional chromaticity coordinate plane; obtaining 2-dimensional conversion chromaticity coordinate values, on a 2-dimensional chromaticity coordinate plane, of a barycenter of an area of a region which is specified by the outline of the color region; and executing a color conversion of the input image by using the 2-dimensional conversion chromaticity coordinate values of the barycenter as a new coordinate origin.

[0009] Each pixel of an input image is converted into 2-dimensional conversion chromaticity coordinate values obtained by projecting conversion chromaticity coordinate values obtained by converting each pixel by using parameters for converting into chromaticity coordinate values onto a unit plane, in a color region including the 2-dimensional conversion chromaticity coordinate values, parameter values in which an area of the color region becomes the maximum are obtained, and the input image is converted by the obtained parameter values.

[0010] Each pixel of an input image is converted into 2-dimensional conversion chromaticity coordinate values obtained by projecting conversion chromaticity coordinate values obtained by converting each pixel by using parameters for converting into chromaticity coordinate values onto a unit plane, parameter values in which a barycenter of a color region including the 2-dimensional conversion chromaticity coordinate values is set to ⅓ are obtained, and the input image is converted by the obtained parameter values.

[0011] The parameter values can be obtained when the barycenter lies within a predetermined threshold value including ⅓.

[0012] According to the second aspect of the invention, there is provided an image converting apparatus comprising: a parameter setting unit which sets parameters for converting each pixel of an input image into predetermined chromaticity coordinate values; a chromaticity coordinate converting unit which obtains conversion chromaticity coordinate values obtained by converting each of the pixels on the basis of the parameters set by the parameter setting unit; a color region obtaining unit which obtains a color region including 2-dimensional conversion chromaticity coordinate values obtained by projecting each of the conversion chromaticity coordinate values onto a unit plane; an area calculation processing unit which calculates an area of the color region with respect to the parameters and obtains parameter values at the time when the calculated area value becomes the maximum; and an image converting unit which converts the input image on the basis of the obtained parameter values.

[0013] According to the third aspect of the invention, there is provided an image converting apparatus comprising: a parameter setting unit which sets parameters for converting each pixel of an input image into predetermined chromaticity coordinate values; a chromaticity coordinate converting unit which obtains conversion chromaticity coordinate values obtained by converting each of the pixels on the basis of the parameters set by the parameter setting unit; a color region obtaining unit which obtains a color region including 2-dimensional conversion chromaticity coordinate values obtained by projecting each of the conversion chromaticity coordinate values onto a unit plane so that additive color mixture can be performed; a barycenter calculation processing unit which calculates a barycenter of the color region with respect to the parameters and obtains parameter values at the time when the calculated barycenter is set to ⅓; and an image converting unit which converts the input image on the basis of the obtained parameter values.

[0014] The barycenter calculation processing unit can obtain the parameter values at the time when the barycenter lies within a predetermined threshold value including ⅓.

[0015] The above and other objects and features of the present invention will become apparent from the following detailed description and the appended claims with reference to the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

[0016] FIG. 1 is a block diagram of an image converting apparatus according to an embodiment 1;

[0017] FIG. 2 is a diagram showing conversion chromaticity coordinate values (R′, G′, B′);

[0018] FIG. 3 is a diagram showing 2-dimensional conversion chromaticity coordinate values (r′, g′);

[0019] FIG. 4 is a diagram showing a color region;

[0020] FIG. 5 is a flowchart showing the operation of the image converting apparatus according to the embodiment 1;

[0021] FIG. 6 is a diagram showing spectral distribution of an ideal white light source;

[0022] FIG. 7 is a block diagram of an image converting apparatus according to an embodiment 2; and

[0023] FIG. 8 is a flowchart showing the operation of the image converting apparatus according to the embodiment 2.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0024] Embodiments of the invention will be described in detail hereinbelow with reference to the drawings.

[0025] <Embodiment 1>

[0026] FIG. 1 is a block diagram of an image converting apparatus 10 according to an embodiment 1.

[0027] The image converting apparatus 10 comprises: an input image holding unit 11 which holds an input image, that is, image data to be converted; a parameter setting unit 12 which sets predetermined parameters for converting the image data held in the input image holding unit 11; a chromaticity coordinate converting unit 13 which obtains conversion chromaticity coordinate values by converting chromaticity coordinate values showing a color of each pixel of the image data on the basis of the parameters set by the parameter setting unit 12; a color region obtaining unit 14 which obtains a region, as a color region, including 2-dimensional conversion chromaticity coordinate values, in a convex polygonal shape, obtained by projecting the conversion chromaticity coordinate values formed by the chromaticity coordinate converting unit 13 onto a unit plane so that additive color mixture can be performed; an area calculation processing unit 15 which calculates an area of the color region obtained by the color region obtaining unit 14 and obtains parameter values at the time when the calculated area becomes the maximum; and an image converting unit 16 which converts the input image data by using the parameter values obtained by the area calculation processing unit 15.

[0028] Subsequently, each unit will be explained.

[0029] The input image holding unit 11 holds image data of an object photographed by a digital camera or the like. The image data is constructed by a plurality of pixels and each pixel is shown by the RGB calorimetric system which has conventionally been known.

[0030] The parameter setting unit 12 performs a conversion to (R, G, B) values of the pixel on a pixel unit basis of the image data held in the input image holding unit 11 by using coefficients (&rgr;, &ggr;, &bgr;) of three channels as parameter values. Values of &rgr;, &ggr;, and &bgr; are changed at predetermined sampling intervals within ranges of 0<&rgr;<&rgr;max, 0<&ggr;<&ggr;max, and 0<&bgr;<&bgr;max, respectively.

[0031] For example, 0.05 unit is used as a sampling interval and 2 is used as values of &rgr;max, &ggr;max, and &bgr;max. The narrower the sampling interval is and the larger the values of &rgr;max, &ggr;max, and &bgr;max are set, the larger an amount of arithmetic operating processes, which will be explained hereinlater, increases. Therefore, it is preferable to properly set them in accordance with arithmetic operating processing ability.

[0032] Results obtained by executing a conversion to chromaticity coordinate values (R, G, B) of each pixel on the basis of the parameters (&rgr;, &ggr;, &bgr;) are assumed to be conversion chromaticity coordinate values (R′, G′, B′) and their relations are shown by the following equations (1).

R′=&rgr;·R G′=&ggr;·G B′=&bgr;·B   (1)

[0033] When the conversion chromaticity coordinate values (R′, G′, B′) are received from the chromaticity coordinate converting unit 13, the color region obtaining unit 14 executes a conversion shown by the following equations (2) in order to show the conversion chromaticity coordinate values (R′, G′, B′) onto a unit plane shown by a relation (R+G+B=1).

r′=R′/(R′+G′+B′) g′=G′/(R′+G′+B′) b′=B′/(R′+G′+B′)   (2)

[0034] The relations between (r′, g′, b′) obtained by the above conversion and the conversion chromaticity coordinate values (R′, G′, B′) are shown in FIG. 2 in which RGB are assumed to be coordinate axes.

[0035] Further, 2-dimensional conversion chromaticity coordinate values (r′, g′) in which the obtained (r′, g′, b′) are projected onto a 2-dimensional plane (2-dimensional chromaticity coordinate plane) are obtained. As shown in FIG. 3, the 2-dimensional conversion chromaticity coordinate values (r′, g′) are projected onto a (r, g) plane shown by an R axis and a G axis. The (r, g) plane is shown by an r axis and a g axis. An explanation will be made hereinbelow on the assumption that the 2-dimensional conversion chromaticity coordinate values (r′, g′) are shown on such an rg coordinate system.

[0036] When the 2-dimensional conversion chromaticity coordinate values (r′, g′) corresponding to all pixels are obtained, as shown in FIG. 4, the color region obtaining unit 14 obtains a region, as a color region, where an outermost shell of the 2-dimensional conversion chromaticity coordinate values (r′, g′) is surrounded by an outline showing a convex polygon (n-angled polygon) in order to include the 2-dimensional conversion chromaticity coordinate values (r′, g′) so that additive color mixture can be performed.

[0037] The color region obtained by the color region obtaining unit 14 shows a color gamut which can be expressed by the image data to which the conversion has been made by using the parameters. In the converted image data, therefore, the color region shows a color gamut of the colors which are used in the image data. Even in the image data of an object which is unbalanced in color arrangement, for example, a bluish object to be photographed, the blue color is not particularly reflected to the image data but the color region simply shows a color gamut of the colors which are used in the image data.

[0038] After the color region is obtained, the area calculation processing unit 15 obtains an area of the color region. The area of the color region is shown by the following equation (3). 1 S = 1 2 ⁡ [ &LeftBracketingBar; r 1 ′ g 1 ′ r 2 ′ g 2 ′ &RightBracketingBar; + &LeftBracketingBar; r 2 ′ g 2 ′ r 3 ′ g 3 ′ &RightBracketingBar; + ⋯ + &LeftBracketingBar; r n ′ g n ′ r 1 ′ g 1 ′ &RightBracketingBar; ] ( 3 )

[0039] where, n: the number of vertices of a polygon showing the color region

[0040] The area of the color region is calculated by using the following equation (4) obtained by further converting the equation (3). 2 S = 1 2 ⁢ ∑ i = 1 n ⁢ ρ · r i ′ + γ · g i + 1 ′ - ρ · r i + 1 ′ + γ · g i ′ ( ρ · r i ′ + γ · g i ′ + β · b i ′ ) ⁢ ( ρ · r i + 1 ′ + γ · g i + 1 ′ + β · b i + 1 ′ ) ( 4 )

[0041] If the calculated area is larger than an area held in a storing unit (not shown), the area calculation processing unit 15 holds the calculated area into the storing unit. Such a series of processes is repeated for each of the various parameters set by the parameter setting unit 12. Therefore, areas of the color regions corresponding to all of the parameters are calculated and the maximum value of the calculated areas of the color regions is held in the storing unit. At this time, together with the maximum value, the parameter values (&rgr;, &ggr;, &bgr;) corresponding to the color region of the maximum area are held in the storing unit.

[0042] When the area value is calculated for the first time, since the area value to be compared with is not held in the storing unit, the area calculation processing unit 15 holds the area value of the color region and the parameter values (&rgr;, &ggr;, &bgr;) set by the parameter setting unit 12 into the storing unit without making the comparison of the area values.

[0043] Since the color region shows the color gamut which can be expressed by the image data to which the conversion has been made by using the parameters as mentioned above, if the area of the color region is large, the color gamut which can be expressed by the image data is widened. Therefore, in image data obtained by photographing an object under, for example, a reddish light source serving as a colored light source shown in FIG. 6, the color gamut which can be expressed is narrowed due to reddishness. However, in image data obtained by photographing an object under the ideal white light source, since it is not influenced by a hue of the colored light source, the color gamut which can be expressed, that is, the area of the color region is widened.

[0044] Further, the color region is not much influenced by the color arrangement balance of the object. The parameter values (&rgr;, &ggr;, &bgr;) obtained on the basis of the area of the color region are not directly influenced by the color arrangement balance of the object either.

[0045] The image converting unit 16 executes a conversion to the image data held in the input image holding unit 11 by using the parameter values (&rgr;, &ggr;, &bgr;) held in the storing unit mentioned above, that is, the parameter values in which the area of the color region becomes the maximum. Owing to such a conversion, the image data is converted to obtain a state as if the object were photographed under the ideal white light source.

[0046] Subsequently, the operation of the image converting apparatus 10 of the invention will be described with reference to a flowchart of FIG. 5.

[0047] Image data of an object photographed by a digital camera or the like is obtained as an input image and held in the input image holding unit 11 (step S11).

[0048] The chromaticity coordinate converting unit 13 executes a conversion to the chromaticity coordinate values (R, G, B) of each pixel of the image data held in the input image holding unit 11 by using the parameters (&rgr;, &ggr;, &bgr;) set by the parameter setting unit 12, thereby obtaining the conversion chromaticity coordinate values (R′, G′, B′) (step S12).

[0049] After the conversion chromaticity coordinate values (R′, G′, B′) are obtained, the color region obtaining unit 14 projects the conversion chromaticity coordinate values (R′, G′, B′) onto the (r, g) plane as a unit plane, thereby obtaining the 2-dimensional conversion chromaticity coordinate values (r′, g′) (step S13).

[0050] Further, the color region obtaining unit 14 obtains a convex polygonal region, as a color region, including the 2-dimensional conversion chromaticity coordinate values (r′, g′) plotted onto the (r, g) plane so that additive color mixture can be performed (step S14).

[0051] After the color region is obtained, the area of the color region is calculated by the area calculation processing unit 15 by using the equation (4) (step S15).

[0052] The area calculation processing unit 15 compares the calculated area with the area value held in the storing unit not shown in FIG. 1 (step S16).

[0053] By this comparison, if the area calculated this time is larger than the area value held in the storing unit, contents in the storing unit are updated on the basis of the area value of the color region calculated this time and the parameter values corresponding to the color region (step S17). Therefore, the storing unit holds the area value of the maximum color region among the area values of the color regions obtained with respect to the various parameters and the parameter values which correspond to such an area value and were used when the conversion is performed to the image data by the chromaticity coordinate converting unit 13.

[0054] On the other hand, if the area calculated this time is equal to or smaller than the area value held in the storing unit, the area calculation processing unit 15 executes a process in step S18 without updating the contents held in the storing unit.

[0055] In the process in step S18, whether the comparison between the area of each color region obtained every parameter and the value held in the storing unit has been finished or not is discriminated. That is, the parameters (&rgr;, &ggr;, &bgr;) are changed at predetermined sampling intervals within the ranges of 0<&rgr;<&rgr;max, 0<&ggr;<&ggr;max, and 0<&bgr;<&bgr;max, respectively, and in the color regions in all of the changed parameters, whether the maximum area value among the color regions has completely been obtained or not is discriminated (step S18).

[0056] As a result of the discrimination, if the processes for obtaining and comparing the area values of the color regions are not finished yet with respect to all of the parameters, the processing routine is returned to the process in step S11. The parameters (&rgr;, &ggr;, &bgr;) are changed at the predetermined sampling intervals by the parameter setting unit 12 and the processes are executed in a manner similar to those mentioned above.

[0057] After the maximum area value is obtained, the image converting unit 16 executes a conversion to the image data held in the input image holding unit 11 by using the parameter values corresponding to the color region of the maximum area value held in the storing unit.

[0058] According to the image converting apparatus 10 of the invention, therefore, by obtaining the parameter values (&rgr;, &ggr;, &bgr;) in which the area of the color region becomes the maximum and executing the conversion to the image data by using the obtained parameter values (&rgr;, &ggr;, &bgr;), the image data in which the color gamut which is expressed is narrowed due to the influence of the colored light source can be converted into the image data in which the color gamut which is expressed becomes widest, that is, the image data obtained under the ideal white light source.

[0059] Further, according to the image converting apparatus 10 of the invention, the parameter values (&rgr;, &ggr;, &bgr;) are obtained on the basis of the area of the color region showing the color gamut which can be expressed by the image data to be converted without being directly influenced by the color arrangement balance of the object. Therefore, a drawback such that the image data is influenced by the degrees of the chromaticity coordinate values of each pixel of the image data to be converted as in the case of the conventional gray world is eliminated. Thus, the image conversion can be properly executed even to the image data obtained by photographing the object which is unbalanced in color arrangement.

[0060] <Embodiment 2>

[0061] As mentioned above, in the conventional gray world, the correction is made by using the average values of the chromaticity coordinate values of each pixel of the image data. Therefore, since the frequency of occurrence of the expressing color is considered, the image data obtained by photographing the object which is unbalanced in color arrangement cannot be properly corrected. In the color region as a feature of the invention, the frequency of occurrence of the expressing color is not considered but the color region shows the color gamut expressed in the image data. Therefore, since the foregoing degrees are not reflected to such a color region, the degrees are not reflected to a barycenter of the color region either.

[0062] According to the embodiment 2, parameters in which the barycenter of the color region to which the degrees are not reflected is set to ⅓ are obtained.

[0063] FIG. 7 is a block diagram of an image converting apparatus 20 according to the embodiment 2.

[0064] The image converting apparatus 20 of the embodiment 2 has a construction using a barycenter calculation processing unit 17 in place of the area calculation processing unit 15 in the embodiment 1.

[0065] The image converting apparatus 20 comprises: the input image holding unit 11 which holds the image data to be converted; the parameter setting unit 12 which sets the various parameters (&rgr;, &ggr;, &bgr;) for executing the conversion to the image data held in the input image holding unit 11; the chromaticity coordinate converting unit 13 which obtains the conversion chromaticity coordinate values (R′, G′, B′) by converting the chromaticity coordinate values showing the color of each pixel of the image data on the basis of the parameters set by the parameter setting unit 12; the color region obtaining unit 14 which obtains a region, as a color region, including the 2-dimensional conversion chromaticity coordinate values (r′, g′), in a convex polygonal shape, obtained by projecting the conversion chromaticity coordinate values formed by the chromaticity coordinate converting unit 13 onto the unit plane so that the additive color mixture can be performed; the barycenter calculation processing unit 17 which calculates the barycenter of the color region obtained by the color region obtaining unit 14 and obtains parameter values at the time when the calculated barycenter lies within a predetermined threshold value including ⅓; and the image converting unit 16 which converts the image data by using the parameter values obtained by the barycenter calculation processing unit 17.

[0066] Since the input image holding unit 11, parameter setting unit 12, chromaticity coordinate converting unit 13, color region obtaining unit 14, and image converting unit 16 are the same as those in the embodiment 1 mentioned above, their description is omitted here.

[0067] The barycenter calculation processing unit 17 obtains the parameters (&rgr;, &ggr;, &bgr;) at the time when the barycenter of the color region obtained by the color region obtaining unit 14 lies within the predetermined threshold value including ⅓. The image data obtained under the ideal white light source can be obtained by converting the image data by using the obtained parameters as will be explained by using equations.

[0068] In the color region shown in FIG. 4, although the area of the color region influenced by the colored light source is narrowed, since the image data obtained by photographing the object under the ideal white light source is not influenced by the hue of the colored light source, the color gamut which is expressed, that is, the color region becomes the maximum. The parameter values (&rgr;, &ggr;, &bgr;) of a relation shown in the following equation (5) are obtained in order to maximize an area S of the color region.

∂S/∂&rgr;=∂S/∂&ggr;=∂S/∂&bgr;=0   (5)

[0069] First, a partial differentiation of the area S shown in the equation (4) is executed with respect to &rgr; and &ggr;, thereby obtaining the following equations (6) and (7). 3 ∂ S ∂ ρ = 1 2 ⁢ ∑ i = 1 n ⁢ ( 1 - r i ′ - r i + 1 ′ ) ⁢ ( r i ′ · g i + 1 ′ - r i + 1 ′ · g i ′ ) ρ ( 6 ) ∂ S ∂ γ = 1 2 ⁢ ∑ i = 1 n ⁢ ( 1 - g i ′ - g i + 1 ′ ) ⁢ ( r i ′ · g i + 1 ′ - r i + 1 ′ · g i ′ ) γ ( 7 )

[0070] where, n: the number of vertices of the polygon showing the color region

[0071] The equations (6) and (7) indicate the extremal parameter values (&rgr; and &ggr;) at the time when the area is maximized, respectively. When ∂S/∂&rgr;=0 and ∂S/∂&ggr;=0 are satisfied, a sum of numerators of the equations (6) and (7) is equal to 0. Thus, the following equations (8) and (9) are obtained by rearranging the equations (6) and (7). 4 ∑ i = 1 n ⁢ ( r i ′ + r i + 1 ′ ) ⁢ ( r i ′ · g i + 1 ′ - r i + 1 ′ · g i ′ ) = ∑ i = 1 n ⁢ ( r i ′ · g i + 1 ′ - r i + 1 ′ · g i ′ ) ( 8 ) ∑ i = 1 n ⁢ ( g i ′ + g i + 1 ′ ) ⁢ ( r i ′ · g i + 1 ′ - r i + 1 ′ · g i ′ ) = ∑ i = 1 n ⁢ ( r i ′ · g i + 1 ′ - r i + 1 ′ · g i ′ ) ( 9 )

[0072] According to the equation (3), a right side of each of the equations (8) and (9) indicates a double area of the color region. Therefore, the equations (8) and (9) are simplified to the following equations (10) and (11). 5 ∑ i = 1 n ⁢ ( r i ′ + r i + 1 ′ ) ⁢ ( r i ′ · g i + 1 ′ - r i + 1 ′ · g i ′ ) = 2 · S ( 10 ) ∑ i = 1 n ⁢ ( g i ′ + g i + 1 ′ ) ⁢ ( r i ′ · g i + 1 ′ - r i + 1 ′ · g i ′ ) = 2 · S ( 11 )

[0073] Coordinate values showing the barycenter of the color region are shown by the following equations (12) and (13). 6 r c ′ = 1 6 ⁢ ∑ i = 1 n ⁢ ( r i ′ + r i + 1 ′ ) ⁢ ( r i ′ · g i + 1 ′ - r i + 1 ′ · g i ′ ) S ( 12 ) g c ′ = 1 6 ⁢ ∑ i = 1 n ⁢ ( g i ′ + g i + 1 ′ ) ⁢ ( r i ′ · g i + 1 ′ - r i + 1 ′ · g i ′ ) S ( 13 )

[0074] By substituting the equation (10) into the equation (12), the following equation (14) is obtained and by substituting the equation (11) into the equation (13), the following equation (15) is obtained.

r′c=⅓  (14)

g′c=⅓  (15)

[0075] A barycenter (r′c, g′c) of the color region whose area is maximized is set to ⅓.

[0076] On the other hand, as is known hitherto, when the colors of R, G, and B each having an equal amount are mixed (additive color mixture), a white color is shown. In the above color mixture, if the colors of R, G, and B of the maximum values of the equal amount (R=G=B) are mixed so as not to cause a spot in spectral distribution (that is, so as to obtain flat spectral distribution), an ideal white light source is obtained. In such an ideal white light source called a flat white light source, since the colors of R, G, and B of the equal amount are uniformly mixed, a relation shown by the following equations (16) is satisfied.

R/(R+G+B)=⅓ G/(R+G+B)=⅓ B/(R+G+B)=⅓  (16)

[0077] When the relation shown by the equations (16) is shown by coordinates on a unit plane of (R+G+B=1), each value of R, G, and B indicates ⅓ and it coincides with the barycenter of the color region mentioned above. In other words, the barycenter of the color region of the ideal white light source is also set to ⅓.

[0078] FIG. 4 shows a barycenter (C) of the color region mentioned above. FIG. 4 also shows chromaticity coordinate values P obtained by the conventional gray world. The chromaticity coordinate values of each pixel are shown by a dot in the color region shown in FIG. 4. According to the gray world which takes into consideration of the frequency of occurrence of the chromaticity coordinate values of each pixel, in the image data having a deviation of each dot (chromaticity coordinate values of each pixel) shown in FIG. 4, that is, the image data obtained by photographing the object which is unbalanced in color arrangement, the coordinate values P which are away from the coordinate values C indicative of the barycenter of the color region of the ideal white light source are shown.

[0079] Subsequently, the operation of the image converting apparatus 20 of the embodiment 2 will be described with reference to a flowchart of FIG. 8.

[0080] Image data of an object photographed by a digital camera or the like is obtained as an input image and held in the input image holding unit 11 (step S21).

[0081] The chromaticity coordinate converting unit 13 executes a conversion to the chromaticity coordinate values (R, G, B) of each pixel of the image data held in the input image holding unit 11 by using the parameters (&rgr;, &ggr;, &bgr;) set by the parameter setting unit 12, thereby obtaining the conversion chromaticity coordinate values (R′, G′, B′) (step S22).

[0082] After the conversion chromaticity coordinate values (R′, G′, B′) are obtained, the color region obtaining unit 14 projects the conversion chromaticity coordinate values (R′, G′, B′) onto the (r, g) plane as a unit plane, thereby obtaining the 2-dimensional conversion chromaticity coordinate values (r′, g′) (step S23).

[0083] Further, the color region obtaining unit 14 obtains a convex polygonal region, as a color region, where the 2-dimensional conversion chromaticity coordinate values (r′, g′) plotted onto the (r, g) plane are included so that additive color mixture can be performed (step S24).

[0084] After the color region is obtained, coordinates of the barycenter of the color region is calculated by the barycenter calculation processing unit 17 by using the above equations (step S25).

[0085] Further, the barycenter calculation processing unit 17 discriminates whether the calculated coordinates of the barycenter lie within a predetermined threshold value or not as shown by the following inequalities (17) (step S26).

|r′c−⅓|<&egr;r |g′c−⅓|<&egr;g   (17)

[0086] where, &egr;r:threshold value of the r coordinate

[0087] &egr;g:threshold value of the g coordinate

[0088] At this time, the barycenter calculation processing unit 17 obtains the parameter values (&rgr;, &ggr;, &bgr;) set by the parameter setting unit 12.

[0089] By this discrimination, if the calculated coordinates of the barycenter are out of the range shown by the inequalities (17), the processing routine is returned to the process in step S21. The parameters (&rgr;, &ggr;, &bgr;) are changed at predetermined sampling intervals by the parameter setting unit 12 and the above processes are similarly executed.

[0090] If the calculated coordinates of the barycenter of the color region are within the range shown by the inequalities (17), the image converting unit 16 executes a conversion to the image data held in the input image holding unit 11 by using the parameter values corresponding to the color region where the barycenter lies within the predetermined threshold value including ⅓, that is, the parameter values (&rgr;, &ggr;, &bgr;) obtained from the parameter setting unit 12 in step S26. Thus, the coordinate values showing the barycenter of the color region are set to a new coordinate origin and the conversion is executed to the input image.

[0091] As mentioned above, according to the image converting apparatus 20 of the invention, the parameter values (&rgr;, &ggr;, &bgr;) in which the barycenter at the time when the area of the color region showing the color gamut of the image data to be converted is maximized lies within the predetermined threshold value including ⅓ are obtained and the conversion is performed to the image data by using the obtained parameter values (&rgr;, &ggr;, &bgr;). Therefore, since the degrees of the chromaticity coordinate values of each pixel of the image data are not considered, even the image data obtained by photographing the object which is unbalanced in color arrangement can be converted into the image data obtained by photographing the object under the ideal white light source.

[0092] In the foregoing embodiments, the convex polygonal color region including the 2-dimensional conversion chromaticity coordinate values (r′, g′) is obtained every parameters (&rgr;, &ggr;, &bgr;) which are set to various values so that the additive color mixture can be performed. However, it is also possible that initial states of the parameters (&rgr;, &ggr;, &bgr;) are assumed to be &rgr;=1, &ggr;=1, and &bgr;=1, coordinate values of each vertex of the color region in those parameters are obtained, a vertex coordinate holding unit for holding those coordinate values is provided, and the arithmetic operations which have conventionally been known are executed by using the obtained coordinate values in the initial states. Thus, the arithmetic operating processes for converting the image data by using the parameters every various parameters (&rgr;, &ggr;, &bgr;) and obtaining the color region where the converted chromaticity coordinate values are projected onto the unit plane can be omitted.

[0093] As mentioned above, in the color region including the 2-dimensional conversion chromaticity coordinate values obtained by projecting the conversion chromaticity coordinate values obtained by converting each pixel of the input image by using the parameters onto the unit plane so that the additive color mixture can be performed, the parameter values in which the area of the color region becomes the maximum or the parameter values in which the barycenter at the time when the area of the color region is maximized is set to ⅓ are obtained and the chromatic coordinate conversion is performed to the input image by using the obtained parameter values. Thus, since the degrees of the chromatic coordinate values of each pixel of the image data are not considered, even the image data obtained by photographing the object which is unbalanced in color arrangement can be converted into the image data obtained under the ideal white light source.

[0094] The present invention is not limited to the foregoing embodiments but many modifications and variations are possible within the spirit and scope of the appended claims of the invention.

Claims

1. An image converting method comprising the steps of:

converting chromaticity coordinate values which each pixel of an input image consisting of a plurality of pixels has into a 2-dimensional chromaticity coordinate plane and obtaining 2-dimensional conversion chromaticity coordinate values of each pixel;
obtaining an outline of a color region defined by the 2-dimensional conversion chromaticity coordinate values of said plurality of pixels converted into said 2-dimensional chromaticity coordinate plane;
obtaining 2-dimensional conversion chromaticity coordinate values, on a 2-dimensional chromaticity coordinate plane, of a barycenter of an area of a region which is specified by the outline of said color region; and
executing a color conversion of the input image by using the 2-dimensional conversion chromaticity coordinate values of said barycenter as a new coordinate origin.

2. An image converting method comprising the steps of:

converting each pixel of an input image into 2-dimensional conversion chromaticity coordinate values which are obtained by projecting conversion chromaticity coordinate values obtained by converting each of said pixels by using parameters for converting in chromaticity coordinates onto a unit plane, and in a color region including said 2-dimensional conversion chromaticity coordinate values, obtaining parameter values in which an area of said color region becomes the maximum; and
converting said input image by said obtained parameter values.

3. An image converting method comprising the steps of:

converting each pixel of an input image into 2-dimensional conversion chromaticity coordinate values which are obtained by projecting conversion chromaticity coordinate values obtained by converting each of said pixels by using parameters for converting in chromaticity coordinates onto a unit plane, and obtaining parameter values in which a barycenter of a color region including said 2-dimensional conversion chromaticity coordinate values is set to ⅓; and
converting the input image by said obtained parameter values.

4. The method according to claim 3, wherein the parameter values at the time when the barycenter lies within a predetermined threshold value including ⅓ are obtained.

5. An image converting apparatus comprising:

a parameter setting unit which sets parameters for converting each pixel of an input image into predetermined chromaticity coordinate values;
a chromaticity coordinate converting unit which obtains conversion chromaticity coordinate values obtained by converting each of said pixels on the basis of the parameters set by said parameter setting unit;
a color region obtaining unit which obtains a color region including 2-dimensional conversion chromaticity coordinate values obtained by projecting each of said conversion chromaticity coordinate values onto a unit plane;
an area calculation processing unit which calculates an area of said color region with respect to the parameters and obtains parameter values at the time when a value of the calculated area becomes the maximum; and
an image converting unit which converts said input image on the basis of the obtained parameter values.

6. An image converting apparatus comprising:

a parameter setting unit which sets parameters for converting each pixel of an input image into predetermined chromaticity coordinate values;
a chromaticity coordinate converting unit which obtains conversion chromaticity coordinate values obtained by converting each of said pixels on the basis of the parameters set by said parameter setting unit;
a color region obtaining unit which obtains a color region including 2-dimensional conversion chromaticity coordinate values obtained by projecting each of said conversion chromaticity coordinate values onto a unit plane so that additive color mixture can be performed;
a barycenter calculation processing unit which calculates a barycenter of said color region with respect to the parameters and obtains parameter values at the time when the calculated barycenter is set to ⅓; and
an image converting unit which converts said input image on the basis of the obtained parameter values.

7. The apparatus according to claim 6, wherein said barycenter calculation processing unit obtains the parameter values at the time when the barycenter lies within a predetermined threshold value including ⅓.

Patent History
Publication number: 20040091147
Type: Application
Filed: Nov 5, 2003
Publication Date: May 13, 2004
Applicant: Oki Data Corporation
Inventors: Nobuhito Matsushiro (Tokyo), Noboru Ota (Kanagawa)
Application Number: 10702534
Classifications
Current U.S. Class: Color Image Processing (382/162)
International Classification: G06K009/00;