CN103093416B - A kind of real time field depth analogy method of graphic based processor fuzzy partition - Google Patents

A kind of real time field depth analogy method of graphic based processor fuzzy partition Download PDF

Info

Publication number
CN103093416B
CN103093416B CN201310031589.7A CN201310031589A CN103093416B CN 103093416 B CN103093416 B CN 103093416B CN 201310031589 A CN201310031589 A CN 201310031589A CN 103093416 B CN103093416 B CN 103093416B
Authority
CN
China
Prior art keywords
image
depth
process unit
gpu
graphic
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201310031589.7A
Other languages
Chinese (zh)
Other versions
CN103093416A (en
Inventor
盛志明
余刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Sobey Digital Technology Co Ltd
Original Assignee
Chengdu Sobey Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu Sobey Digital Technology Co Ltd filed Critical Chengdu Sobey Digital Technology Co Ltd
Priority to CN201310031589.7A priority Critical patent/CN103093416B/en
Publication of CN103093416A publication Critical patent/CN103093416A/en
Application granted granted Critical
Publication of CN103093416B publication Critical patent/CN103093416B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a kind of real time field depth analogy method of graphic based processor fuzzy partition, comprise the following steps: pending image is converted to the accessible document form of GPU by (1); (2) customizing messages of image is processed; (3) according to the customizing messages of image, fuzzy partition process is carried out to image, decide image according to customizing messages and adopt different blur radius in zones of different, thus simulate Deep Canvas.The present invention makes full use of concurrency and the programmability of GPU, when playing up, scene is saved as texture, a large amount of algebraic operation is transferred to GPU from CPU, not only releases CPU, and decreases the traffic of CPU and GPU, substantially increases the speed of depth of field simulation; Fuzzy partition algorithm, directly to former figure process, eliminates the step that traditional algorithm fuzzy graph and former figure merge, and further increases the degree of accuracy of depth of field simulation; The more clear exquisiteness of image, closer to the Deep Canvas figure of real camera shooting, is applicable to virtual reality system.

Description

A kind of real time field depth analogy method of graphic based processor fuzzy partition
Technical field
The present invention relates to a kind of real time field depth analogy method of graphic based processor fuzzy partition.
Background technology
The depth of field refers to before camera lens or other imagers along the object distance scope that the Depth of field phase machine axis that can obtain picture rich in detail measures.After focusing completes, can be formed in the scope before and after focus clearly as, this tandem distance range, is just called the depth of field.Have the space of one section of certain length in camera lens front (focusing point forward and backward), when subject is positioned at this section of space, its imaging on egative film is just before and after focus between these two blur circles.The length in this section of space at subject place, is just the depth of field.In other words, the subject in this section of space, it is presented on the image fog degree in egative film face, and all in the limited range of allowing blur circle, the length in this section of space is exactly the depth of field.
The depth of field is the key character of imaging in human visual system.When human eye is to real world imaging, automatically focus to adapt to different viewing distances, the object of eye gaze is just on focussing plane (focusplane), and therefore, blur-free imaging is in retina; And the object be in outside focussing plane, imaging is just smudgy.Focal length, the diameter of lens (pupil), and fog-level when object distance determines image objects jointly.Like this, the whole scene adding Deep Canvas then seems truly, nature, and can obtain by the depth of field with depth cueing.Contribute to the synthesis of stereoscopic photograph and alleviate the eye fatigue often had in virtual reality system, the sense of reality of enhanced scene, feeling of immersion.
In recent years, in field of Computer Graphics, occurred many algorithm researches played up about the depth of field, these algorithms are mainly classified as following three classes:
A) post processing and filtering: its algorithm adopts standard pin hole camera model render scenes, and exports the depth value z of each pixel; According to depth value z, aperture, focal length etc., each sampled point is converted to the circle of confusion (CoC) of different size, intensity distributions; The end value of each pixel is determined by the weighted mean value of all circles of confusion covering it.Potmesil have employed Lommel intensity distribution function calculation level to the impact of surrounding pixel; Chen also uses similar method and carrys out calculating strength distribution; The people such as Zhou Qiang have employed mean filter and obtain blurred picture, then merge with picture rich in detail, simulate Deep Canvas in real time.The algorithm of Potmesil and Chen is all adopt software simulating, and computing is born by CPU entirely, and working time is longer, is difficult to the requirement meeting the high real-times such as virtual reality.Rokita proposes to use special digital hardware wave filter to accelerate the generation of DoF effect, it adopts repeatedly Gaussian convolution filtering to be fused in surrounding pixel by pixel value, reach fuzzy effect, owing to have employed convolutional filtering technology, cause the intensity seepage of pixel, cause the fuzzy objective mixed fuzzy etc. of object on front and back scenery body mixed fuzzy, focusing surface and prospect or background.Though the algorithm of the people such as Zhou Qiang meets real-time, mean filter can cause intensity seepage, and does not consider the pixel in the circle of confusion when merging, and precision is not high.
B) repeatedly play up: it adopts pinhole camera model, by fine changing projection centre at every turn, and keep focusing surface constant, then rendering result accumulation is preserved, finally just obtain the image graph that a width has Deep Canvas.But the Deep Canvas ghost image repeatedly playing up gained is heavier, lack the sense of reality.
C) retrodirected ray is followed the tracks of: this type of algorithm is only limitted to geometric scene, and adopts true lens model, and therefore, speed is difficult to the requirement meeting virtual reality system.
At present, a lot of algorithm needs a large amount of calculating or lacks precision, and a large amount of algebraic operations of traditional depth of field algorithm complete by CPU, greatly limit the speed of depth of field simulation; In addition, the step that traditional fuzzy partition algorithm needs the fuzzy graph carried out to mix with former figure, reduces the degree of accuracy of depth of field simulation.
Summary of the invention
The object of the invention is to overcome the deficiencies in the prior art, a kind of real time field depth analogy method of novel graphic based processor fuzzy partition is provided, utilize concurrency and the programmability of GPU, a large amount of algebraic operation is transferred to GPU from CPU, not only release CPU, and decrease the traffic of CPU and GPU, substantially increase the speed of depth of field simulation; Meanwhile, fuzzy partition algorithm, directly to former figure process, eliminates the step that traditional algorithm needs the fuzzy graph carried out to mix with former figure, further increases the degree of accuracy of depth of field simulation.
The object of the invention is to be achieved through the following technical solutions: a kind of real time field depth analogy method of graphic based processor fuzzy partition, it comprises the following steps:
S1: pending image is converted to the manageable document form of graphic process unit GPU, a large amount of algebraic operation is transferred to graphic process unit GPU from central processor CPU by the concurrency and the programmability that make full use of graphic process unit GPU;
S2: the customizing messages of image is processed;
S3: the customizing messages according to image carries out fuzzy partition process to image, decides image according to customizing messages and adopts different blur radius in zones of different, thus simulate Deep Canvas.
For horizontal blur, fuzzy method adopts present picture element point to mix with two picture elements near its right and left, if get two picture elements from present picture element more close to, then fog-level is less, and picture is more clear; Otherwise then fog-level is larger, picture is fuzzyyer.Therefore, blur effect in various degree can be realized by the distance controlling the right and left picture element in ambiguity function.
A kind of method pending image being converted to the manageable document form of graphic process unit GPU is: pending image is converted to the manageable data texturing of graphic process unit GPU.
Further, the step pending image being converted to the manageable data texturing of graphic process unit GPU is: pending image is converted to the manageable data texturing of graphic process unit GPU by the function " D3DX11CreateTextureFromFile " using DirectX to provide.
The another kind of method pending image being converted to the manageable document form of graphic process unit GPU comprises the following steps:
A: pending image is read in internal memory;
B: the function provided with OpenGL or DirectX by the data uplink in internal memory in graphic process unit GPU.
Described customizing messages comprises the depth information (being called for short: Z information) of image.
Further, the step processed the depth information of image comprises following two aspects:
(1) for three-dimensional scenic, the depth information of image is directly used;
(2) for two-dimensional scene, by processing two-dimensional scene, its depth information is obtained.
Further, carry out processing the step obtaining its depth information to two-dimensional scene to comprise: rotate with image vertical center axis Y-axis two-dimensional scene, after rotation, the depth value corresponding with rotating front two-dimensional scene except the depth value that the pixel value on image vertical center axis is corresponding is identical, and the depth value that all front with the rotation two-dimensional scene of other value is corresponding is identical.The Z value that when supposing non rotating, two-dimensional scene is corresponding is 0, and after so rotating, except the Z value that the pixel value on image vertical center axis is corresponding is except 0, other value is not 0.
For two-dimensional scene, not necessarily to use Z information, also manually blur radius can be set.According to the different demands of user, various different Deep Canvas can be realized.Such as: in scene, draw a circle, the blur radius in regulation circle is 0, and the outer blur radius of circle linearly strengthens, and just can occur that in circle, picture is clear, and from round more away from the fuzzyyer Deep Canvas of image.
The invention has the beneficial effects as follows:
1) making full use of concurrency and the programmability of GPU, when playing up, scene being saved as texture, a large amount of algebraic operation is transferred to GPU from CPU, not only releases CPU, and decrease the traffic of CPU and GPU, substantially increase the speed of depth of field simulation;
2) the fuzzy partition algorithm of designed, designed is directly to former figure process, eliminates fuzzy graph that traditional algorithm needs to carry out and the step that former figure merges, further increases the degree of accuracy of depth of field simulation;
3) the more clear exquisiteness of image, closer to the Deep Canvas figure of real camera shooting, is applicable to virtual reality system.
Accompanying drawing explanation
Fig. 1 is real time field depth analogy method process flow diagram of the present invention;
Fig. 2 is the figure of weight shared by surrounding pixel after Blur function.
Embodiment
Below in conjunction with accompanying drawing, technical scheme of the present invention is described in further detail, but protection scope of the present invention is not limited to the following stated.
As shown in Figure 1, a kind of real time field depth analogy method of graphic based processor fuzzy partition, it comprises the following steps:
S1: pending image is converted to the manageable document form of graphic process unit GPU, a large amount of algebraic operation is transferred to graphic process unit GPU from central processor CPU by the concurrency and the programmability that make full use of graphic process unit GPU;
A kind of method pending image being converted to the manageable document form of graphic process unit GPU is: pending image is converted to the manageable data texturing of graphic process unit GPU.
Further, the step pending image being converted to the manageable data texturing of graphic process unit GPU is: pending image is converted to the manageable data texturing of graphic process unit GPU by the function " D3DX11CreateTextureFromFile " using DirectX to provide.
The another kind of method pending image being converted to the manageable document form of graphic process unit GPU comprises the following steps:
A: pending image is read in internal memory;
B: the function provided with OpenGL or DirectX by the data uplink in internal memory in graphic process unit GPU.
S2: the customizing messages of image is processed;
Customizing messages comprises the depth information (being called for short: Z information) of image, further, comprises following two aspects to the step that the Z information of image processes:
(1) for three-dimensional scenic, the depth information of image is directly used;
(2) for two-dimensional scene, by processing two-dimensional scene, its depth information is obtained.
Further, carry out processing the step obtaining its depth information to two-dimensional scene to comprise: rotate with image vertical center axis Y-axis two-dimensional scene, after rotation, the depth value corresponding with rotating front two-dimensional scene except the depth value that the pixel value on image vertical center axis is corresponding is identical, and the depth value that all front with the rotation two-dimensional scene of other value is corresponding is identical.The Z value that when supposing non rotating, two-dimensional scene is corresponding is 0, and after so rotating, except the Z value that the pixel value on image vertical center axis is corresponding is except 0, other value is not 0.
For two-dimensional scene, not necessarily to use Z information, also manually blur radius can be set.According to the different demands of user, various different Deep Canvas can be realized.Such as: in scene, draw a circle, the blur radius in regulation circle is 0, and the outer blur radius of circle linearly strengthens, and just can occur that in circle, picture is clear, and from round more away from the fuzzyyer Deep Canvas of image.
S3: the customizing messages according to image carries out fuzzy partition process to image, decides image according to customizing messages and adopts different blur radius in zones of different, thus simulate Deep Canvas.
For horizontal blur, fuzzy method adopts present picture element point to mix with two picture elements near its right and left, if get two picture elements from present picture element more close to, then fog-level is less, and picture is more clear; Otherwise then fog-level is larger, picture is fuzzyyer.Therefore, blur effect in various degree can be realized by the distance controlling the right and left picture element in ambiguity function.
This fuzzy partition Processing Algorithm is applicable to GPU, and image blurring degree is that the number of times by doing ambiguity function decides, and the blur radius of each ambiguity function is different, as shown in Figure 2, gives the figure of weight shared by surrounding pixel after Blur function.
The number of times of ambiguity function can calculate with log (1.f+nBlurRadius)/log (2.f), can ensure like this: what process when crossing last ambiguity function is nearest two points of this pixel.
1:floattxSize[2]={nBlurRadius/width,nBlurRaidus/height};
2:intnPassCount=log(1.f+nBlurRadius)/log(2.f);
3:for(i=0;i<nPassCount;i++)
4:{
5:txSize*=pow(0.5f,i);
6:oColor=0.5f*tex2D(samColor,vTex);
7:oColor+=0.25f*tex2D(samColor,vTex+txSize);
8:oColor+=0.25f*tex2D(samColor,vTex–txSize);
9:}
With the focal length set point as initial point, blur radius is increasing, and namely out of focus is apart from putting place far away, and fog-level is higher.Add one after only needing the 5th row of the false code above and can realize fuzzy partition according to Z information.
txSize=(fFocus+vPoint.z)*txSize;
Wherein, vPoint.z represents the Z information of current point.

Claims (4)

1. a real time field depth analogy method for graphic based processor fuzzy partition, is characterized in that: it comprises the following steps:
S1: pending image is converted to the manageable document form of graphic process unit GPU, a large amount of algebraic operation is transferred to graphic process unit GPU from central processor CPU by the concurrency and the programmability that make full use of graphic process unit GPU, not only release CPU, and decrease the traffic of CPU and GPU, substantially increase the speed of depth of field simulation;
S2: the customizing messages of image is processed;
S3: the customizing messages according to image carries out fuzzy partition process to image, decides image according to customizing messages and adopts different blur radius in zones of different, thus simulate Deep Canvas;
Described customizing messages comprises the depth information of image, comprises following two aspects to the step that the depth information of image processes:
(1) for three-dimensional scenic, the depth information of image is directly used;
(2) for two-dimensional scene, by processing two-dimensional scene, its depth information is obtained;
Described two-dimensional scene is carried out processing the step obtaining its depth information comprise: two-dimensional scene is rotated with image vertical center axis Y-axis, after rotation, the depth value corresponding with rotating front two-dimensional scene except the depth value that the pixel value on image vertical center axis is corresponding is identical, and the depth value that all front with the rotation two-dimensional scene of other value is corresponding is identical;
The real time field depth analogy method of graphic based processor fuzzy partition, directly to former figure process, eliminates fuzzy graph that traditional algorithm needs to carry out and the step that former figure merges, further increases the degree of accuracy of depth of field simulation.
2. the real time field depth analogy method of a kind of graphic based processor fuzzy partition according to claim 1, is characterized in that: the described method pending image being converted to the manageable document form of graphic process unit GPU is: pending image is converted to the manageable data texturing of graphic process unit GPU.
3. the real time field depth analogy method of a kind of graphic based processor fuzzy partition according to claim 2, is characterized in that: the described step pending image being converted to the manageable data texturing of graphic process unit GPU is: pending image is converted to the manageable data texturing of graphic process unit GPU by the function " D3DX11CreateTextureFromFile " using DirectX to provide.
4. the real time field depth analogy method of a kind of graphic based processor fuzzy partition according to claim 1, is characterized in that: the described method pending image being converted to the manageable document form of graphic process unit GPU comprises the following steps:
A: pending image is read in internal memory;
B: the function provided with OpenGL or DirectX by the data uplink in internal memory in graphic process unit GPU.
CN201310031589.7A 2013-01-28 2013-01-28 A kind of real time field depth analogy method of graphic based processor fuzzy partition Active CN103093416B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310031589.7A CN103093416B (en) 2013-01-28 2013-01-28 A kind of real time field depth analogy method of graphic based processor fuzzy partition

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310031589.7A CN103093416B (en) 2013-01-28 2013-01-28 A kind of real time field depth analogy method of graphic based processor fuzzy partition

Publications (2)

Publication Number Publication Date
CN103093416A CN103093416A (en) 2013-05-08
CN103093416B true CN103093416B (en) 2015-11-25

Family

ID=48205952

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310031589.7A Active CN103093416B (en) 2013-01-28 2013-01-28 A kind of real time field depth analogy method of graphic based processor fuzzy partition

Country Status (1)

Country Link
CN (1) CN103093416B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105139356B (en) * 2015-08-25 2018-06-22 北京锤子数码科技有限公司 The frosted glass effect processing method and device of a kind of image data
CN106558089B (en) * 2015-09-21 2019-11-01 展讯通信(上海)有限公司 Image depth method for drafting and device
WO2018010677A1 (en) * 2016-07-14 2018-01-18 腾讯科技(深圳)有限公司 Information processing method, wearable electric device, processing apparatus, and system
CN106101685B (en) * 2016-07-14 2018-06-19 腾讯科技(深圳)有限公司 A kind of information processing method, wearable electronic equipment, processing unit and system
CN109901710B (en) * 2016-10-19 2020-12-01 腾讯科技(深圳)有限公司 Media file processing method and device, storage medium and terminal

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1742294A (en) * 2003-01-25 2006-03-01 螺旋划痕有限公司 Methods and apparatus for making images including depth information
CN102254340A (en) * 2011-07-29 2011-11-23 北京麒麟网信息科技有限公司 Method and system for drawing ambient occlusion images based on GPU (graphic processing unit) acceleration

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8300083B2 (en) * 2007-07-20 2012-10-30 Hewlett-Packard Development Company, L.P. Position relationships associated with image capturing devices

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1742294A (en) * 2003-01-25 2006-03-01 螺旋划痕有限公司 Methods and apparatus for making images including depth information
CN102254340A (en) * 2011-07-29 2011-11-23 北京麒麟网信息科技有限公司 Method and system for drawing ambient occlusion images based on GPU (graphic processing unit) acceleration

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
真实感三维场景中实时渲染特效的研究与实现;张毓茜;《中国优秀硕士学位论文全文数据库信息科技辑》;20130115(第1期);正文第44页第1段-第53页最后1段 *

Also Published As

Publication number Publication date
CN103093416A (en) 2013-05-08

Similar Documents

Publication Publication Date Title
CN112639664B (en) Method and device for determining and/or evaluating a positioning map of an image display device
CN102768765B (en) Real-time soft shadow rendering method for point light sources
CN103093416B (en) A kind of real time field depth analogy method of graphic based processor fuzzy partition
JP2017174125A (en) Information processing apparatus, information processing system, and information processing method
JP2010033296A (en) Program, information storage medium, and image generation system
WO2022205762A1 (en) Three-dimensional human body reconstruction method and apparatus, device, and storage medium
CN107038745B (en) 3D tourist landscape roaming interaction method and device
KR20220051376A (en) 3D Data Generation in Messaging Systems
CN108043027B (en) Storage medium, electronic device, game screen display method and device
US20140009503A1 (en) Systems and Methods for Tracking User Postures to Control Display of Panoramas
CN104050708A (en) 3D game engine LOD system achievement method
Lee et al. Real-time tracking of visually attended objects in virtual environments and its application to LOD
WO2014008320A1 (en) Systems and methods for capture and display of flex-focus panoramas
Yuan et al. Neural radiance fields from sparse RGB-D images for high-quality view synthesis
KR20200024946A (en) How to render a spherical light field in all directions
Hong et al. Towards 3D television through fusion of kinect and integral-imaging concepts
Liu et al. Bokeh effects based on stereo vision
JP2018206391A (en) Method and apparatus for inciting viewer to rotate toward reference direction when consuming immersive content item
US11288774B2 (en) Image processing method and apparatus, storage medium, and electronic apparatus
Liu et al. Stereo-based bokeh effects for photography
US20230152883A1 (en) Scene processing for holographic displays
CN108416255B (en) System and method for capturing real-time facial expression animation of character based on three-dimensional animation
US20220076482A1 (en) Ray-tracing for auto exposure
Lindeberg Concealing rendering simplifications using gazecontingent depth of field
WO2016058288A1 (en) Depth-of-field rendering method and apparatus

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant