[summary of the invention]
The invention provides a kind of stereoscopic image generating device and method thereof, it can be converted to two-dimensional picture left eye picture and right eye picture, and the left eye picture of right eye picture and last two-dimensional picture arranges in pairs or groups to produce stereopsis, to promote the third dimension of vision, and the colour of skin part of reinforcement image.
The present invention proposes a kind of stereoscopic image generating device, it is characterized in that: comprise brightness acquisition unit, Cr colourity acquisition unit, first adder, brightness adjustment unit, background depth generation unit, second adder, image generation unit and delay cell.Brightness acquisition unit receives two-dimensional picture, and the luminance graph of output two-dimensional picture.Cr colourity acquisition unit receives two-dimensional picture, and the Cr chromatic diagram of output two-dimensional picture.First adder couples brightness acquisition unit and Cr colourity acquisition unit, in order in conjunction with luminance graph and Cr chromatic diagram output brightness reference diagram.Brightness adjustment unit couples first adder, in order to adjust the range of luminance values of brightness reference diagram.Background depth generation unit, in order to produce background depth map.Second adder couples brightness adjustment unit and background depth generation unit, and brightness reference diagram and the background depth map after adjusting in order to combination also exported picture depth map.Image generation unit couples second adder and receives two-dimensional picture, to produce left eye picture and right eye picture according to two-dimensional picture and picture depth map.Delay cell couples image generation unit, during by left eye picture and right eye picture, one of them postpones a picture.
In an embodiment of the present invention, the range of luminance values that the summation of the range of luminance values of brightness reference diagram after above-mentioned adjustment and the range of luminance values of background depth map is two-dimensional picture.
In an embodiment of the present invention, the range of luminance values of the brightness reference diagram after above-mentioned adjustment is less than half of range of luminance values of two-dimensional picture.
In an embodiment of the present invention, stereoscopic image generating device more comprises a buffer cell, couples image generation unit and receives two-dimensional picture, in order to cushion two-dimensional picture.
In an embodiment of the present invention, above-mentioned background degree of depth generation unit comprises that column counter and brightness value search unit.Column counter receives two-dimensional picture, to count the columns of two-dimensional picture and to export count results.Brightness value is searched unit and is coupled column counter, and searches a look-up table according to count results, to export corresponding brightness value and to form figure viewed from behind depth map according to the columns of two-dimensional picture.
In an embodiment of the present invention, above-mentioned image generation unit produces left eye picture and right eye picture according to a degree of depth drawing image method (depth-image-based rendering, DIBR).
The present invention also proposes a kind of stereopsis production method, comprises the following steps.Receive two-dimensional picture.Obtain luminance graph and the Cr chromatic diagram of two-dimensional picture.In conjunction with luminance graph and Cr chromatic diagram as brightness reference diagram.In conjunction with brightness reference diagram and background depth map to produce picture depth map.According to two-dimensional picture and picture depth map, produce left eye picture and right eye picture.Output left eye draw and right eye picture one of them, and left eye picture and right eye picture output after wherein another postpones during a picture.
In an embodiment of the present invention, the range of luminance values that the summation of the range of luminance values of above-mentioned brightness reference diagram and the range of luminance values of background depth map is two-dimensional picture.
In an embodiment of the present invention, the range of luminance values of above-mentioned two-dimensional picture is less than or equal to half of range of luminance values of two-dimensional picture.
In an embodiment of the present invention, the brightness value of above-mentioned figure viewed from behind depth map is for increasing progressively by column from top to bottom.
In an embodiment of the present invention, above-mentioned left eye picture and right eye picture are for utilizing degree of depth drawing image method to produce.
Based on above-mentioned, the stereoscopic image generating device of the embodiment of the present invention and method thereof, it obtains the luminance graph of two-dimensional picture and Cr chromatic diagram to produce brightness reference diagram, again brightness reference diagram is combined with background depth map and generates picture depth map, according to picture depth map and two-dimensional picture, can produce left eye picture and right eye picture, wherein one of them of left eye picture or right eye picture can be corresponding with right eye picture last two-dimensional picture or left eye picture left eye picture and the right eye picture as stereopsis.By this, left eye picture and the right eye picture of stereopsis can be produced, and the third dimension of vision can be promoted.
For the above-mentioned feature and advantage of the present invention can be become apparent, special embodiment below, and coordinate appended graphic being described in detail below.
[accompanying drawing explanation]
Fig. 1 is the system schematic according to the stereoscopic image generating device of one embodiment of the invention.
The schematic diagram of brightness reference diagram, figure viewed from behind depth map, picture depth map, left eye picture and right eye picture after the two-dimensional picture that Fig. 2 A to Fig. 2 I is one embodiment of the invention, luminance graph, Cr chromatic diagram, brightness reference diagram, adjustment.
Fig. 3 is the flow chart according to the stereopsis production method of one embodiment of the invention.
[main element symbol description]
100: stereoscopic image generating device
110: brightness acquisition unit
120:Cr colourity acquisition unit
130,160: adder
140: brightness adjustment unit
150: figure viewed from behind degree of depth generation unit
151: column counter
153: brightness value is searched unit
170: image generation unit
180: delay cell
190: buffer cell
FR: two-dimensional picture
LF, LF ': left eye picture
PB: luminance graph
PCr:Cr chromatic diagram
PBD: background depth map
PBR, PBR ': brightness reference diagram
PFD: picture depth map
RF: right eye picture
S310, S320, S330, S340, S350, S360: step
[embodiment]
In general, because most people are that the right hand is used video camera, therefore most user to utilize video camera be all by left-to-right shooting along object to the shooting custom of an object.In other words, be equal within the extremely short time, to have taken after first picture and move right and then take second picture.In this case, with respect to second picture, above-mentioned first picture is equal to left view directions looks, thus first picture can be used as be the picture that left eye is seen.Similarly, and above-mentioned second picture is equal to and looks with right-hand view directions, and therefore can be used as be the picture that right eye is seen to second picture.
According to above-mentioned, meeting of the present invention produces corresponding left eye picture and right eye picture according to each taken two-dimensional picture, and each left eye picture can be with corresponding next right eye picture of opening two-dimensional picture respectively as left eye picture and the right eye picture of stereopsis, to promote the third dimension of vision.And the present invention can capture the Cr chromatic diagram of two-dimensional picture, to strengthen the colour of skin part of two-dimensional picture, and then the accuracy of strengthening object judgement.
Fig. 1 is the system schematic according to the stereoscopic image generating device of one embodiment of the invention.The schematic diagram of brightness reference diagram, figure viewed from behind depth map, picture depth map, left eye picture and right eye picture after the two-dimensional picture that Fig. 2 A to Fig. 2 J is one embodiment of the invention, luminance graph, Cr chromatic diagram, brightness reference diagram, adjustment.Please refer to Fig. 1, in the present embodiment, stereoscopic image generating device 100 comprises brightness acquisition unit 110, Cr colourity acquisition unit 120, adder 130,160, brightness adjustment unit 140, figure viewed from behind degree of depth generation unit 150, image generation unit 170, delay cell 180 and buffer cell 190.
Brightness acquisition unit 110 receives two-dimensional picture FR, and captures the Luminance Distribution of two-dimensional picture FR with the luminance graph PB of output two-dimensional picture FR, and wherein as shown in Figure 2 A, luminance graph PB as shown in Figure 2 B for two-dimensional picture FR.Furthermore, the brightness value that brightness acquisition unit 110 can be averaged and using as each picture element after the brightness value (being GTG value) of the sub-picture element of the redness that obtains each picture element, green sub-picture element and blue sub-picture element.Accordingly, when two-dimensional picture FR is colour picture, luminance graph PB can be grey menu (i.e. not colorful picture).
The same two-dimensional picture FR that receives of Cr colourity acquisition unit 120, and capture the Cr Colour of two-dimensional picture FR with the Cr chromatic diagram PCr of output output two-dimensional picture FR, wherein Cr chromatic diagram PCr as shown in Figure 2 C, and Cr chromatic diagram PCr can retain the middle colour of skin part of two-dimensional picture FR, that is Cr chromatic diagram PCr can highlight the part of the colour of skin of two-dimensional picture FR.Furthermore, brightness acquisition unit 110 can, after the brightness value (being GTG value) of the sub-picture element of the redness that obtains each picture element, green sub-picture element and blue sub-picture element, can utilize following formula to calculate the brightness value of each picture element.
Cr=0.5×R-0.419×G-0.081×B
Wherein, the chromatic value that the Cr in above-mentioned formula is each picture element, the brightness value that R is each red sub-picture element, the brightness value that G is each green sub-picture element, the brightness value that B is each blue sub-picture element.
Adder 130 couples brightness acquisition unit 110 and Cr colourity acquisition unit 120, in order in conjunction with luminance graph PB and Cr chromatic diagram PCr output brightness with reference to figure PBR, wherein brightness with reference to figure PBR as shown in Figure 2 D, and brightness can present high brightness with reference to the colour of skin part in figure PBR, makes object (take human body as example at this) can become more obvious.Furthermore, adder 130 can be added the corresponding brightness value of each picture element and chromatic value, after the brightness value of all picture elements and chromatic value addition, forms brightness with reference to figure PBR.Because Cr chromatic diagram PCr can highlight the part of the colour of skin, so brightness also can be highlighted (in this case presenting high brightness state) with reference to the colour of skin part in figure PBR.
Brightness adjustment unit 140 couples adder 130, in order to adjust brightness with reference to the range of luminance values of figure PBR after the brightness of output after adjusting with reference to figure PBR ', wherein and brightness with reference to figure PBR ' as shown in Figure 2 E.Background depth generation unit 150 is in order to produce background depth map PBD, and wherein background depth map PBD as shown in Figure 2 F.Generally speaking, the top of the background of picture can from human eye away from, and the below of the background of picture can from human eye close to, at this, for example, with low brightness values (brightness value 0), represent remote, for example, with high luminance values (brightness value 192), represent closely, and the brightness value of picture can be increased progressively by top to below, so the brightness value of figure viewed from behind depth map PBD is for increasing progressively by column from top to bottom.Adder 160 couples brightness adjustment unit 140 and background depth generation unit 150, in order in conjunction with brightness with reference to figure PBR ' and background depth map PBD and export a picture depth map PFD, wherein picture depth map PFD is as shown in Figure 2 G.
In the present embodiment, brightness is adjusted to the range of luminance values of two-dimensional picture FR with reference to the range of luminance values of figure PBR '.The range of luminance values of supposing two-dimensional picture FR is 0 ~ 255, and brightness can be 0 ~ 64 with reference to the range of luminance values of figure PBR ', that is the range of luminance values of 1/4 two-dimensional picture FR.Now, the adjustment mode of brightness value can brightness can obtain brightness with reference to figure PBR ' with reference to the brightness value of each picture element of figure PBR divided by 4.And, the range of luminance values of figure viewed from behind depth map PBD is set as 0 ~ 192, that is the range of luminance values of 3/4 two-dimensional picture FR, so that adder 160 can not surpass the upper limit with reference to figure PBR ' in conjunction with the brightness value of each picture element of the picture depth map PFD exporting by figure viewed from behind depth map PBD and brightness, so avoid in picture depth map PFD object because of brightness value fuzzy over the upper limit.
In other embodiments, brightness can equal the range of luminance values of two-dimensional picture FR with reference to the summation of the range of luminance values of figure PBR ' and the range of luminance values of figure viewed from behind depth map PBD, and picture depth map PFD can be take figure viewed from behind depth map PBD as main, so brightness can be less than or equal to the range of luminance values of two-dimensional picture FR with reference to the range of luminance values of figure PBR '.
Buffer cell 190 couples image generation unit 170 and receives two-dimensional picture FR, in order to cushion two-dimensional picture FR, so that the time similarity of image generation unit 170 reception picture depth map PFD and two-dimensional picture FR or identical.Image generation unit 170 couples adder 160 and buffer cell 190 to receive two-dimensional picture FR and picture depth map PFD, image generation unit 170 produces left eye picture LF and right eye picture RF according to two-dimensional picture FR and picture depth map PFD, wherein image generation unit 170 can be according to degree of depth drawing image method (depth-image-based rendering, DIBR) produce left eye picture LF and right eye picture RF, and left eye picture LF and right eye picture RF are respectively as shown in Fig. 2 H and Fig. 2 I.
In the present embodiment, Fig. 2 H and Fig. 2 I are that mobile prospect (being personage) generates left eye picture LF and right eye picture RF, that is background is motionless, and the personage of Fig. 2 H can take over, and the personage of Fig. 2 I can take back.But in other embodiments, left eye picture LF and right eye picture RF can mobile background generate left eye picture LF and right eye picture RF, that is prospect (being personage) not can, the background of left eye picture LF can move to left, the background of right eye picture RF can move to right.
Delay cell 180 couples image generation unit 170, in order to export after during a picture of left eye picture LF delay, and directly output of right eye picture RF.Accordingly, right eye picture RF can be usingd as stereopsis with the left eye picture LF ' pairing of corresponding last two-dimensional picture FR left eye picture and right eye picture.
Furthermore, in the present embodiment, background depth generation unit 150 comprises that column counter 151 and brightness value search unit 153.Column counter 151 receives two-dimensional picture FR, to count the columns of two-dimensional picture FR and to export count results CR.Brightness value is searched unit 153 and is coupled column counter 151, and searches a look-up table according to count results CR, to export corresponding brightness value according to the columns of two-dimensional picture FR to form figure viewed from behind depth map PBD.In display, the writing mode of picture can be from top to bottom, so the columns of two-dimensional picture FR can down be counted by top.When count results CR represents that the columns of two-dimensional picture FR increases gradually, brightness value is searched the brightness value of exporting unit 153 also can increase according to count results CR, so that can form the figure viewed from behind depth map PBD of brightness value for increasing progressively by column from top to bottom.
In addition in the above-described embodiments, be output after will left eye picture LF postponing during a picture, so that left eye picture and right eye picture that right eye picture RF can be usingd as stereopsis with the left eye picture LF ' pairing of corresponding last two-dimensional picture FR.But in other embodiments, can will right eye picture RF postpone during a picture after output so that left eye picture and right eye picture that left eye picture LF can be usingd as stereopsis with the right eye picture pairing of corresponding last two-dimensional picture FR.In other words, in other embodiments, delay cell 180 is in order to export after during a picture of right eye picture RF delay, and directly output of left eye picture LF.Accordingly, left eye picture LF can be usingd as stereopsis with the right eye picture pairing of corresponding last two-dimensional picture FR left eye picture and right eye picture.
According to above-mentioned, can converge a whole stereopsis production method to be applied to stereoscopic image generating device 100.Fig. 3 is the flow chart according to the stereopsis production method of one embodiment of the invention.Please refer to Fig. 3, in the present embodiment, can first receive two-dimensional picture (step S310), and obtain luminance graph and the Cr chromatic diagram (step S320) of two-dimensional picture.Then, in conjunction with luminance graph and Cr chromatic diagram as brightness reference diagram (step S330).Then, in conjunction with brightness reference diagram and background depth map, to produce picture depth map (step S340), then produce left eye picture and right eye picture (step S350) according to two-dimensional picture and picture depth map.Finally, one of them of output left eye picture and right eye picture, and the output after wherein another postpones during a picture of left eye picture and right eye picture.Wherein, the details of above-mentioned steps can, with reference to the explanation of above-mentioned stereoscopic image generating device 100, repeat no more at this.
In sum, the stereoscopic image generating device of the embodiment of the present invention and method thereof, it obtains the luminance graph of two-dimensional picture and Cr chromatic diagram to produce brightness reference diagram, again brightness reference diagram is combined with background depth map and generates picture depth map, according to picture depth map and two-dimensional picture, can produce left eye picture and right eye picture, wherein left eye picture or right eye picture can be corresponding and right eye picture last two-dimensional picture or left eye picture left eye picture and the right eye picture as stereopsis.By this, left eye picture and the right eye picture of stereopsis can be produced, and the third dimension of vision can be promoted.
Although the present invention discloses as above with embodiment; so it is not in order to limit the present invention; under any, in technical field, have and conventionally know the knowledgeable; do not departing from spirit and scope of the invention; when doing a little change and retouching, thus protection range of the present invention when depending on after the attached claim person of defining be as the criterion.