Twill grating stereo original image filling method based on matching weighting

文档序号:882744 发布日期:2021-03-19 浏览:4次 中文

阅读说明:本技术 一种基于匹配加权的斜纹光栅立体原图填充方法 (Twill grating stereo original image filling method based on matching weighting ) 是由 侯文广 江嘉瑶 段立哲 王一博 谢子越 张思源 于 2020-11-10 设计创作,主要内容包括:本发明公开了一种基于匹配加权的斜纹光栅立体原图填充方法,属于裸眼3D显示技术领域。本发明方法在立体原图合成过程中,对分数子像素的填充进行了改进,具体地,通过像素匹配对位于分数视点图像编号处的子像素所在的全像素所属对象与其临近视点像素所属对象之间的关系进行判断,进而选择使用反距离加权填充,或就近取整的方法获取子像素的值,对比现有方法,本发明方法所产生的立体原图在斜纹光栅的作用下,其图像粗糙感明显得到改善,画面更显细腻、细节更良好,抑制了串扰现象,减少了由于视差较小时串扰过多导致的假3D效果出现。(The invention discloses a matching weighting-based twill grating stereoscopic original image filling method, and belongs to the technical field of naked eye 3D display. The method improves the filling of the fractional sub-pixels in the synthesis process of the stereoscopic original image, specifically, judges the relationship between the full-pixel object of the sub-pixels at the fractional viewpoint image number and the object of the adjacent viewpoint pixels through pixel matching, and further selects and uses inverse distance weighted filling or a method of rounding nearby to obtain the value of the sub-pixels.)

1. A filling method of a twill grating stereoscopic original image based on matching weighting is characterized by comprising the following steps:

s1, sequentially numbering initial viewpoint images to be sampled;

s2, substituting equipment parameters for displaying the stereoscopic original image into a sub-pixel viewpoint mapping formula to obtain a viewpoint number corresponding to each sub-pixel in the stereoscopic original image to be filled;

s3, the following steps are executed on the view numbers corresponding to the sub-pixels in the three-dimensional original image to be filled row by row, so as to obtain the completely filled three-dimensional original image:

01. reading a view point number corresponding to the current sub-pixel and a position (l, k) of the current sub-pixel in the stereoscopic original image;

02. if the viewpoint number is a non-zero integer, then go to step 03; if the viewpoint number is 0, adjusting the viewpoint number to be an integer according to the number of the viewpoint numbers, and turning to step 03; if the viewpoint number is a score, turning to step 04;

03. selecting the initial viewpoint image with the corresponding number in the step S1, and filling the current sub-pixel position in the stereoscopic original image with the sub-pixel at the (l, k) position in the image;

04. judging whether the whole pixel where the current sub-pixel is located and the peripheral whole pixel are in the same object; if so, performing reverse distance weighted filling on the current sub-pixel; if not, the nearest rounding is carried out on the current viewpoint number, and the sub-pixel filling is carried out by using the step 03.

2. The method for filling a twill grating stereoscopic original image based on matching weighting as claimed in claim 1, wherein step S1 is to number the initial viewpoint images to be sampled in an order starting from the rightmost viewpoint and ending from the leftmost viewpoint.

3. The method for filling the twill-raster stereoscopic original image based on matching weighting as claimed in claim 1, wherein the viewpoint number corresponding to each sub-pixel in the stereoscopic original image to be filled in step S2 determines whether to perform the reverse stereoscopic processing according to the numbering sequence, specifically:

if the serial number is from the leftmost view to the rightmost view, the reverse stereoscopic view processing is required; otherwise, no processing is required.

4. The method as claimed in claim 3, wherein if the viewpoint number is 0 in step 02, the viewpoint number is adjusted to be an integer according to the number of viewpoints, specifically, to be a first viewpoint number, a final viewpoint number or a central viewpoint number.

5. The method for filling a twill grating stereoscopic artwork based on matching weighting as claimed in any one of claims 1 to 4, wherein the step 04 of determining whether the full pixel where the current sub-pixel is located and the peripheral full pixel are in the same object specifically includes:

obtaining a left adjacent viewpoint number Nmin and a right adjacent viewpoint number Nmax of the current sub-pixel according to the fraction value of the current viewpoint number; wherein, the adjacent viewpoint number corresponds to the initial viewpoint image number in step S1;

respectively reading the rgb color gamut of the full pixel where the sub-pixel at the (l, k) position of the image corresponding to the left adjacent viewpoint number Nmin and the right adjacent viewpoint number Nmax;

calculating color difference for the two rgb color gamut values read; if the color difference is smaller than the set threshold, determining that the full pixel where the current sub-pixel is located and the peripheral full pixel are located in the same object; and if the color difference is larger than the set threshold value, judging that the objects are not the same.

6. The method as claimed in claim 5, wherein the step 04 of performing inverse distance weighted filling on the current sub-pixel specifically includes:

calculating the distance difference between the view point number of the current sub-pixel and Nmax and Nmin to obtain a first difference value wm and a second difference value wn; wherein wm is Nmax-N, wn is N-Nmin;

and taking the sum of the product of the corresponding sub-pixel values in the original image to be sampled of the wm viewpoint and the Nmin viewpoint and the product of the corresponding sub-pixel values in the original image to be sampled of the Nmax viewpoint as the pixel value of the corresponding sub-pixel of the stereo original image.

7. The method as claimed in claim 5, wherein the step 04 of nearest neighbor rounding of the current viewpoint number and sub-pixel filling in step 03 are performed, and the method specifically includes:

judging whether the current viewpoint number is larger than the current viewpoint number after rounding; if yes, adjusting the number to be the first viewpoint number, the final viewpoint number or the intermediate viewpoint number, and then performing sub-pixel filling by using the step 03; if not, sub-pixel filling is performed by using step 03 according to the rounding number.

Technical Field

The invention belongs to the technical field of naked eye 3D display, and particularly relates to a matching weighting-based method for filling a twill grating stereoscopic original image.

Background

In the field of 3D displays, it is now necessary to trade off market potential from reducing instrument costs to reducing selling prices due to the fact that foreign instruments are expensive, resulting in a smaller market demand. At present, the display is still in the initial stage in China, and although a certain scale of naked eye 3D displays are developed by a plurality of manufacturers, the effect of the display does not reach the foreign level.

The naked eye 3D display based on the lenticular lens is characterized in that the lenticular lens is assembled on a display plane of the naked eye 3D display, good 3D impression can be obtained without wearing peripheral equipment, and the naked eye 3D display is more suitable for the current market demand. The principle of the naked eye 3D display based on the lenticular grating is that the human brain generates 3D stereoscopic impression according to the binocular parallax principle and by means of the unique separation and amplification properties of the lenticular grating to light; diagonal lenticular lenses are used to balance horizontal parallax with vertical parallax, thereby alleviating the glare of the viewer when viewing a naked eye 3D display.

However, in the stereoscopic original image required for making a glasses-free 3D display based on a twill lenticular grating, a fractional viewpoint may be obtained after parameters of the twill lenticular grating are substituted into a sub-pixel mapping formula due to the tilt characteristic limitation of the twill grating. The fractional view point means that one sub-pixel is mapped to different view points, so that the formed image is blurred and ghosted, the crosstalk degree is deepened, and the edge details of the formed image are mostly lost due to the fact that the fractional sub-pixel is wrongly mapped, and the naked eye 3D display effect is not satisfactory.

Therefore, the detail processing is of great importance in order to obtain a good stereoscopic impression.

Disclosure of Invention

Aiming at the defects or improvement requirements in the prior art, the invention provides a matching weighting-based twill grating stereoscopic original image filling method, and aims to solve the problem that the display effect is influenced due to the loss of image forming edge details caused by the existence of fractional sub-pixels in the conventional naked eye 3D display original image.

In order to achieve the above object, the present invention provides a matching weighting-based filling method for a twill grating stereoscopic original image, which comprises:

s1, sequentially numbering initial viewpoint images to be sampled;

s2, substituting equipment parameters for displaying the stereoscopic original image into a sub-pixel viewpoint mapping formula to obtain a viewpoint number corresponding to each sub-pixel in the stereoscopic original image to be filled;

s3, the following steps are executed on the view numbers corresponding to the sub-pixels in the three-dimensional original image to be filled row by row, so as to obtain the completely filled three-dimensional original image:

01. reading a view point number corresponding to the current sub-pixel and a position (l, k) of the current sub-pixel in the stereoscopic original image;

02. if the viewpoint number is a non-zero integer, then go to step 03; if the viewpoint number is 0, adjusting the viewpoint number to be an integer according to the number of the viewpoint numbers, and turning to step 03; if the viewpoint number is a score, turning to step 04;

03. selecting the initial viewpoint image with the corresponding number in the step S1, and filling the current sub-pixel position in the stereoscopic original image with the sub-pixel at the (l, k) position in the image;

04. judging whether the whole pixel where the current sub-pixel is located and the peripheral whole pixel are in the same object; if so, performing reverse distance weighted filling on the current sub-pixel; if not, the nearest rounding is carried out on the current viewpoint number, and the sub-pixel filling is carried out by using the step 03.

Further, step S1 is specifically to number the initial viewpoint images to be sampled in order from the rightmost viewpoint and ending at the leftmost viewpoint.

Further, in step S2, determining whether to perform reverse stereoscopic processing according to the number sequence, where the view number corresponding to each sub-pixel in the stereoscopic original image to be filled in is specifically:

if the serial number is from the leftmost view to the rightmost view, the reverse stereoscopic view processing is required; otherwise, no processing is required.

Further, in step 02, if the viewpoint number is 0, the number of viewpoints is adjusted to be an integer according to the number of viewpoints, specifically, to be a first viewpoint number, a final viewpoint number, or a central viewpoint number.

Further, the step 04 of determining whether the full pixel where the current sub-pixel is located and the peripheral full pixel are located in the same object specifically includes:

obtaining a left adjacent viewpoint number Nmin and a right adjacent viewpoint number Nmax of the current sub-pixel according to the fraction value of the current viewpoint number; wherein, the adjacent viewpoint number corresponds to the initial viewpoint image number in step S1;

respectively reading the rgb color gamut of the full pixel where the sub-pixel at the (l, k) position of the image corresponding to the left adjacent viewpoint number Nmin and the right adjacent viewpoint number Nmax;

calculating color difference for the two rgb color gamut values read; if the color difference is smaller than the set threshold, determining that the full pixel where the current sub-pixel is located and the peripheral full pixel are located in the same object; and if the color difference is larger than the set threshold value, judging that the objects are not the same.

Further, the step 04 of performing inverse distance weighted filling on the current sub-pixel specifically includes:

calculating the distance difference between the view point number of the current sub-pixel and Nmax and Nmin to obtain a first difference value wm and a second difference value wn; wherein wm is Nmax-N, wn is N-Nmin;

and taking the sum of the product of the corresponding sub-pixel values in the original image to be sampled of the wm viewpoint and the Nmin viewpoint and the product of the corresponding sub-pixel values in the original image to be sampled of the Nmax viewpoint as the pixel value of the corresponding sub-pixel of the stereo original image.

Further, the nearest rounding of the current viewpoint number in step 04 and the sub-pixel filling in step 03 specifically include:

judging whether the current viewpoint number is larger than the current viewpoint number after rounding; if yes, adjusting the number to be the first viewpoint number, the final viewpoint number or the intermediate viewpoint number, and then performing sub-pixel filling by using the step 03; if not, sub-pixel filling is performed by using step 03 according to the rounding number.

Generally, compared with the prior art, the technical scheme of the invention can obtain the following beneficial effects:

the method improves the filling of the fractional sub-pixels in the synthesis process of the stereoscopic original image, specifically, judges the relationship between the full-pixel object of the sub-pixels at the fractional viewpoint image number and the object of the adjacent viewpoint pixels through pixel matching, and further selects and uses inverse distance weighted filling or a method of rounding nearby to obtain the value of the sub-pixels.

Drawings

Fig. 1 is a flow chart of a matching weighting-based twill grating stereoscopic original image filling method provided by the invention;

FIG. 2 is a schematic diagram of fractional sub-pixel mapping provided by the present invention;

FIG. 3 is a schematic diagram illustrating sub-pixel color difference determination provided by the present invention;

FIG. 4 is a schematic view of the reverse sub-pixel distance filling provided by the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. In addition, the technical features involved in the embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.

Referring to fig. 1, the method for filling a twill grating stereoscopic original image based on matching weighting provided by the present invention includes:

s1, sequentially numbering initial viewpoint images to be sampled;

in order to better conform to the vision habit of human eyes, the embodiment of the invention numbers the initial viewpoint images to be sampled according to the sequence from the rightmost viewpoint to the leftmost viewpoint.

S2, substituting equipment parameters for displaying the stereoscopic original image into a sub-pixel viewpoint mapping formula to obtain a viewpoint number corresponding to each sub-pixel in the stereoscopic original image to be filled;

the viewpoint number should determine whether to perform the reverse stereoscopic processing according to the number order: if the numbering starts from the leftmost view to the rightmost view, the reverse stereoscopic processing is required. If the number is numbered from the rightmost view to the leftmost view, the reverse stereoscopic processing is not required. The presence of this process can make the viewer's stereoscopic impression conform to the actual target impression, otherwise the image of the right end of the object will be seen at the left end and the image of the left end of the object will be seen at the right end.

S3, the following steps are executed on the view numbers corresponding to the sub-pixels in the three-dimensional original image to be filled row by row, so as to obtain the completely filled three-dimensional original image:

01. reading a view point number corresponding to the current sub-pixel and a position (l, k) of the current sub-pixel in the stereoscopic original image;

02. if the viewpoint number is a non-zero integer, then go to step 03; if the viewpoint number is 0, adjusting the viewpoint number to be an integer according to the number of the viewpoint numbers, generally to be a first viewpoint number, a final viewpoint number or a center viewpoint number, and turning to step 03; if the viewpoint number is the score as shown in fig. 2, go to step 04; the scores shown in fig. 2 are only examples, and the exact acquisition of the viewpoint number N depends on the sub-pixel mapping formula.

03. Selecting the initial viewpoint image with the corresponding number in the step S1, and filling the current sub-pixel position in the stereoscopic original image with the sub-pixel at the (l, k) position in the image; if the stereoscopic original image is traversed to the (l, k) sub-pixel position of the stereoscopic original image, and the view number corresponding to the position is N, reading the initial view image corresponding to the number N in the step S1, reading the sub-pixel value at the position of the initial view image (l, k), and then filling the sub-pixel value at the position of the initial view image (l, k) into the (l, k) sub-pixel position of the stereoscopic original image;

04. judging whether the whole pixel where the current sub-pixel is located and the peripheral whole pixel are in the same object; if so, performing reverse distance weighted filling on the current sub-pixel; if not, the nearest rounding is carried out on the current viewpoint number, and the sub-pixel filling is carried out by using the step 03. As shown in fig. 3, the pixels aligned by the left and right "+" are not in the same object, and the criterion for determining that the pixels are not in the same object is that the color difference exceeds a certain threshold.

Wherein, judge whether the full pixel that present subpixel place and peripheral full pixel are in same object, specifically include: obtaining a left adjacent viewpoint number Nmin and a right adjacent viewpoint number Nmax of the current sub-pixel according to the fraction value of the current viewpoint number; wherein, the adjacent viewpoint number corresponds to the initial viewpoint image number in step S1; respectively reading the rgb color gamut of the full pixel where the sub-pixel at the (l, k) position of the image corresponding to the left adjacent viewpoint number Nmin and the right adjacent viewpoint number Nmax; calculating color difference for the two rgb color gamut values read; if the color difference is smaller than the set threshold, determining that the full pixel where the current sub-pixel is located and the peripheral full pixel are located in the same object; and if the color difference is larger than the set threshold value, judging that the objects are not the same. The threshold is set according to the type of the image, the fact that the image is located in the same object means that the parallax is small, and the image is not located in the same object, the parallax is large, the threshold is selected according to the criterion that the image needs to be in a state of being small in parallax when the method of reverse distance weighting is used, wrong weighting filling can be generated when the method of reverse distance weighting is used when the parallax is large, and therefore the threshold is generally a certain value in the parallax range of the image.

Performing inverse distance weighted filling on the current sub-pixel, specifically comprising: calculating the distance difference between the view point number of the current sub-pixel and Nmax and Nmin to obtain a first difference value wm and a second difference value wn; wherein wm is Nmax-N, wn is N-Nmin; filling corresponding sub-pixels according to an inverse distance weighting principle, namely taking the sum of the product of wm serving as a weighting factor and a corresponding sub-pixel value in an original image to be sampled of an Nmin viewpoint and the product of wn serving as a weighting factor and a corresponding sub-pixel value in an original image to be sampled of an Nmax viewpoint as a pixel value of the corresponding sub-pixel of the stereoscopic original image; as shown in fig. 4, if N obtained by the R sub-pixels in a certain full pixel is 1.2, selecting the original image to be sampled of the first viewpoint and the second original viewpoint image to perform inverse distance weighted filling, that is, taking the sum of the product of 2-N as a weighting factor and the corresponding sub-pixel value in the original image to be sampled of the first viewpoint and the sum of N-1 as a weighting factor and the product of the corresponding sub-pixel value in the original image to be sampled of the second viewpoint as the pixel value of the corresponding sub-pixel of the stereoscopic original image; the remaining subpixels and so on.

Performing nearest neighbor rounding on the current viewpoint number, and performing sub-pixel filling by using step 03, specifically including: judging whether the current viewpoint number is out of the range of the current viewpoint number after being rounded; if yes, adjusting the number to be the first viewpoint number, the final viewpoint number or the intermediate viewpoint number, and then performing sub-pixel filling by using the step 03; if not, sub-pixel filling is performed by using step 03 according to the rounding number.

The method of the present invention is different from the currently known filling method of the stereoscopic original image in that the existing filling method of the stereoscopic original image mostly processes the viewpoint number obtained from the sub-pixel mapping formula by rounding up or rounding down, if the viewpoint number is obtained to be 4.7, rounding up to 5 will cause the error of the viewpoint number 4, rounding down to 4 will cause the error of the viewpoint number 5. The method judges the viewpoint number obtained from the sub-pixel mapping formula, and performs inverse distance weighted filling or nearest rounding filling on the corresponding sub-pixel position of the stereoscopic original image by combining the judgment of whether the viewpoint number is in the same object or not.

The reason for the benefits of the method of the invention over the prior art is analyzed as follows:

firstly, compared with the original method, the method fills the sub-pixels positioned at the number of the fractional viewpoint image through an inverse distance weighting processing step in the synthesis process of the stereoscopic original image, so that the obtained sub-pixels positioned at the number of the fractional viewpoint image actually contain the information of the sub-pixels adjacent to the fractional viewpoint image, namely interpolation is carried out, the continuity of sub-pixel change is enhanced, the defect that the image observation roughness caused by the fact that the corresponding sub-pixels are obtained through rounding in the original method can be improved, the image observation fineness is improved, and the image display is more real. By comparing the direct observation with the original method, the display effect of the stereoscopic original image generated by the method under the twill grating can be seen, the roughness of the image is obviously improved, and the image is finer and smoother.

Secondly, the method of the invention utilizes the pixel matching processing step to select the sub-pixel filling method in the process of synthesizing the stereo original image, and obtains the value of the sub-pixel positioned in the fractional viewpoint image number. Whether an object to which a full pixel of a sub-pixel located at the number of the fractional viewpoint image belongs is consistent with an object to which an adjacent viewpoint pixel belongs is judged through pixel matching, and then a method of reverse distance weighted filling or rounding is selected to obtain a value of the sub-pixel, so that when the sub-pixels do not belong to the same object, a crosstalk phenomenon caused by the fact that the sub-pixels are filled through reverse distance weighted filling can be avoided, and a false 3D effect caused by excessive crosstalk when the parallax is small is reduced. The direct observation is compared with the original method, the display effect of the stereoscopic original image generated by the method under the twill grating can be seen, the displayed roughness is obviously improved, the crosstalk phenomenon is inhibited while the image is finer, and the false 3D effect caused by too much crosstalk when the parallax is smaller is reduced.

It will be understood by those skilled in the art that the foregoing is only a preferred embodiment of the present invention, and is not intended to limit the invention, and that any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the scope of the present invention.

10页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:机顶盒测试方法、装置、机顶盒及计算机可读存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类