This application is based upon and claims the benefit of priority from the prior Japanese Patent Application No. 2012-52833, filed on Mar. 9, 2012, the entire contents of which are incorporated herein by reference.
Embodiments described herein relate generally to an image processing device, an image processing method and a non-transitory computer readable recording medium for recording image processing.
Recently, stereoscopic displays which display an image stereoscopically have been widely used. In this kind of stereoscopic displays, a plurality of parallax images viewed from different viewpoints are displayed on the display, and the image is stereoscopically seen by viewing one of the parallax images with left eye and another of the parallax images with right eye. With regard to autostereoscopic display manner which does not use glasses, it is preferable to display not only two parallax images for left eye and right eye, but also more parallax images.
In order to do so, it is necessary to calculate a depth value for each pixel from the parallax images for left eye and the one for right eye, and to generate more parallax images based on the calculated depth value.
For calculating the depth value, for example, the depth value can be calculated based on a shift amount between one block in the parallax image for left eye and the corresponding block in the one for right eye obtained by performing stereo-matching between the parallax image for left eye and the one for right eye. However, in a flat area, it is difficult to detect the corresponding area accurately because features between the parallax images are similar. As a result, incorrect depth values may be obtained in the flat area.
In general, according to one embodiment, an image processing device includes a block determiner, a flat area generator, and a depth information generator. The block determiner is configured to determine whether each block in an input image is a flat block or a non-flat block. The flat area generator is configured to generate a flat area having at least one flat block based on continuity of the flat block. The depth information generator is configured to generate depth information added to each flat block in the flat area.
Embodiments will now be explained with reference to the accompanying drawings.
The present image processing device generates a plurality of (for example, nine) parallax images from an image for left eye and an image for right eye, and stereoscopically displays an image in the autostereoscopic manner. The image for left eye is an image from a first viewpoint, and the image for right eye is an image from a second viewpoint which is at right side of the first viewpoint. The images for left eye and right eye are divided into block composed of a plurality of pixels when processed by the image processing device. Although the size of the block is arbitrary, the block is composed by 8×8 pixels, for example.
The images for left eye and right eye may be obtained by receiving and tuning the broadcast wave, or by being read out from a recording medium such as optical disc or hard disk.
The stereo-matching module 1 performs stereo-matching on the images for left eye and right eye, and adds tentative depth information to the image for left eye or the image for right eye. The depth information is, for example, a depth value indicating how far the block should be seen at near-side or far-side from the display 10. Hereinafter, it is assumed that the tentative depth information is added to each block in the image for left eye, and that the image for left eye and the tentative depth information are outputted.
The block determiner 2 determines whether each block in the image for left eye is a flat or non-flat. Hereinafter, the block determined to be flat is named “flat block” and the one determined to be non-flat is named “non-flat block”.
The flat area generator 3 adds a label into each flat block by performing labeling processing on the flat blocks taking continuity of the flat blocks into consideration. A flat area is formed by flat blocks to which common label is added. That is, the number of generated flat area is equal to the number of labels, and each flat area includes one or a plurality of flat blocks. Furthermore, the flat area generator 3 may perform elimination processing for eliminate a flat area including a few flat blocks, and/or perform combining processing for combining a plurality of non-continuous flat areas having similar features, if needed.
The depth information generator 4 generates depth information added to all of the flat blocks in each of the flat areas in common using, for example, the tentative depth information of the flat block in the flat area or the depth information of the non-flat block around the flat block in the flat area.
The parallax image generator 5 generates nine parallax images based on the image for left eye and the depth information. The depth information means the depth information generated by the depth information generator 4 for each block in the flat area, and means the tentative depth information added by the stereo-matching module 1 for the other blocks.
The display 10 displays the plurality of parallax images simultaneously. Then, a lenticular lens (not shown) is attached on the display 10, and the output direction of each of the parallax images is controlled. By viewing one of the nine parallax images with left eye and another of the nine parallax images with right eye, the image is stereoscopically viewed. Of course, it is possible to realize stereoscopic viewing by another manner such as using parallax barrier and so on.
Firstly, the stereo-matching module 1 performs stereo-matching on the images for left eye and right eye, to add the tentative depth information to each block in the image for left eye (Step S1). In the stereo-matching processing, with regard to one block in the image for left eye, a corresponding block in the image for right eye is searched, the corresponding block being a block in the image for right eye which minimizes the error (for example, a sum of absolute difference of each pixel) from the block in the image for left eye. Then, the stereo-matching module 1 calculates the tentative depth information of each block based on how much both blocks are shifted, that is, a parallax.
By the stereo-matching, rather accurate depth information is generated in a part of edges of objects and so on. On the other hand, accurate depth information is not always generated in a flat part such as a wall with only white color and sky with only blue color. This is because the error between the image for left eye and the one for right eye is small in the flat part, and thus, incorrect search processing may be performed. Therefore, the depth information added by the stereo-matching processing is called “tentative” depth information.
In the present embodiment, the following processing is performed to modify the tentative depth information of the flat part. Accordingly, it is not necessary perform repeat operation and so on for to improving the accuracy of the matching, thereby suppressing the increase of the circuit volume and/or processing time of the stereo-matching module 1.
The block determiner 2 performs flat block determination which determines whether each block in the left eye is flat or non-flat (Step S2). For example, the block determiner 2 determines the block to be a flat block when variance of the luminance or color in the block is larger than a predetermined threshold.
Referring back to
Firstly, the flat area generator 3 sets the number “N” of the label to be “0” (Step S11). Then, when the processing-target block is a flat block (Step S12—YES), the flat area generator 3 adds a label according to whether or not there is a flat block at upper-side or left-side, which will be explained below.
When there is a flat block at upper-side or left-side of the labeling-target flat block (Step S13—YES), one label has already been added to this flat block. Then, the flat area generator 3 adds a label identical to the label which has been added to the flat block to the labeling-target flat block (Step S14,
On the other hand, when there is not a flat block at upper-side and left-side (Step S13—NO), the flat area generator 3 adds the label “N” to the labeling-target flat block (Step S15,
The flat area generator 3 performs the above processing on all of the blocks in the image for left eye (Step S17). Accordingly, an identical label is added to flat blocks continuing in a horizontal direction or a vertical direction, as shown in
Note that, depending on an arrangement of the flat block, different labels may be added to continuing flat blocks. Therefore, after the processing in a raster scan order, correspondence processing may be performed so that an identical label is added to continuing flat block using a reference table of the label.
Furthermore, an example has been described where flat block at only upper-side and left-side are referred, the flat block at upper-left-side and/or upper-right side may be referred. In this case, an identical label is added to flat blocks continuing, not only in the horizontal direction and the vertical direction, but also in a diagonal direction.
Referring back to
Referring back to
Accordingly, comparing to processing the flat areas “0” to “2” independently, more accurate depth information can be generated by combining them.
Note that, if similar flat areas are combined in first, the effect of the elimination processing may decrease because isolated flat areas having a few blocks are combined. Therefore, it is preferable that the combining processing (Step S5 of
Then, after the flat area is generated as the above, the depth information generator 4 generates the depth information added to all of the flat blocks in each of the flat areas in common (Step S6). In order to generate the depth information, it may be possible to use the tentative depth information of the flat block in the flat area and/or the tentative depth information of the non-flat block around the flat block in the flat area, for example. Hereinafter, some specific examples will be explained.
As a simple manner, the depth information generator 4 may set an average of the tentative depth information of the flat blocks in each of the flat areas as the depth information.
As another manner, as shown in
As another manner, as shown in
Hereinafter, more specific explanation will be described with reference to
Among non-flat blocks N1 and N2 adjacent to (including diagonal direction) the flat block F2, it is the non-flat block N1 that should be displayed at further side compared to the flat block F2, and the depth information of the non-flat block N1 is “136”. Among non-flat blocks N3 and N4 adjacent to the flat block F3, it is the non-flat block N4 that should be displayed at further side compared to the flat block F3, and the depth information of the non-flat block N4 is “144”. Among non-flat blocks N1 to N5 adjacent to the flat block F4, it is the non-flat blocks N1 and N4 that should be displayed at further side compared to the flat block F4, and the depth information of the non-flat blocks N1 and N4 are “136” and “144”, respectively.
Therefore, as shown in
Generally, it is considered that the flat area is a background and that the flat area is a part of foreground. Accordingly, it is likely that the flat area is displayed at the same depth as the non-flat area adjacent to the flat area or displayed at further side comparing to the non-flat area. Therefore, according to the manner shown in
Note that, each of the above manners to generate the depth information is only an example, and various manners can be feasible to generate the depth information.
Referring back to
Then, the part where the shifted block has been originally located is interpolated using the surrounding pixels. When generating the parallax image, the depth information generated by the depth information generator 4 is used for each block in the flat area, whereas the tentative depth information added by the stereo-matching module 1 is used for the other blocks.
Then, the generated nine parallax images are stereoscopically displayed on the display 10 (Step S8).
As stated above, in the present embodiment, identical depth information is added to continuing flat blocks. Therefore, accurate depth information can be generated even on the flat block, on which stereo-matching processing is difficult.
Note that, in the above embodiment, an example has been shown where the depth information is a depth value indicative of how far each block should be seen at near-side or far-side from the display 10. On the other hand, the depth information may be a parallax indicative of how a block in the image for right eye is shifted with regard to the corresponding block in the image for left eye.
Furthermore, in the above embodiment, an example has been shown where processing of Step S2 and the later of
Then, the shift between the gravity of the image for left eye and that of the image for right eye is added to the flat block in the flat area in common as the parallax. When the search process is successful, more accurate depth information (parallax) can be obtained.
Note that, the image processing device includes at least a part of
At least a part of the image processing device explained in the above embodiments can be formed of hardware or software. When the image processing device is partially formed of the software, it is possible to store a program implementing at least a partial function of the image processing device in a recording medium such as a flexible disc, CD-ROM, etc. and to execute the program by making a computer read the program. The recording medium is not limited to a removable medium such as a magnetic disk, optical disk, etc., and can be a fixed-type recording medium such as a hard disk device, memory, etc.
Further, a program realizing at least a partial function of the image processing device can be distributed through a communication line (including radio communication) such as the Internet etc. Furthermore, the program which is encrypted, modulated, or compressed can be distributed through a wired line or a radio link such as the Internet etc. or through the recording medium storing the program.
While certain embodiments have been described, these embodiments have been presented by way of example only, and are not intended to limit the scope of the inventions. Indeed, the novel methods and systems described herein may be embodied in a variety of other forms; furthermore, various omissions, substitutions and changes in the form of the methods and systems described herein may be made without departing from the spirit of the inventions. The accompanying claims and their equivalents are intended to cover such forms or modifications as would fail within the scope and spirit of the inventions.
Number | Date | Country | Kind |
---|---|---|---|
2012-52833 | Mar 2012 | JP | national |