1. Field of the Invention
The present invention relates to an image signal coding method and apparatus that generate a sprite image from moving images.
2. Description of the Related Art
In recent years, sprite images have been used as a technique of achieving interactive graphical display on games and the internet. One of conventional techniques of generating a sprite image from moving images is described in JP2000-148130.
According to the description, a sprite image is generated as shown in
In ST4, predictive images are generated by operating the global motion parameters on frames except the base frame. In ST5 pixel values at sample points are calculated using pixel values in a plurality of other frames. Finally, in ST6, using the pixel values at the sample points calculated in ST6, images of the plurality of other frames each containing a predictive image are arranged for background of the base frame so that images are continuously connected.
However, in the above method, when the foreground has a motion different from the background, it is not possible to accurately estimate global motion parameters between images. As a result such a problem arises that a generated background sprite image is blurred.
It is an object of the present invention to provide a method and apparatus for generating a background sprite image with no blurs even when the foreground has a motion different from the background.
The object is achieved by acquiring a depth image from the same viewpoint as in an input image, and using the depth information, separating an input image into a foreground image and background image as layered images.
The above and other objects and features of the invention will appear more fully hereinafter from a consideration of the following description taken in connection with the accompanying drawing wherein one example is illustrated by way of example, in which;
Embodiments of the present invention will be described below with reference to accompanying drawings.
(Embodiment 1)
Range finder 3 outputs the depth image (image obtained by mapping depth values from the camera in pixel gray scale) from the same viewpoint as in the color image.
An output of near-infrared camera 3C is input to depth calculating section 3D. The sweeping of the slit light projects a pattern light by controlling light power of the light source corresponding to sweeping angle, or controlling sweeping speed corresponding to sweeping angle with constant light power of the light source. In the case of a gradient method for performing depth calculation from two light pattern images, by switching projection pattern lights alternately for each field, it is possible to calculate a depth image on a current field from images of a last field and current field.
Depth calculating section 3D analyzes the pattern light in an output image of near-infrared camera 3C, and detects projection direction θ of the slit light when the light reaches each pixel. Then, using the projection direction and position of the pixel, three-dimensional position of object H is calculated from the principal of triangulation. Based on the three-dimensional position, the depth image (image obtained by mapping depth values from the camera in pixel gray scale) is obtained.
Using the depth information from range finder 3, layer section 4 separates a color image into foreground and background as layered images.
Layer section 4 forms images as shown in
Thus, layer section 4 compares the input image obtained from color camera 2 with a threshold based on the depth information, and thereby separates the input image into the foreground image and background image as layered images. In this way, image signal coding apparatus 1 estimates global motion parameters, described later, with accuracy in the background region.
VOP (Video Object Plane) coding section 6 receives as its input time-series foreground images, performs VOP coding on the foreground images, and outputs a foreground stream. In other words, VOP coding section 6 performs coding on shape information and texture information for each video object plane. Identification of foreground and background in VOP coding section 6 may be performed by writing specific pixel values (for example, (R,G,B)=(0,0,0)) indicative of background in the foreground, or receiving in VOP coding section 6 both binary mask image and foreground image shown in
Sprite generating section 5 receives as its input time-series background images and generates a background sprite image. Sprite generating section 6 is configured as shown in
Motion parameter calculating section 5C determines the relationship between each field and background spite from the relationship between a base field and background sprite image and the relationship between the base field and each field, and determines mapping in the sprite image from each field. Pixel value calculating section 5D calculates each pixel value in the background sprite image from values written in the background sprite image a plurality of times in the mapping.
In other words, in sprite generating section 5 between-field correspondence point extracting section 5A searches for a correspondence point between background regions of neighboring fields of background image sequence by block matching, etc. The search for the correspondence point is performed from the base field set in the sequence in the earlier and later time-based directions. As the base field, a time-based generally center field may be selected in the sequence for generating the background sprite image. The correspondence between images is evaluated by SSD indicated below.
In equation (1), I1 is intensity of a base image, I2 is intensity of a reference image, W and H indicate respectively width and height of a block (window region) used in searching for the correspondence point, and x and Y indicate pixel coordinate values at a center position of a block set in the base image. The block in the base image is set to include a predetermined or more number of background pixels in the block. As the motion vector at (x,y) in the base image, SSD is calculated while varying u,v in a search region per pixel basis, and a pair of u,v (motion vector of pixel accuracy) that minimizes SSD is obtained. Next, in order to calculate motion vector of sub-pixel accuracy, u and v are corrected using the following equation in the vicinity of a minimum value of SSD calculated at one-pixel intervals. Taylor's expansion of the spatial distribution of SSD value in the vicinity of (x,y) obtains following equations.
Under the condition that the value of SSD has a limit at a correspondence point, the following equation is obtained.
Thus, motion vector (u+Δu,v+Δv) of sub-pixel accuracy at (x,y) in the base image is calculated. According to the above procedures, a plurality of correspondence points between neighboring fields is calculated.
Between-field motion parameter calculating section 5B fits the global motion model to pairs of the plurality of correspondence points extracted in between-field correspondence point extracting section 5A, using the least square method. Herein, in order to simplify the description, the processing in the section 5B will be described when the global motion model is of affine transformation.
Assuming coordinates in the base image are (x,y) and coordinates in the reference image are (x′,y′), Affine parameters are applied to n pairs of correspondence points (x0,y0), (x′0,y′0) . . . (xn−1,yn−1), (x′n−1,y′n−1). In other words, affine parameters a to f most fitting to following equation (4) are determined.
The fitting of affine parameters is evaluated using following equation (5).
Affine parameters a to f that minimize equation (5) are obtained by solving equation (7) under the condition of equation (6).
When a result of the search for the corresponding point in between-field correspondence extracting section 5A contains an erroneous correspondence, the estimation error of affine parameters becomes large. In order to improve the error, an outlier of correspondence point is removed. In removing the outlier of correspondence point, using estimated affine parameter values a to f calculated from the plurality of correspondence points (x0,y0), (x′0,y′0) to (xn−1,yn−1), (x′n−1,y′n−1) and equation (7), the fitting accuracy of affine parameters at each correspondence point is evaluated using equations (8) and (9):
Then, an outlier is removed using rAVE+σr as a threshold, and affine parameters are fitted again to remaining pairs of correspondence points. Herein, rAVE is an average value of ri, and σr is standard deviation of ri.
Motion parameter calculating section 5C synthesizes using affine parameters between neighboring background fields calculated in between-field motion parameter calculating section 5B and affine parameters between the base field and sprite image (sprite image is extended two times in y-direction as shown in
Using the affine parameters between each background field and background sprite image, pixel value calculating section 5D maps each background field image in the background sprite image. As shown in
By performing such processing, sprite generating section 5 generates a background sprite image from the background image sequence.
Sprite coding section 7 encodes fetch coordinates, called a sprite point, of each frame in the background sprite image, as well as the background sprite image, by sprite coding, and generates a background stream.
In the above configuration, in image signal coding apparatus 1, when an input image from color camera 2 is input to layer section 4, the input image is separated into a foreground image and background image based on the depth information obtained from range finder 3 to be layered images.
Then, in image signal coding apparatus 1, sprite generating section 5 generates a background sprite image using separated background images. At this point, sprite generating section 5 fits the global motion model to the background image to calculate each parameter.
In this way, image signal coding apparatus 1 calculates parameters by fitting the global motion model to background images obtained by separating input images based on the depth information, instead of calculating parameters by directly fitting the global motion model to input images.
As a result, in image signal coding apparatus 1, it is possible to estimate global motion parameters in a background region with accuracy even when the foreground has a motion different from the background. In image signal coding apparatus 1, thus using accurate global motion parameters, pixel value calculating section 5D maps background field images in the background sprite image.
In this way, in image signal coding apparatus 1, since a background sprite image is generated based on global motion parameters with accuracy calculated only for the background image, it is possible to suppress image blurs occurring particularly around a boundary between the foreground and background even when the foreground has a motion different from the background.
Thus, according to the above configuration, a depth image from the same viewpoint as in an input image is acquired, and using the depth information, the input image is separated into a foreground image and background image as layered images, whereby it is possible to estimate global motion parameters with accuracy for the background region and to generate a background sprite image with no blurs even when there are objects with different motions in the foreground and background.
(Embodiment 2)
As shown in
By thus extending the background sprite image by one or two pixels, when a receiving side combines the background obtained by sprite decoding and foreground obtained by VOP decoding, it is possible to prevent an occurrence of pixel in which a pixel value is not written in the vicinity of a boundary between the foreground and background.
In other words, in the decoding in decoding apparatus 10 shown in
Thus, according to the above configuration, by providing sprite extending section 31 which extrapolates a peripheral region in which pixels values are written to a region in which pixel values are not written due to interception of the foreground to write pixel values in the background sprite image, it is possible to prevent an occurrence of pixel in which a pixel value is not written in the vicinity of a boundary between the foreground and background when a receiving side combines the sprite-decoded background and VOP-decoded foreground.
(Embodiment 3)
Region boundary correcting section 41 extends the foreground edge by extending processing performed as a general image processing technique to correct the boundary between the foreground and background.
When the foreground region and background region have different motions, a region such as region A which is originally of foreground but separated erroneously as background causes a blur in the background sprite image. Meanwhile, a region such as region B which is originally of background but separated erroneously as foreground does not cause a blur in the background sprite image.
In performing VOP-coding on the foreground region, a region such as region B causes a coding amount to increase to some extent, but does not have effects on the image quality. Accordingly, the extending processing in region boundary correcting section 41 prevents a region originally of foreground to be separated erroneously as background, as shown in
In addition, an amount (the number of pixels) to extend the foreground region may be determined corresponding to accuracy (i.e., volumes of regions A and B in
Thus, according to the above configuration, even when a region which is originally of foreground is separated erroneously as background, by extending the foreground region to correct a position of the boundary between the foreground and background, it is possible to generate a background sprite image with no blurs.
Further, when region boundary correcting section 14 executes contraction processing first and then extending processing, it is possible to delete a noise-like fine foreground region, and to decrease a form coding amount in VOP layering.
Furthermore, as shown in
(Embodiment 4)
In image signal coding apparatus 60, a foreground stream generated in VOP coding section 6 and background stream generated in sprite coding section 7 are respectively input to VOP decoding section 61 and sprite decoding section 62. VOP decoding section 61 and sprite decoding section 62 perform local decoding respectively on the foreground stream and background stream, and output respective local decoded data to combining section 63.
The local decoded data combined in combining section 63 is output to residual calculating section 64. Residual calculating section 64 calculates a residual between the local decoded data and the input image output from color camera 2. Examples calculated as the residual are an absolute value of intensity difference, square of intensity difference, absolute sum of difference between RGB values, square sum of difference between RGB values, absolute sum of difference between YUV values and square sum of difference between YUV values.
Foreground correcting section 65 receives as its inputs the input image from color camera 2, foreground image from layer section 4 and residual from residual calculating section 64, and adds a region with a residual more than or equal to a predetermined threshold to the foreground region. Herein, decreasing the threshold increases a coding amount but improves the transmission image quality, while increasing the threshold decreases the image quality to some extent but suppresses a coding amount.
VOP coding section 66 performs VOP coding on the foreground image corrected in foreground correcting section 65 to output as a foreground stream.
Thus, according to the above configuration, it is possible to implement image signal coding apparatus 60 which corresponding to error (residual) caused by layer coding, adds a region with a large error to foreground, thereby corrects the foreground region to perform coding, and thus improves the image quality of an image to transmit.
(Other Embodiments)
In addition, above-mentioned Embodiment 4 describes the case of comparing a residual with a predetermined threshold, and adding a region with the residual more than or equal to the threshold to foreground, but the present invention is not limited to the above case. Instead of simply adding a region with the residual more than or equal to the threshold to a foreground region, it may be possible to perform residual suppression processing (fine region eliminating processing) that is a well-known technique to add to the foreground region. In this way, without greatly degrading subjective image quality, it is possible to suppress increases in shape information (i.e., increases in coding amount) of the foreground region due to the foreground correction.
Further, while above-mentioned embodiments describe the case of performing VOP coding on a foreground image, the present invention is not limited to the above case. A case may be possible of writing specific pixel values (for example, (R,G,B)=(0,0,0)) indicative of background in a foreground image, performing coding and decoding without using shape information in MPEG 2 etc., and combining the foreground and background according to the specific pixel values in combining the foreground and background. In this case, even when other coding processing is performed instead of VOP coding, it is possible to obtain the same effects as in the above-mentioned embodiments.
Furthermore, while the above-mentioned embodiments describe the case of using a range finder as depth image obtaining means, the present invention is not limited to the above case. It may be possible to use a stereo camera or multi-viewpoint camera, in other words, any camera capable of shooting a color image and depth image from the same viewpoint may be used.
Still furthermore, while the above-mentioned embodiments describe the case of using affine transformation in generating a background sprite, the present invention is not limited o the present invention. It may be possible to execute other transformation such as viewpoint-projection transformation or weak viewpoint-projection transformation to generate a background sprite.
Moreover, while the above-mentioned embodiments explain the present invention as aspects of an apparatus and method, the present invention is applicable as a storage medium storing the above method as a program.
An image signal coding method of the present invention has an image input step of inputting an input image to be encoded, a depth image obtaining step of obtaining a depth image from the same viewpoint as in the input image, a layer step of separating the input image into a foreground image and a background image as layered images using depth information of the depth image obtained in the depth image obtaining step, a coding step of coding foreground images, a background sprite generating step of generating a background sprite image from background images, and a sprite coding step of coding the background sprite image.
According to the method, even when the foreground has a motion different from the background, by separating an input image into a foreground region and background region as layer images using the depth information, it is possible to estimate global motion parameters in the background region with accuracy, and to generate a background sprite image with no blurs.
The image signal coding method of the present invention further has a background sprite extending step of extending a background region of the background sprite image generated in the background sprite generating step.
According to the method, even when there is a region in which pixel values are not written due to interception of foreground in the background sprite image, since the background region in the background sprite image is extended, it is possible to prevent an occurrence of pixel in which a pixel value is not written in the vicinity of a boundary between the foreground and background in the decoded image.
The image signal coding method of the present invention further has a region boundary correcting step of extending a foreground region generated in the layer step, and thereby correcting a position of a region boundary between the foreground image and the background image.
According to the method, even when a region which is originally of foreground is separated erroneously as background, by extending the foreground region to correct a position of the boundary between the foreground and background, it is possible to generate a background sprite image with no blurs.
The image signal coding method of the present invention further has a first local decoding step of performing local decoding on coded data generated in the coding step, a second local decoding step of performing local decoding on coded data generated in the sprite coding step, a residual calculating step of obtaining a residual between the input image and a decoded image resulting from the first decoding step and the second decoding step, and a foreground correcting step of adding a pixel with a large residual to foreground and thereby correcting the foreground.
According to the method, by adding a region with a large residual caused by generating layered images to encode, it is possible to improve the image quality of an image to transmit
The image signal coding method of the present invention further has a residual suppression step of not adding to foreground a region with an area thereof less than a second threshold among regions with a residual from the input image more than a first threshold.
According to the method, without greatly degrading subjective image quality, it is possible to decrease increases in shape information (i.e., increases in coding amount) of the foreground region due to the foreground correction.
In the image signal coding method of the present invention, VOP coding is performed on the foreground image in the coding step.
An image signal coding apparatus of the present invention has an image input section that inputs an input image to be encoded, a depth image obtaining section that obtains a depth image from the same viewpoint as in the input image, a layer section that separates the input image into a foreground image and a background image as layered images using the depth image, a coding section that encodes foreground images, a background sprite generating section that generates a background sprite image from background images, and a sprite coding section that encodes the background sprite image.
A storage medium of the present invention is a computer readable storage medium storing an image signal coding program having an image input procedure of inputting an input image to be encoded, a depth image obtaining procedure of obtaining a depth image from the same viewpoint as in the input image, a layer procedure of separating the input image into a foreground image and a background image as layered images using depth information of the depth image, a coding procedure of coding foreground images, a background sprite generating procedure of generating a background sprite image from background images, and a sprite coding procedure of coding the background sprite image.
A program of the present invention makes a computer execute an image input procedure of inputting an input image to be encoded, a depth image obtaining procedure of obtaining a depth image from the same viewpoint as in the input image, a layer procedure of separating the input image into a foreground image and a background image as layered images using depth information of the depth image, a coding procedure of coding foreground images, a background sprite generating procedure of generating a background sprite image from background images, and a sprite coding procedure of coding the background sprite image.
The present invention is not limited to the above described embodiments, and various variations and modifications may be possible without departing from the scope of the present invention.
This application is based on the Japanese Patent Application No. 2001-203830 filed on Jul. 4, 2001, entire content of which is expressly incorporated by reference herein.
Number | Date | Country | Kind |
---|---|---|---|
2001-203830 | Jul 2001 | JP | national |
Number | Name | Date | Kind |
---|---|---|---|
6301382 | Smith et al. | Oct 2001 | B1 |
6556704 | Chen | Apr 2003 | B1 |
6577679 | Apostolopoulos | Jun 2003 | B1 |
6625310 | Lipton et al. | Sep 2003 | B1 |
6870945 | Schoepflin et al. | Mar 2005 | B1 |
6873723 | Aucsmith et al. | Mar 2005 | B1 |
Number | Date | Country |
---|---|---|
1233372 | Oct 1999 | CN |
0717373 | Jun 1996 | EP |
0921687 | Jun 1999 | EP |
5-249953 | Sep 1993 | JP |
8-182023 | Jul 1996 | JP |
10155148 | Jun 1998 | JP |
10214352 | Aug 1998 | JP |
2000-148130 | May 2000 | JP |
Number | Date | Country | |
---|---|---|---|
20030012277 A1 | Jan 2003 | US |