Image merging apparatus and image merging method

Information

  • Patent Application
  • 20010052907
  • Publication Number
    20010052907
  • Date Filed
    April 23, 2001
    23 years ago
  • Date Published
    December 20, 2001
    22 years ago
Abstract
An image merging apparatus extracts noise included in a background image, and adds the noise to a CG image, thereby producing the merged image of the CG image and the background image. It can solve a problem of a conventional image merging apparatus in that although it can suppress the Mach band taking place in an edge segment, it brings about a mismatched feeling between the CG image and the background image when combining the shaded CG image and background image because it lacks a device for combining them taking account of the color difference between the CG image and the background image, or of the noise included in the background image.
Description


BACKGROUND OF THE INVENTION

[0001] 1. Field of the Invention


[0002] The present invention relates to an image merging apparatus and an image merging method for producing a merged image of a CG image (computer graphics image) and a background image.


[0003] 2. Description of Related Art


[0004]
FIG. 10 is a block diagram showing a configuration of a conventional shading apparatus disclosed in Japanese patent application laid-open No. 8-212384/1996. In this figure, the reference numeral 1 designates a vertex luminance extractor for calculating color or luminance at vertices of a polygon to be shaded and its neighboring polygons; and 2 designates a luminance interpolator for calculating color or luminance inside the target polygon.


[0005] Next, the operation of the conventional shading apparatus will be described.


[0006] Receiving the normal vectors of the vertices of the target polygon to be shaded and its neighboring polygons, the vertex luminance extractor 1 calculates the color or luminance of the vertices from the normal vectors.


[0007] More specifically, assume that ΔI1I2I3 is a target polygon in FIG. 11, then ΔI1I3I4 becomes a neighboring polygon. The vertex luminance extractor 1 calculates the color or luminance at vertices of the target polygon ΔI1I2I3 and the neighboring polygon ΔI1I3I4, or the luminance in the ΔI1I2I3 and ΔI1I3I4.


[0008] When the vertex luminance extractor 1 calculates the color or luminance of the vertices of the target polygon and the neighboring polygon, the luminance interpolator 2 calculates the color or luminance inside the target polygon using the calculated results.


[0009] Specifically, it calculates the color or luminance IS1, IS2 and IS3 at intersections of a scanning line 3 and the edges I1I2 I1I3 and I1I4 of the target polygon ΔI1I2I3 and its neighboring polygon ΔI1I3I4.


[0010] Subsequently, using the color or luminance at the three intersections, it calculates the color or luminance I at an internal point (X,Y) of the target polygon ΔI1I2I3 as follows:


IS1=I1(YS−Y2)/(Y1−Y2)+I2(Y1−YS)/(Y1−Y2)


IS2=I1(YS−Y3)/(Y1−Y3)+I3(Y1−YS)/(Y1−Y3)


IS3=I1(YS−Y4)/(Y1−Y4)+I4(Y1−YS)/(Y1−Y4)


I=IS1×Z1+IS2×Z2+IS3×Z3


[0011] where


Z1={(X−XS2)/(XS1−XS2)}×{(X−XS3)/(XS1−XS3)}


Z2={(X−XS1)/(XS2−XS1)}×{(X−XS3)/(XS2−XS3)}


Z3={(X−XS1)/(XS3−XS1)}×{(X−XS2)/(XS3−XS2)}


[0012] This method can avoid sharp changes in the gradient of the color or luminance on the edge segment I1I3, preventing the Mach band to take place on the edge segment I1I3.


[0013] Although the conventional shading apparatus with the foregoing configuration can suppress the Mach band on the edge segment I1I3, it presents a problem of producing a mismatched feeling between a CG image and a background image when merging the shaded CG image with the background image. This is because the conventional apparatus lacks a means for combining them considering the color difference between the CG image and background image, or noise Contained in the background image.


[0014] This will be described in more detail.


[0015] A composite picture is often produced by taking a picture of an object or scene in a real world to be used as a background, and by combining it with an image produced by the CG technique. For example, a simulation is often made to see whether a building or bridge which will be built from now matches the present scene of the spot, or to confirm whether the color of a new refrigerator to be installed in a room matches the room. In such cases, although the picture of the object or scene taken includes ambient noise, the image produced by the CG has a simple color tone without noise. Besides, since the color tone of the background picture can vary depending on the weather or time it is taken, it can differ from the image produced by the CG in the color tone, making it difficult to combine the background picture with the CG image. Although the conventional shading apparatus can suppress the Mach band, a sharp change in the gradient of the color or luminance involved in the shading, the color tone of the resultant image is usually monotonous including no ambient noise. In addition, it does not consider the color difference between the two images. Thus, the color difference between the CG image and the background presents a problem when they are combined.



SUMMARY OF THE INVENTION

[0016] The present invention is implemented to solve the foregoing problems. It is therefore an object of the present invention to provide an image merging apparatus and an image merging method capable of implementing natural merging of a CG image and a background image without bringing about any mismatched feeling.


[0017] According to a first aspect of the present invention, there is provided an image merging apparatus for merging a CG (computer graphics) image and its background image to output a merged image, the image merging apparatus comprising: characteristic information output means for outputting information about a characteristic at least of the background image; and merged image producing means for producing the merged image of the CG image and the background image by adding output information of the characteristic information output means to the CG image.


[0018] Here, the characteristic information output means may comprise a noise extractor for extracting noise from the background image; and the merged image producing means may comprise a noise add-on section for adding the noise extracted by the noise extractor to the CG image to produce the merged image of the CG image and the background image.


[0019] The characteristic information output means may comprise a noise generator for generating noise corresponding to noise included in the background image; and the merged image producing means may comprise a noise add-on section for adding the noise generated by the noise generator to the CG image to produce the merged image of the CG image and the background image.


[0020] The characteristic information output means may comprise a color difference calculating section for calculating color difference between the CG image and the background image; and the merged image producing means may comprise color difference effecting section for causing the color difference calculated by the color difference calculating section to be reflected in at least one of the CG image and the background image, thereby producing the merged image of the CG image and the background image.


[0021] The noise add-on section may utilize the CG image that is being generated as an image to be processed.


[0022] The color difference calculating section and the color difference effecting section may utilize the CG image that is being generated as an image to be processed.


[0023] The image merging apparatus may use one of a still image and moving images as the background image.


[0024] According to a second aspect of the present invention, there is provided an image merging method of merging a CG (computer graphics) image and its background image to output a merged image, the image merging method comprising the steps of: outputting information about a characteristic at least of the background image; and producing the merged image of the CG image and the background image by adding the information about the characteristic to the CG image.


[0025] Here, the step of outputting information may extract noise from the background image; and the step of producing the merged image may add the noise extracted to the CG image to produce the merged image of the CG image and the background image.


[0026] The step of outputting information may generate noise corresponding to noise included in the background image; and the step of producing the merged image may add the noise generated to the CG image to produce the merged image of the CG image and the background image.


[0027] The step of outputting information may calculate color difference between the CG image and the background image; and the step of producing the merged image may cause the color difference calculated to be reflected in at least one of the CG image and the background image, thereby producing the merged image of the CG image and the background image.


[0028] The step of producing the merged image may utilize the CG image that is being generated as an image to be processed.


[0029] The image merging method may utilize the CG image that is being generated as an image to be processed.


[0030] The image merging method may use one of a still image and moving images as the background image.







BRIEF DESCRIPTION OF THE DRAWINGS

[0031]
FIG. 1 is a block diagram showing a configuration of an embodiment 1 of the image merging apparatus in accordance with the present invention;


[0032]
FIG. 2 is a flowchart illustrating the image merging method of the embodiment 1;


[0033]
FIG. 3 is a diagram illustrating an example of a background image;


[0034]
FIG. 4 is a block diagram showing a configuration of an embodiment 2 of the image merging apparatus in accordance with the present invention;


[0035]
FIG. 5 is a block diagram showing a configuration of an embodiment 3 of the image merging apparatus in accordance with the present invention;


[0036]
FIG. 6 is a flowchart illustrating the image merging method of the embodiment 3;


[0037]
FIG. 7 is a block diagram showing a configuration of an embodiment 4 of the image merging apparatus in accordance with the present invention;


[0038]
FIG. 8 is a block diagram showing a configuration of an embodiment 5 of the image merging apparatus in accordance with the present invention;


[0039]
FIG. 9 is a diagram illustrating a method of shading a triangle that constitutes basic CG shape data;


[0040]
FIG. 10 is a block diagram showing a configuration of a conventional shading apparatus; and


[0041]
FIG. 11 is a diagram illustrating a shading method.







DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0042] The invention will now be described with reference to the accompanying drawings.


[0043] EMBODIMENT 1


[0044]
FIG. 1 is a block diagram showing a configuration of an embodiment 1 of the image merging apparatus in accordance with the present invention. In this figure, the reference numeral 11 designates a CG image generated by a computer graphics technique; 12 designates a background image, a still image such as a picture; 13 designates other background images, moving images such as video images; 14 designates a selector for selecting either the background image 12 or the background images 13; 15 designates a color matching section for matching color tone of the background image 12 or images 13 selected by the selector 14 with that of the CG image 11; 16 designates a noise extractor for extracting noise included in the background image 12 or images 13 selected by the selector 14; 17 designates a noise add-on section for adding the noise extracted by the noise extractor 16 to the CG image 11, thereby outputting a merged image 18 of the CG image 11 and the background image 12 or images 13; and 18 designates the merged image of the CG image 11 and the background image 12 or images 13.


[0045] Next, the operation of the present embodiment 1 will be described with reference to FIG. 2 which is a flowchart illustrating the image merging method of the embodiment 1.


[0046] First, the selector 14 selects either the background image 12 or images 13 (step ST1). Specifically, the background image 12 consisting of a still picture and the background images 13 consisting of moving images are prepared in advance, and one of them is selected by a program, a menu selector or a switch. It is also possible to prepare one of them from the beginning, in which case the selector 14 can be removed. In the present embodiment 1, it is assumed that the selector 14 selects the background image 12 for convenience of explanation.


[0047] When the selector 14 selects the background image 12, the noise extractor 16 of the color matching section 15 extracts the noise from the background image 12 (step ST2).


[0048]
FIG. 3 is a diagram illustrating an example of the background image 12.


[0049] As illustrated in FIG. 3, the background image 12 has an image size of M (columns) × N (rows), and the pixel value at a given point (X,Y) is I(X,Y), where X denotes the horizontal coordinate and Y denotes the vertical coordinate.


[0050] As an example, it is assumed that I(X, Y) consists of RGB (red, green and blue), each of which consists of eight bits, and that least significant two bits of each eight bits represent image noise.


[0051] The noise of each of the RGB components IR(X, Y), IG(X, Y) and IB(X,Y) of the I(X,Y) is expressed as follows:


noise of R component: IR(X/Y) % 4


noise of G component: IG(X/Y) % 4


noise of B component: IB(X/Y) % 4  (1)


[0052] where % is an operator for obtaining a remainder. Thus, A % B represents the remainder when A is divided by B.


[0053] Generally, when least significant b bits represent the noise, the noise component of the I(X,Y) is represented as I (X,Y) % (2Λb), where is an operator representing the power. Thus, AΛB represents the B-th power of A.


[0054] When the noise extractor 16 extracts the noise from the background image 12, the noise add-on section 17 adds the noise to the CG image 11, and outputs the merged image 18 of the CG image 11 and the background image 12 (step ST3).


[0055] This will be described in more detail.


[0056] To add the noise extracted by the noise extractor 16 to the CG image 11, it is necessary to extract a portion unrelated to the noise from the CG image 11.


[0057] Let us assume that the CG image 11 has an image size of M (columns)×N (rows) like the background image 12, and is composed of RGB components, each of which consists of eight bits, that C(X,Y) represents the pixel value at a given point (X,Y) of the CG image 11, and that the RGB components of the C(X,Y) are denoted as CR(X,Y), CG(X,Y) and CB(X,Y), respectively. As described above, since the least significant two bits are assumed to represent noise in the present embodiment 1, the portion unrelated too the noise can be calculated from the C(X,Y) as follows:


noise of R component: [CR(X,Y)/4]×4


noise of G component: [CG(X,Y)/4]×4


noise of B component: [CB(X,Y)/4]×4  (2)


[0058] where [A] represents an integer-valued function representing the nearest integer obtained by dropping the fractional portion of the number. Generally, the component unrelated to the nose of the C(X,Y) is represented as [C(X,Y)/(2Λb)]×(2Λb) when the least significant b bits indicate the noise.


[0059] Thus, the noise-unrelated component of the CG image 11 and the noise component of the background image 12 can be obtained by the foregoing calculations. Accordingly, by summing them up, the noise of the background image 12 can be added to the CG image 11.


[0060] The resultant merged image 18 produced by the noise add-on section 17 can be represented as follows:


[0061] R component of merged image 18:


[CR(X,Y)/(2Λb)]×(2Λb)+IR(X,Y)%(2Λb)


[0062] G component of merged image 18:


[CG(X,Y)/(2Λb)]×(2Λb)+IG(X,Y)%(2Λb)


[0063] B component of merged image 18:


[CB(X,Y)/(2Λb)]×(2Λb)+IB(X,Y)%(2Λb)  (3)


[0064] As described above, the present embodiment 1 is configured such that it extracts the noise from the background image 12, and adds it to the CG image 11 to produce the merged image 18 of the CG image 11 and the background image 12. Therefore, it offers an advantage of being able to implement natural merging of the CG image 11 and the background image 12 without bringing about the mismatched feeling.


[0065] EMBODIMENT 2


[0066]
FIG. 4 is a block diagram showing a configuration of an embodiment 2 of the image merging apparatus in accordance with the present invention. In FIG. 4, the same reference numerals designate the same or like portions to those of FIG. 1, and the description thereof is omitted here.


[0067] In FIG. 4, the reference numeral 19 designates a noise generator for generating noise corresponding to the noise included in the background image 12 or images 13.


[0068] Next, the operation of the present embodiment 2 will be described.


[0069] Although the foregoing embodiment 1 comprises the noise extractor 16 for extracting the noise included in the background image 12 or images 13, it is not essential. The present embodiment 2 comprises the noise generator 19 for generating the noise corresponding to the noise included in the background image 12 or images 13. Here, the noise generator 19 can generate the noise with or without utilizing the background image 12 or images 13.


[0070] First, a method will be described in which the noise generator 19 produces noise without using the background image 12 or images 13.


[0071] Using a function F that generates decimal fractions at random from 0.0 to 1.0, the noise generated can be defined by [F×(2Λb)]. Therefore, according to equations (3), the individual components of the merged image 18 can be represented as follows:


[0072] R component of merged image 18:


[CR(X,Y)/(2Λb)]×(2Λb)+[F×(2Λb)]


[0073] G component of merged image 18:


[CG(X,Y)/(2Λb)]×(2Λb)+[F×(2Λb)]


[0074] B component of merged image 18:


[CB(X,Y)/(2Λb)]×(2Λb)+[F×(2Λb)]  (4)


[0075] Since the function F generates a different value each time activated, all the noise values of the components differ from each other. To insert the same noise value intentionally, the function F is activated once, and the generated value is held to be used repeatedly. In this case, the following notations hold.


[0076] R component of merged image 18:


[CR(X,Y)/(2Λb)]×(2Λb)+NOISE


[0077] G component of merged image 18:


[CG(X,Y)/(2Λb)]×(2Λb)+NOISE


[0078] B component of merged image 18:


[CB(X,Y)/(2Λb)]×(2Λb)+NOISE


[0079] where NOISE=[F×(2Λb)]  (5)


[0080] Although this example generates the noise utilizing the random function, any functions are applicable as long as they can define noise. For example, trigonometric functions, exponential functions and the like, or the combinations thereof can be used. Alternatively, the combinations of these functions and the random function are also possible.


[0081] Next, the method will be described when the noise generator 19 produces noise using the background image 12.


[0082] The noise generator 19 extracts the noise components from the individual components of the background image 12 according to equation (1), and examines the characteristics of the noise components such as the mean, variance and periodicity.


[0083] Then, the noise generator 19 generates a function matching the noise characteristics by combining the random function, trigonometric functions, exponential functions and the like. The generated function basically corresponds to the pixel position of the background image 12, and is represented as G(X,Y) An example of the noise generating functions obtained for the respective RGB components is as follows:


GR(X,Y)=MR×(Sin(X)+Sin(Y))/2


GG(X,Y)=MG×(Sin(X)+Sin(Y))/2


GB(X,Y)=MB×(Sin(X)+Sin(Y))/2  (6)


[0084] where


[0085] MR: mean value of noise component of IR(X,Y)


[0086] MG: mean value of noise component of IG(X,Y)


[0087] MB: mean value of noise component of IB(X,Y)


[0088] Using these functions allows the components of the merged image 18 to be expressed as follows:


[0089] R component of merged image 18:


[CR(X,Y)/(2Λb)]×(2Λb)+GR(X,Y)


[0090] G component of merged image 18:


[CG(X,Y)/(2Λb)]×(2Λb)+GG(X,Y)


[0091] B component of merged image 18:


[CB(X,Y)/(2Λb)]×(2Λb)+GB(X,Y)  (7)


[0092] Although the noise generator 19 generates the noise utilizing the background image 12, it can generate the noise in the same manner using the background images 13, the moving images, instead of the background image 12. In this case, however, since the background images 13 includes multiple images, an increasing number of factors that express the noise characteristics such as correlation between background images and the mean values with regard to all the images will offer a wide choice of options of the noise generating function.


[0093] According to the present embodiment 2, it can generate noise without using the background image 12 or images 13. When using the background image 12 or images 13, it can generate the noise taking account of the noise characteristics of the background image 12 or images 13, which allows natural merging of the CG image 11 and the background image 12 or images 13.


[0094] EMBODIMENT 3


[0095]
FIG. 5 is a block diagram showing a configuration of an embodiment 3 of the image merging apparatus in accordance with the present invention. In this figure, the same reference numerals designate the same or like portions to those of FIG. 1, and the description thereof is omitted here.


[0096] In FIG. 5, the reference numeral 20 designates a color difference calculating section for calculating the color difference between the CG image 11 and the background image 12 or images 13 selected by the selector 14; and 21 designates a color difference effecting section for causing the color difference calculated by the color difference calculating section 20 to be reflected in the CG image 11, or the background image 12 or images 13, thereby producing the merged image 18 of the CG image 11 and the background image 12 or images 13.


[0097] Next, the operation of the present embodiment 3 will be described with reference to FIG. 6, a flowchart illustrating the image merging method in the present embodiment 3.


[0098] First, the selector 14 selects either the background image 12 or the background images 13 (step ST11). For convenience of explanation, the present embodiment 3 assumes that the selector 14 selects the background image 12.


[0099] When the selector 14 selects the background image 12, the color difference calculating section 20 calculates the color difference between the CG image 11 and the background image 12 (step ST12).


[0100] Specifically, it calculates the mean values of the RGB components IR(X,Y), IG(X,Y) and IB(X,Y) of the background image 12 in the neighborhood of the point (X,Y), and the mean values of the RGB components CR(X,Y), CG(X,Y) and CB(X,Y) of the CG image 11 in the neighborhood of the point (X,Y), and then obtains the differences between the mean values as the color difference.


DR(X,Y)=MIR(X,Y)−MCR(X,Y)


DG(X,Y)=MIG(X,Y)−MCG(X,Y)


DB(X,Y)=MIB(X,Y)−MCB(X,Y)  (8)


[0101] where


[0102] MIR(X,Y) : mean value of IR in m×n neighborhood of (X,Y)


[0103] MIG(X,Y) : mean value of IG in m×n neighborhood of (X,Y)


[0104] MIB(X,Y) : mean value of IB in m×n neighborhood of (X,Y)


[0105] MCR(X,Y) : mean value of CR in m×n neighborhood of (X,Y)


[0106] MCG(X,Y) : mean value of CG in m×n neighborhood of (X,Y)


[0107] MCB(X,Y) : mean value of CB in m×n neighborhood of (X,Y)


[0108] When the color difference calculating section 20 calculates the color difference, the color difference effecting section 21 causes the color difference to be reflected in the CG image 11 or the background image 12, thereby producing the merged image 18 of the CG image 11 and the background image 12 (step ST13)


[0109] R component of CG image 11 merged with background image 12:


CR(X,Y)+DR(X,Y)


[0110] G component of CG image 11 merged with background image 12:


CG(X,Y)+DG(X,Y)


[0111] B component of CG image 11 merged with background image 12:


CB(X,Y)+DB(X,Y)  (9)


[0112] R component of background image 12 merged with CG image 11:


IR(X,Y)−DR(X,Y)


[0113] G component of background image 12 merged with CG image 11:


IG(X,Y)−DG(X,Y)


[0114] B component of background image 12 merged with CG image 11:


IB(X,Y)−DB(X,Y)  (10)


[0115] Here, if each pixel value obtained as a result of the calculation exceeds the maximum value of the pixel values, it is set at the maximum value, whereas if it is less than the minimum value thereof it is set at the minimum value.


[0116] Incidentally, it is enough for the color difference effecting section 21 to calculate one of equations (9) and (10) without calculating both of them. Usually, since the CG image 11 is adjusted to the color tone of the background image 12, equation (9) is calculated. In contrast, when the background image 12 is adjusted to the color tone of the CG image 11, equation (10) is calculated.


[0117] Although the present embodiment 3 utilizes the background image 12, it can also use the background images 13, the moving images, in place of the background image 12 in the same manner. In this case, since the background images 13 include multiple pictures, the color difference can be calculated for each background image, or for a set of multiple background images.


[0118] As described above, the present embodiment 3 is configured such that it calculates the color difference between the CG image 11 and the background image 12, and causes the color difference to be reflected in the CG image 11 or the background image 12. As a result, it can offer an advantage of being able to implement natural merging of the CG image 11 and the background image 12 without bringing about the mismatched feeling.


[0119] EMBODIMENT 4


[0120] Although the foregoing embodiments 1 and 2 add noise to the CG image 11, and the foregoing embodiment 3 causes the color difference to be reflected in the CG image 11 or the background image 12, both the noise addition processing and color difference reflecting processing can be carried out on the CG image 11 and background image 12.


[0121] More specifically, when the selector 14 selects the background image 12, and the noise extractor 16 extracts the noise from the background image 12, the processings according to equations (3), (8) and (9) are carried out. The RGB components of the CG image 11 merged with the background image 12 are described as follows:


[0122] R component of merged CG image:


[CR(X,Y)/(2Λb)]×(2Λb)+IR(X,Y) %(2Λb)+DR(X,Y)


[0123] G component of merged CG image:


[CG(X,Y)/(2Λb)]×(2Λb)+IG(X,Y) %(2Λb)+DG(X,Y)


[0124] B component of merged CG image:


[CB(X,Y)/(2Λb)]×(2Λb)+IB(X,Y) %(2Λb)+DB(X,Y)  (11)


[0125] When the noise generator 19 is used instead of the noise extractor 16, a similar description is obtained according to equations (4)-(9). When the background images 13 consisting of the moving images are used in place of the background image 12, the basic scheme is the same in spite of the plurality of images.


[0126] According to the present embodiment 4, it not only adds the noise extracted from the background image to the CG image 11, but also calculates the color difference between the CG image 11 and the background image 12 or the like to adjust the color tone of the CG image 11 to that of the background image 12 or the like. Thus, it can implement more natural merging of the CG image 11 with the background image 12 or the like.


[0127] EMBODIMENT 5


[0128]
FIG. 8 is a block diagram showing a configuration of an embodiment 5 of the image merging apparatus in accordance with the present invention. In this figure, the same reference numerals designate the same or like portions to those of FIG. 7, and the description thereof is omitted here.


[0129] In FIG. 8, the reference numeral 31 designates CG shape data from which the CG image is generated; 32 designates a shading section needed for generating the CG image; and 33 designates a color interpolator that performs a basic operation for generating the color of the CG image.


[0130] Although the color matching section 15 is applied to the CG image 11 that has already been produced in the foregoing embodiments 1-4, it can be incorporated into a shading section 32 for generating the CG image 11 instead. Here, an example will be described in which the color matching section 15 is incorporated into the shading section 32 for generating the CG image.


[0131] Next, the operation of the present embodiment 5 will be described.


[0132]
FIG. 9 is a diagram illustrating a shading method of a triangle, a basic element of the CG shape data 31. In this figure, the reference numeral 34 designates a scanning line. Usually, colors at the vertices C1, C2 and C3 are calculated from the normal vectors, light source vectors and color attributes of the triangle (ambient light component, diffuse reflection light component and mirror reflection light component) at the individual vertices (for details, see, Japanese patent application laid-open No. 8-212384/1996 described as the prior art, which is incorporated here by reference).


[0133] Subsequently, the colors (CS1, CS2) at the intersections of the scanning line 34 and the edges C1C2 and C1C3 are calculated as follows by the linear interpolation between C1 and C2, and C1 and C3.


CS1(X,Y)={C1(Y−Y2)+C2(Y1−Y)}/(Y1−Y2)


CS2(X,Y)={C1(Y−Y3)+C3(Y1−Y)}/(Y1−Y3)  (12)


[0134] Then, the color C at a given point (X,Y) inside the triangle is obtained as follows from the CS1 and CS2.


C(X,Y)={CS1(XS2−X)+CS2(X−XS1)}/(XS2−XS1)  (13)


[0135] where the color is handled in its entirety without resolving it into the RGB components in equations (12) and (13).


[0136] Here, the mean values in the m×n neighborhood of the point (X,Y) in equation (8) are calculated as follow:


MIR(X,Y): mean value of IR in m×n neighborhood of (X,Y)


MIG(X,Y): mean value of IG in m×n neighborhood of (X,Y)


MIB(X,Y): mean value of IB in m×n neighborhood of (X,Y)


where m=MAX(X1, X2, X3)-MIN(X1, X2, X3)


n=MAX(Y1, Y2, Y3)-MIN(Y1, Y2, Y3)  (14)


[0137] where MAX is a function for obtaining the maximum value of the arguments, and MIN is a function for obtaining the minimum value of the arguments.


MCR(X,Y)=(C1R+C2R+C3R)/3


MCG(X,Y)=(C1G+C2G+C3G)/3


MCB(X,Y)=(C1B+C2B+C3B)/3


[0138] From the foregoing results, the merged image 18 is obtained as the following expression (15), when the color matching section 15 is incorporated into the shading section 32.


[0139] R component of merged CG image:


[CR(X,Y)/(2Λb)]×(2Λb)+IR(X,Y) %(2Λb)+DR(X,Y)


[0140] G component of merged CG image:


[CG(X,Y)/(2Λb)]×(2Λb)+IG(X,Y) %(2Λb)+DG(X,Y)


[0141] B component of merged CG image:


[CB(X,Y)/(2Λb)]×(2Λb)+IB(X,Y) %(2Λb)+DB(X,Y)  (15)


[0142] where


[0143] CR(X,Y)={CS1R(XS2−X)+CS2R(X−XS1)}/(XS2−XS1)


[0144] CG(X,Y)={CS1G(XS2−X)+CS2G(X−XS1)}/(XS2−XS1)


[0145] CB(X,Y)={CS1B(XS2−X)+CS2B(X−XS1)}/(XS2−XS1)


[0146] CS1R(X,Y)={C1R(Y−Y2)+C2R(Y1−Y)}/(Y1−Y2)


[0147] CS1G(X,Y)={C1G(Y−Y2)+C2G(Y1−Y)}/(Y1−Y2)


[0148] CS1B(X,Y)={C1B(Y−Y2)+C2B(Y1−Y)}/(Y1−Y2)


[0149] CS2R(X,Y)={C1R(Y−Y3)+C3R(Y1−Y)}/(Y1−Y3)


[0150] CS2G(X,Y)={C1G(Y−Y3)+C3G(Y1−Y)}/(Y1−Y3)


[0151] CS2B(X,Y)={C1B(Y−Y3)+C3B(Y1−Y)}/(Y1−Y3)


[0152] IR(X,Y): R component of background image 12


[0153] IG(X,Y): G component of background image 12


[0154] IB(X,Y): B component of background image 12


[0155] DR(X,Y)=MIR(X,Y)−MCR(X,Y)


[0156] DG(X,Y)=MIG(X,Y)−MCG(X,Y)


[0157] DB(X,Y)=MIB(X,Y)−MCB(X,Y)


[0158] MIR(X,Y): mean value of IR in m×n neighborhood of (X,Y)


[0159] MIG(X,Y): mean value of IG in m×n neighborhood of (X,Y)


[0160] MIB(X,Y): mean value of IB in m×n neighborhood of (X,Y)


[0161] where m=MAX(X1, X2, X3)−MIN(X1, X2, X3)


[0162] n=MAX(Y1, Y2, Y3)−MIN(Y1, Y2, Y3)


[0163] MCR(X,Y)=(C1R+C2R+C3R)/3


[0164] MCG(X,Y)=(C1G+C2G+C3G)/3


[0165] MCB(X,Y)=(C1B+C2B+C3B)/3


[0166] As described above, the color matching section 15 can not only be applied to the CG image 11 that has already been generated, but also be incorporated into the shading section 32 for generating the CG image 11. Thus, the present embodiment 5 can quickly implement the merged image 18 of the images such as the CG image 11 and the background image 12, without impairing the natural feeling.


Claims
  • 1. An image merging apparatus for merging a CG (computer graphics) image and its background image to output a merged image, said image merging apparatus comprising: characteristic information output means for outputting information about a characteristic at least of the background image; and merged image producing means for producing the merged image of the CG image and the background image by adding output information of said characteristic information output means to the CG image.
  • 2. The image merging apparatus according to claim 1, wherein said characteristic information output means comprises a noise extractor for extracting noise from the background image; and said merged image producing means comprises a noise add-on section for adding the noise extracted by said noise extractor to the CG image to produce the merged image of the CG image and the background image.
  • 3. The image merging apparatus according to claim 1, wherein said characteristic information output means comprises a noise generator for generating noise corresponding to noise included in the background image; and said merged image producing means comprises a noise add-on section for adding the noise generated by said noise generator to the CG image to produce the merged image of the CG image and the background image.
  • 4. The image merging apparatus according to claim 1, wherein said characteristic information output means comprises a color difference calculating section for calculating color difference between the CG image and the background image; and said merged image producing means comprises color difference effecting section for causing the color difference calculated by said color difference calculating section to be reflected in at least one of the CG image and the background image, thereby producing the merged image of the CG image and the background image.
  • 5. The image merging apparatus according to claim 2, wherein said characteristic information output means further comprises a color difference calculating section for calculating color difference between the CG image and the background image; and said merged image producing means further comprises a color difference effecting section for causing the color difference calculated by said color difference calculating section to be reflected in at least one of the CG image and the background image.
  • 6. The image merging apparatus according to claim 2, wherein said noise add-on section utilizes the CG image that is being generated as an image to be processed.
  • 7. The image merging apparatus according to claim 3, wherein said characteristic information output means further comprises a color difference calculating section for calculating color difference between the CG image and the background image; and said merged image producing means further comprises a color difference effecting section for causing the color difference calculated by said color difference calculating section to be reflected in at least one of the CG image and the background image.
  • 8. The image merging apparatus according to claim 3, wherein said noise add-on section utilizes the CG image that is being generated as an image to be processed.
  • 9. The image merging apparatus according to claim 4, wherein said color difference calculating section and said color difference effecting section utilize the CG image that is being generated as an image to be processed.
  • 10. The image merging apparatus according to claim 1, using one of a still image and moving images as the background image.
  • 11. An image merging method of merging a CG (computer graphics) image and its background image to output a merged image, said image merging method comprising the steps of: outputting information about a characteristic at least of the background image; and producing the merged image of the CG image and the background image by adding the information about the characteristic to the CG image.
  • 12. The image merging method according to claim 11, wherein the step of outputting information extracts noise from the background image; and the step of producing the merged image adds the noise extracted to the CG image to produce the merged image of the CG image and the background image.
  • 13. The image merging method according to claim 11, wherein the step of outputting information generates noise corresponding to noise included in the background image; and the step of producing the merged image adds the noise generated to the CG image to produce the merged image of the CG image and the background image.
  • 14. The image merging method according to claim 11, wherein the step of outputting information calculates color difference between the CG image and the background image; and the step of producing the merged image causes the color difference calculated to be reflected in at least one of the CG image and the background image, thereby producing the merged image of the CG image and the background image.
  • 15. The image merging method according to claim 12, wherein the step of outputting information further calculates color difference between the CG image and the background image; and the step of producing the merged image further causes the color difference calculated to be reflected in at least one of the CG image and the background image.
  • 16. The image merging method according to claim 12, wherein the step of producing the merged image utilizes the CG image that is being generated as an image to be processed.
  • 17. The image merging method according to claim 13, wherein the step of outputting information further calculates color difference between the CG image and the background image; and the step of producing the merged image further causes the color difference calculated to be reflected in at least one of the CG image and the background image.
  • 18. The image merging method according to claim 13, wherein the step of producing the merged image utilizes the CG image that is being generated as an image to be processed.
  • 19. The image merging method according to claim 14, utilizing the CG image that is being generated as an image to be processed.
  • 20. The image merging method according to claim 11, using one of a still image and moving images as the background image.
Priority Claims (1)
Number Date Country Kind
2000-185215 Jun 2000 JP