CN104200513A - Matrix row-column sampling based multi-light-source rendering method - Google Patents
Matrix row-column sampling based multi-light-source rendering method Download PDFInfo
- Publication number
- CN104200513A CN104200513A CN201410390703.XA CN201410390703A CN104200513A CN 104200513 A CN104200513 A CN 104200513A CN 201410390703 A CN201410390703 A CN 201410390703A CN 104200513 A CN104200513 A CN 104200513A
- Authority
- CN
- China
- Prior art keywords
- matrix
- bunch
- row
- illumination
- sampling
- 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.)
- Pending
Links
Landscapes
- Image Generation (AREA)
Abstract
The invention discloses a matrix row-column sampling based multi-light-source rendering method. The matrix row-column sampling based multi-light-source rendering method comprises step 1, establishing an illumination matrix according to scenes, wherein in the illumination matrix, every column shows sampling points irradiated by one light source and every row shows one sampling point irradiated by all light sources; step 2, random drawing a plurality of rows from a multi-light-source matrix to form into a reduced matrix; step 3, clustering the reduced matrix and rendering the clusters; step 4, merging the clusters, obtaining a sum of illumination intensity of the rows of an original illumination matrix and forming into rendering. The matrix row-column sampling based multi-light-source rendering method has the advantages of improving the rendering efficiency, greatly reducing internal storage costs, meanwhile improving the rendering instantaneity and being applicable to scenes having instantaneity and high-quality requirements for rendering due to the fact that multi-light-source rendering under complex scenes is transferred to the matrix row-column sampling and the matrix is partitioned.
Description
Technical field
The present invention figure field that designs a calculating machine, relate in particular to a kind of based on matrix ranks sampling carry out the method that multiple light courcess is played up.
Background technology
To thering is indirect light photograph, high dynamic range ambient lighting, and the complex scene with a plurality of direct light sources to play up be a very challenging job.Research shows, this class problem can achieve a solution by being converted into multiple light courcess problem, and all light sources can be converted to the set of pointolite, thereby the problem of playing up of indirect light photograph is changed into a multi-point source problem.It is obviously very difficult using thousands of pointolites directly to play up.Lightcuts framework provides a kind of extendible method to solve multi-point source problem, utilizes visibility culling algorithm can within a few minutes, complete calculating by the ray tracing device based on CPU.
In actual applications, there is relative position relation in light source and irradiated object, need to play up for the position relationship of light source and object.Under interaction scenarios, in film or structured design process, need the relative position of timely response light source and object to change, carry out real-time rendering, this can bring great operand.Existing method is to solve this problem by pre-service, for various position relationships, completes and plays up in advance, in the mutual stage, directly reads rendering result.Calculating total amount, divide like this.But this method has two significant deficiency: 1, take a large amount of memory preprocessed datas.2, make scene in this way, only have light source or the object unilaterally can be movable.This has limited the range of application of the method greatly.
GPU is as the hardware of special disposal image, and inside has acceleration capacity, comprises Shadow Mapping algorithm and tinter etc.For calculating to provide to calculate, graph rendering accelerates and parallel processing capability.Use GPU to play up processing, can effectively reduce CPU expense, promote and play up counting yield and effect simultaneously.
Summary of the invention
The invention discloses a kind of method of playing up based on matrix ranks sampling acceleration multiple light courcess, the multiple light courcess under complex scene is played up to problem and be converted into matrix ranks Sampling.
Based on matrix ranks, the method that multiple light courcess is played up is carried out in sampling, comprises the steps:
Step 1, sets up illumination matrix according to scene, and in described illumination matrix, all sampled points that a light source irradiates, the sampled point that all light sources of each line display all irradiate are shown in each list;
Step 2, randomly draws several rows from multiple light courcess matrix, forms condensation matrix;
Step 3, by condensation matrix sub-clustering, plays up each bunch;
Step 4, by each bunch of merging, obtains the intensity of illumination sum of original each row of illumination matrix, completes and plays up.
In described illumination matrix, if sampled point i is sightless for light source j, elements A
ijvalue is 0.According to multiple light courcess scene, build matrix, multiple light courcess illumination Sampling is converted into matrix ranks Sampling.Light source and sampled point are carried out to bulk treatment, can effectively divide integral body and play up processing expenditure.According to light characteristics, matrix A has sparse property.Utilize the low-rank of matrix A, therefrom random r * n defined matrix of selecting row to form is R, and matrix R is a down-scaled version of complete image matrix, is called condensation matrix.When r is enough large, reduction row just can comprise the enough information of complete copy.Be all information that comprise complete matrix A in condensation matrix R, can recover complete matrix A by R.
For convenient, calculate, optional, in described illumination matrix, each element is RGB scalar, and in step 2, each element of condensation matrix is converted to the 2-norm of using RGB tlv triple.
By matrix A being divided into a plurality of parts, process respectively effectively computation complexity, and can promote calculating degree of parallelism.Optionally, in step 3, the method for condensation matrix being carried out to sub-clustering is as follows:
Step 3-1, first setting sub-clustering number is L, uses sampling sub-clustering that matrix is divided into
individual bunch;
Step 3-2, re-uses top-down partition method and completes whole sub-clusterings, obtains L bunch.
Wherein L generally selects 3 multiple.Based on error expection, determine clustering algorithm, the error that sub-clustering is introduced is minimum.First according to the relation that affects between each row, by connecting larger row each other, be divided in one bunch.Further according to sub-clustering result above, bunch in determine best sub-clustering point.Finally complete the sub-clustering of condensation matrix is processed.Utilize the influence factor between GPU shadow-casting function calculating row, reduced CPU expense, promoted sub-clustering treatment effeciency.Clustering process is divided into two steps and carries out, promoted sub-clustering processing speed, also guaranteed to find best sub-clustering point, reduce the error that sub-clustering is introduced.
Concrete cluster-dividing method calculates according to following list of references: SCHULMAN, L.J.1999.Clustering for edge-cost minimization.Electronic Co lloquium on Computational Complexity (ECCC) 6,035.
In step 3-1, sampling sub-clustering is divided into matrix
the concrete grammar of individual bunch is: select at random
individual row are as bunch center, by each row be divided into from its nearest Cu center representative bunch in.
In step 3-1, between bunch center and row, the computing formula of distance is as follows:
Wherein, any one Wei Cu center of x and y, the row that another one is distance to be compared.
Wherein cos (x, y) is the angle between the represented vector of two row.
In step 3, the method that each bunch played up is, chooses representative row and play up in each bunch, obtains the illumination sampled value of these row, utilizes extends equation to expand the representative row of this bunch, obtains the intensity of illumination of this bunch, for a bunch C
k, extends equation is as follows:
Wherein, ρ
jfor a bunch C
krepresentative row,
for the ρ after painted
j, symbol || || be 2-norm calculation symbol,
represent bunch C
kin the 2-norm sum of all row.
Bunch in choose complete row as representative, according to RGB Color Channel, play up respectively processing, use the tinter on GPU to play up these row, obtain the complete illumination sampled value of these row.
Rendering result based on representative row, in conjunction with the intensity of illumination distribution proportion that represents row condensation matrix, the intensity of illumination summation of all complete column that acquisition condensation matrix covers on RGB passage.The intensity of illumination that completes each bunch is calculated.
The present invention plays up problem by the multiple light courcess under complex scene and is converted into matrix ranks Sampling, by matrix is carried out to piecemeal processing, has promoted rendering efficiency, greatly reduces memory cost, has promoted the real-time of playing up simultaneously.Can be applied to playing up the scene of real-time and high-quality requirement.
Embodiment
Now the present invention is carried out to detailed explanation in conjunction with the embodiments.
Step 1, sets up illumination matrix according to scene, and in described illumination matrix, all sampled points that a light source irradiates, the sampled point that all light sources of each line display all irradiate are shown in each list.
For the multiple light courcess scene with m sampled point and n light source, calculate the contribution sum of all light sources on each sampled point and can obtain complete scene rendering result.This problem can be converted into: a matrix A that specification is m * n, wherein arbitrary element A
ijrepresent the contribution of light source j on sampled point i, each element is with RGB scalar.All row in matrix are added up, just can obtain the contribution margin of each light source on all sampled points.
According to above formula, calculate complete entry of a matrix element, computation complexity is O (mn).If sampled point i is sightless for light source j, A
ijbe 0, according to actual conditions, have a large amount of 0 elements in actual matrix, matrix A is low-rank.Therefrom randomly draw the capable formation of r condensation matrix, when r is enough large, just can comprise the enough information of complete matrix, condensation matrix can be regarded as the sampled version of complete matrix, by condensation matrix is played up, can obtain the rendering effect of complete matrix.The j row of A are used
represent the rendering result ∑ of overall multiple light courcess
acan represent with following formula:
Step 2, randomly draws several rows from multiple light courcess matrix, forms condensation matrix.
From matrix A, the random r that selects is capable, r * n matrix R of formation, ρ
jbe the row of R, wherein from being converted to RGB scalar, use the 2-norm (being norm) of RGB tlv triple to carry out scalar, ρ the element in R
jit is complete column
sampled version, be called reduction row, matrix R is a down-scaled version of complete illumination matrix.
By matrix A being divided into a plurality of parts, processing respectively and computation complexity can be reduced to O (m+n).After each bunch processed respectively, synthetic complete matrix, can obtain approximation.Cluster-dividing method has affected the degree of error of net result, so need to determine cluster-dividing method according to estimation of error, makes the error of net result minimum.
Step 3, by condensation matrix sub-clustering, plays up each bunch.
The matrix A that is m * n for specification, is divided into k bunch C by n row
1, C
2..., C
l, the norm of reduction row || ρ
j|| be a bunch C
kmiddle light source j intensity of illumination on whole image.Definition
s
ka bunch C
kthe measured value of whole intensities of illumination, definition bunch C
kintensity of illumination be
can obtain following formula:
Wherein j is listed in a bunch C
kin number percent be
x
arepresent the estimator of matrix A intensity of illumination.
In each bunch, according to number percent, choose for condensation matrix norm representative row.When all || ρ
j|| during > 0, can obtain following equation:
E[X is described
a] be actually ∑
aunbiased estimator.According to E[X
a]=∑
a, the assessment formula of the error of complete matrix A can be expressed as:
E[||X
A-∑
A||
2]
The most effective sub-clustering method is to make E[||X
a-∑
a||
2] value minimize.
R is random r * n matrix of selecting row to form from matrix A, due to
independently, X
rerror expected be exactly
error expected sum.By stochastic variable X
rand corresponding assessed value ∑
rbe labeled as X and X ', can be by E[||X
a-∑
a||
2] with following formula, represent:
Will bunch tolerance E[||X
r-∑
r||
2] with following formula, represent:
represent
represent
By above derivation, obtain following equation:
By the distance definition between any two vector x and y, be
using any two row, respectively as vector x and vectorial y, d represents the difference measurement (i.e. distance between two row) of two light sources in same bunch, can represent by following formula:
it is the cosine value of x and y angle.The contribution of two light sources intensity of illumination on image can be assessed by the angle between them.
By the above derivation of equation, the error that sub-clustering is introduced can represent by following formula:
Wherein x represents sampled point, and w represents the weight that sampled point is corresponding, and L represents number of clusters, according to previous E[||X
r-∑
r||
2] formula, definition
According to above error evaluation formula, in two steps complete matrix is carried out to sub-clustering:
Step 3-1, is used sampling sub-clustering that matrix is divided into
part, concrete grammar is: select at random
individual point (each point represents row herein) is as bunch center, and according to the row nearest apart from the computing formula Jiang Yucu center of d be divided into these bunch of center representative bunch in.Definition α
ifor all light sources incide the expense sum of an i:
Then reselect the central point of each bunch, when selecting, in all row, preferential choosing is from the point away from must be, and when an i is selected, setting its weight is 1/p
i, p wherein
ifor an i (i.e. i row) light source expense is at α
iratio, as fruit dot selected mistake, just weight is increased to 1/p
i.Iteration is selected, until choose
individual, then to determine bunch according to each row weight central point, then by a little based on carrying out a bunch division apart from d.
Step 3-2, is used top-down partition method to complete whole sub-clusterings.Based on back, complete
sub-clustering, further decomposes the matrix of sub-clustering, and concrete grammar is as follows: in matrix, mark at random a line, the r of every row is capable is divided into upper and lower two parts, will put i (iiC
l) project (r dimension space) on random line, then find and line is divided into the Best Point of two sections, obtain final L bunch class.
By above step, can realize L the part that be divided into matrix A, and make final error calculated minimum.
Decomposition based on previous step, plays up each bunch.To the row in matrix A and condensation matrix by bunch dividing.Can obtain L bunch C
1, C
2..., C
l.In each bunch, choose complete row as representative, according to RGB Color Channel, play up respectively processing, use the tinter on GPU to play up these row, obtain the complete illumination sampled value of these row.
Definition
for the ρ after painted
j, according to formula
a bunch representative is expanded.Obtain the intensity of illumination summation of each bunch on RGB passage.
On each bunch, use the method to process, can obtain each bunch of C
1, C
2..., C
lrBG intensity of illumination.
Step 4, by each bunch of merging, obtains the intensity of illumination sum of original each row of illumination matrix, completes and plays up.
Previous step is obtained l passes through and plays up bunch merging of processing, can obtain all row sums of original matrix A, obtains the multiple light courcess rendering result of original scene.
The present invention plays up problem by the multiple light courcess under complex scene and is converted into matrix ranks Sampling, by matrix is carried out to piecemeal processing, has promoted rendering efficiency, greatly reduces memory cost, has promoted the real-time of playing up simultaneously.Can be applied to playing up the scene of real-time and high-quality requirement.
Claims (7)
1. based on matrix ranks, the method that multiple light courcess is played up is carried out in sampling, it is characterized in that, comprises the steps:
Step 1, sets up illumination matrix according to scene, and in described illumination matrix, all sampled points that a light source irradiates, the sampled point that all light sources of each line display all irradiate are shown in each list;
Step 2, randomly draws several rows from multiple light courcess matrix, forms condensation matrix;
Step 3, by condensation matrix sub-clustering, plays up each bunch;
Step 4, by each bunch of merging, obtains the intensity of illumination sum of original each row of illumination matrix, completes and plays up.
2. based on matrix ranks samplings, carry out the method that multiple light courcess is played up as claimed in claim 1, it is characterized in that, in described illumination matrix, if sampled point i is sightless for light source j, elements A
ijvalue is 0.
3. based on matrix ranks, the method that multiple light courcess is played up is carried out in sampling as claimed in claim 1, it is characterized in that, in described illumination matrix, each element is RGB scalar, and in step 2, each element of condensation matrix is converted to the 2-norm of using RGB tlv triple.
4. based on matrix ranks, the method that multiple light courcess is played up is carried out in sampling as claimed in claim 1, it is characterized in that, in step 3, the method for condensation matrix being carried out to sub-clustering is as follows:
Step 3-1, first setting sub-clustering number is L, uses sampling sub-clustering that matrix is divided into
individual bunch;
Step 3-2, re-uses top-down partition method and completes whole sub-clusterings, obtains L bunch.
5. based on matrix ranks, the method that multiple light courcess is played up is carried out in sampling as claimed in claim 4, it is characterized in that, in step 3-1, sampling sub-clustering is divided into matrix
the concrete grammar of individual bunch is: select at random
individual row are as bunch center, by each row be divided into from its nearest Cu center representative bunch in.
6. based on matrix ranks, the method that multiple light courcess is played up is carried out in sampling as claimed in claim 4, it is characterized in that, in step 3-1, between bunch center and row, the computing formula of distance is as follows:
Wherein, any one Wei Cu center of x and y, the row that another one is distance to be compared.
7. based on matrix ranks, the method that multiple light courcess is played up is carried out in sampling as claimed in claim 4, it is characterized in that, in step 3, the method that each bunch played up is, in each bunch, choose representative row and play up, obtain the illumination sampled value of these row, utilize extends equation to expand the representative row of this bunch, obtain the intensity of illumination of this bunch, for a bunch C
k, extends equation is as follows:
Wherein, ρ
jfor a bunch C
krepresentative row,
for the ρ after painted
j, symbol || || be 2-norm calculation symbol,
represent bunch C
kin the 2-norm sum of all row.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410390703.XA CN104200513A (en) | 2014-08-08 | 2014-08-08 | Matrix row-column sampling based multi-light-source rendering method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410390703.XA CN104200513A (en) | 2014-08-08 | 2014-08-08 | Matrix row-column sampling based multi-light-source rendering method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN104200513A true CN104200513A (en) | 2014-12-10 |
Family
ID=52085799
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410390703.XA Pending CN104200513A (en) | 2014-08-08 | 2014-08-08 | Matrix row-column sampling based multi-light-source rendering method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104200513A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104732579A (en) * | 2015-02-15 | 2015-06-24 | 浙江传媒学院 | Multi-light-source scene rendering method based on light fragmentation |
CN106157276A (en) * | 2016-06-15 | 2016-11-23 | 南京快脚兽软件科技有限公司 | A kind of multiple target interactive engine rendering intent being applicable to several scenes |
CN107909639A (en) * | 2017-11-10 | 2018-04-13 | 长春理工大学 | The 3D scene drawing methods of scope are multiplexed according to position self adaptive control light source observability |
CN108682041A (en) * | 2018-04-11 | 2018-10-19 | 浙江传媒学院 | A method of multiple light courcess rendering is carried out based on the sampling of matrix ranks and deep learning |
CN113079409A (en) * | 2021-03-26 | 2021-07-06 | 深圳市凉屋游戏科技有限公司 | Picture rendering method and picture rendering device |
CN116883572A (en) * | 2023-09-06 | 2023-10-13 | 腾讯科技(深圳)有限公司 | Rendering method, device, equipment and computer readable storage medium |
-
2014
- 2014-08-08 CN CN201410390703.XA patent/CN104200513A/en active Pending
Non-Patent Citations (1)
Title |
---|
MILOSˇ HASˇAN ET AL: "matrix row column sampling for the many light problem", 《ACM TRANSACTIONS ON GRAPHICS》 * |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104732579A (en) * | 2015-02-15 | 2015-06-24 | 浙江传媒学院 | Multi-light-source scene rendering method based on light fragmentation |
CN106157276A (en) * | 2016-06-15 | 2016-11-23 | 南京快脚兽软件科技有限公司 | A kind of multiple target interactive engine rendering intent being applicable to several scenes |
CN107909639A (en) * | 2017-11-10 | 2018-04-13 | 长春理工大学 | The 3D scene drawing methods of scope are multiplexed according to position self adaptive control light source observability |
CN107909639B (en) * | 2017-11-10 | 2021-02-19 | 长春理工大学 | Self-adaptive 3D scene drawing method of light source visibility multiplexing range |
CN108682041A (en) * | 2018-04-11 | 2018-10-19 | 浙江传媒学院 | A method of multiple light courcess rendering is carried out based on the sampling of matrix ranks and deep learning |
CN108682041B (en) * | 2018-04-11 | 2021-12-21 | 浙江传媒学院 | Method for performing multi-light-source rendering based on matrix row and column sampling and deep learning |
CN113079409A (en) * | 2021-03-26 | 2021-07-06 | 深圳市凉屋游戏科技有限公司 | Picture rendering method and picture rendering device |
CN116883572A (en) * | 2023-09-06 | 2023-10-13 | 腾讯科技(深圳)有限公司 | Rendering method, device, equipment and computer readable storage medium |
CN116883572B (en) * | 2023-09-06 | 2023-12-19 | 腾讯科技(深圳)有限公司 | Rendering method, device, equipment and computer readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104200513A (en) | Matrix row-column sampling based multi-light-source rendering method | |
US20190197344A1 (en) | Saliency-based method for extracting road target from night vision infrared image | |
CN105447906B (en) | The method that weight illumination render is carried out based on image and model calculating illumination parameter | |
CN102682441B (en) | Hyperspectral image super-resolution reconstruction method based on subpixel mapping | |
CN105809105B (en) | High spectrum image solution mixing method based on end member constrained non-negative matrix decomposition | |
CN103177458B (en) | A kind of visible remote sensing image region of interest area detecting method based on frequency-domain analysis | |
CN103903275B (en) | Method for improving image segmentation effects by using wavelet fusion algorithm | |
Doulgeris | A simple and extendable segmentation method for multi-polarisation SAR images | |
CN104732535A (en) | Sparse constraint non-negative matrix factorization method | |
CN103729882B (en) | A kind of some cloud relative pose estimation method based on three-dimensional curve coupling | |
CN112712034B (en) | Unmixing method and system for hyperspectral image | |
CN109360175A (en) | A kind of infrared image interfusion method with visible light | |
CN107341837A (en) | Grid and vector data conversion and continuous yardstick expression based on image pyramid | |
CN104766280A (en) | Quality map phase unwrapping method based on heap sort | |
CN103971388A (en) | Method for reconstructing flame CT (computed tomography) images with adaptive section sizes | |
Tolan et al. | Very high resolution canopy height maps from RGB imagery using self-supervised vision transformer and convolutional decoder trained on aerial lidar | |
CN102436646A (en) | Compressed sensing based CCD (Charge Coupled Device) noise estimation method | |
CN103729873B (en) | A kind of ambient light method of sampling of perception of content | |
CN106296749A (en) | RGB D image eigen decomposition method based on L1 norm constraint | |
CN107644393B (en) | GPU-based abundance estimation algorithm parallel implementation method | |
CN102831621A (en) | Video significance processing method based on spectral analysis | |
Madhusudana et al. | Revisiting dead leaves model: Training with synthetic data | |
LU500193B1 (en) | Low-illumination image enhancement method and system based on multi-expression fusion | |
CN108682041B (en) | Method for performing multi-light-source rendering based on matrix row and column sampling and deep learning | |
CN117576570B (en) | All-weather water vapor inversion elasticity method, system, equipment and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20141210 |
|
WD01 | Invention patent application deemed withdrawn after publication |