Brightness value interpolation computing method in hemispherical space
Technical field
The invention belongs to LED lamp light source luminescent strength test fields, are related to brightness value interpolation meter in a kind of hemispherical space
Calculation method.
Background technology
For each LED lamp, from after design typification production manufacture, luminous intensity has just been consolidated in spatial distribution attribute
It is fixed, become the important composition content of its product attribute.In order to describe the attribute information, existing light source luminescent strength test method is
Test fixes the light intensity of discrete location points to realize, and these discrete location points are from the point of view of spatial distribution, come according to hemispherical
Distribution, wherein the centre of sphere is illuminating source, and hemisphere section is by the illuminating source, to be parallel to the plane of lamp substrate.
The data preserved in IES files are exactly the luminous intensity in this hemispherical space in each test point, from data attribute analysis, are
Some ASCII are encoded and the data point of numerical discretization.It is analyzed with the method for mathematics, these data points are considered as being distributed in
Numerical matrix in hemispherical space.
IES document illumination data space distribution schematic diagrams are as shown in Figure 1, by illumination in IES files according to spatial distribution, indigo plant
Color part numerical value is big, and red represents that numerical value is small, and the green color plane of crosscutting sphere is γ=90 degree plane.It can be seen that the example
The corresponding dense matrix of IES files, cone of the form for a umbrella in hemispherical space.
It is arbitrary random between hemispherical space anchor points due in the analysis of illumination relevant design and calculating, needing to obtain
Corresponding brightness value on point position, it is therefore desirable to which target on-fixed point is extrapolated from periphery known point position brightness value by numerical operation
Approximate brightness value on position.Existing computational methods mainly realize two illumination being mutually perpendicular on face of 0-180 degree and 90-270 degree
Data bring more and more apparent restriction to practical application.Moreover, substantially being analyzed from scheme, existing scheme is with higher
Operation cost obtain the result of calculation of certain precision, this computation organization's mode for disregarding cost is rested on PC, work station
In traditional application environment such as server.These existing algorithm arrangements more seem there is limitation in the mobile interchange epoch, hand
The Mobile portable of platform will be damaged by implementing existing numerical procedure in the mobile equipment such as machine, tablet, embedded intelligence, bring energy
The drawbacks such as consumption, fever and data transmission.
At present, when designing and producing different type lamps and lanterns, lamp luminescence characteristic can be measured, there will be lamps and lanterns photograph
Bright space divides different nodes, referred to as world wide web according to space angular coordinate, and along vertical axis, minimum point corresponds at the two poles of the earth of net
In 0 degree of vertical angle.And this 6643 are obtained by the brightness value of light source on apparatus measures these nodes in laboratory
After node brightness value, with the storage of ASCII document forms for IES files, often row length must not be more than 132 characters in file,
It and must be with carriage return character or newline sequence ends.The lamps and lanterns of each model only have only one IES files to describe and shine
Attribute, to provide Lighting Design and construction usage.
Due to there is the practical contradiction calculated between point position randomness and light illumination measurement point position stationarity, in practical photograph
Degree usually needs to obtain the brightness value of any point in calculating, and how rapidly and accurately to obtain the brightness value of random point, generally there is figure
Solution and numerical method.
At present, discrete data point in IES files is calculated, relevant design platform is illuminated in 3D Max, Delux, Maya etc.
On encapsulated essentially by the form of matched curve, and only called for platform inner function module itself, other platforms and third
Square software is difficult that the mutual of convenience and high-efficiency is called and accessed.Particularly, when involve the need for Android, IOS, Windows,
For Linux when realizing cross-platform calculating between operating systems, the computing function that existing platform provides at present is in time efficiency and sky
Between more lack in efficiency.In addition, existing method is more focused on each point in two orthogonal planes of 0-180 degree and 90-270 degree
Brightness value, the brightness values in hemispherical space on other point positions are then not easy quick obtaining, model are applied which has limited luminance calculation
It encloses.
In existing mathematic calculation, it is bent usually a fitting to be obtained using the computational methods of numerical fitting interpolation
Then line obtains the brightness value on target point again.In numerous existing interpolation fitting computational methods, there are Lagrange's interpolation, ox
The methods of interpolation, Hermite interpolation, piecewise interpolation, spline interpolation of pausing.Its basic principle is using construction Interpolation-Radix-Function, profit
Interpolation fitting is completed with polynomial of degree n, computation complexity O (n) is related with the factorial of n.Its main feature is that n values are higher, fitting
Curve is more smooth, and difference precision is also higher, but incident is that difficulty in computation is also bigger, and the cost of realization is also bigger.Therefore,
Existing illumination analysis software for calculation focuses primarily upon the high density computing environment such as PC, work station, server, related application also needle
To above-mentioned platform.
Invention content
For above-mentioned technical problem, the present invention seeks to:Brightness value interpolation computing method in a kind of hemispherical space is provided, it should
Method can provide the illumination numerical computation algorithm on 0-360 degree arbitrary face and any point position in hemispherical space, can also be
Under the premise of enough accuracy is provided, the calculating effect of simple and effective is obtained with the cost more simplified, convenient for thin in mobile phone, tablet etc.
It is calculated in real time in client.
The technical scheme is that:
Brightness value interpolation computing method in a kind of hemispherical space, which is characterized in that include the following steps:
S01:IES illumination files are read, and read the brightness value in illumination file, using light source levels rotation angle C as horizontal stroke
Angle coordinate establishes hemispherical space matrix by vertical angle coordinate brightness value of the vertical rotation angle γ of light source;
S02:It obtains and intends interpolation point, judge to intend interpolation point in the position of hemispherical space matrix;
S03:If intending interpolation point in the intermediate region of hemispherical space matrix, with order curve method interpolation calculation brightness value, if
In the borderline region of hemispherical space matrix, brightness value is calculated with linear interpolation.
Preferably, the value range of C is 0-360 °, and stepping is 5 °, and the value range of γ is 0-90 °, and stepping is 1 °.
Preferably, γ is the intermediate region that 0-65 ° is hemispherical space matrix, and the rest part of γ is in hemispherical space matrix
Borderline region.
Preferably, if intending interpolation point in the intermediate region of hemispherical space matrix, selection hemispherical space matrix with intending interpolation
The brightness value of three nearest points, with order curve method interpolation calculation brightness value;If in the borderline region of hemispherical space matrix, choosing
2 points of brightness value nearest with intending interpolation in hemispherical space matrix is taken, brightness value is calculated with linear interpolation.
Preferably, the choosing method of the brightness value of three points of the order curve method interpolation is:
S11:Intend interpolation point(C, γ)(Cm+1, γm+1)With(Cm+2, γm+2)Between;Wherein, C, Cm+1、Cm+2For hemisphere sky
Between the horizontal angle coordinate of matrix, γ, γm+1、γm+2Angle coordinate, γ are indulged for hemispherical space matrixm+2-γm+1=1 °, Cm+2-Cm+1=
5°;
S12:Compare C and Cm+1+ 2.5 ° and γ and γm+1+ 0.5 ° of size, if C>Cm+1+ 2.5 °, γ>γm+1+ 0.5 °,
Then C is close to Cm+2, γ is close to γm+2, selection(Cm+1, γm+1)、(Cm+2, γm+2)With(Cm+2+ 5 °, γm+2+1°)3 points into row interpolation
It calculates;If(Cm+2+5°)>360 ° or(γm+2+1°)>90 °, then take Cm+2+ 5 ° subtract 360 °, γm+2+ 1 ° force value be
γm+2Corresponding point afterwards;
S13:If C<Cm+1+ 2.5 °, γ<γm+1+ 0.5 °, then C is close to Cm+1, γ is close to γm+1, selection(Cm+1, γm+1)、
(Cm+2, γm+2)With(Cm+1- 5 °, γm+1-1°)3 points calculate into row interpolation;If(Cm+1-5°)<0 ° or(γm+1-1°)<0 °, then
It takes Cm+1- 5 ° or γm+1- 1 ° plus corresponding point after 360 ° or 180 °;
S14:If C<Cm+1+ 2.5 °, γ>γm+1+ 0.5 °, then C is close to Cm+1, γ is close to γm+2, selection(Cm+1, γm+1)、
(Cm+2, γm+2)With(Cm+1- 5 °, γm+2+1°)3 points calculate into row interpolation;If(Cm+1-5°)<0 ° or(γm+2+1°)>90 °,
It then takes Cm+1- 5 ° add 180 ° either 360 ° or γm+2It is γ that+1 °, which is forced value,m+2Corresponding point afterwards;
S15:If C>Cm+1+ 2.5 °, γ<γm+1+ 0.5 °, then C is close to Cm+2, γ is close to γm+1, selection(Cm+1, γm+1)、
(Cm+2, γm+2)With(Cm+2+ 5 °, γm+1-1°)3 points calculate into row interpolation;If(Cm+2+5°)>360 ° or(γm+1-1°)<0 °,
It then takes Cm+2+ 5 ° subtract 180 ° either 360 ° or γm+1- 1 ° plus corresponding point after 180 ° or 360 °.
Preferably, the choosing method of 2 points of brightness value of the linear interpolation is:
S21:Intend interpolation point(C, γ)(Cm+1, γm+1)With(Cm+2, γm+2)Between;Wherein, C, Cm+1、Cm+2For hemisphere sky
Between the horizontal angle coordinate of matrix, γ, γm+1、γm+2Angle coordinate, γ are indulged for hemispherical space matrixm+2-γm+1=1 °, Cm+2-Cm+1=
5°;
S22:If the remainder of C and 5 is zero, and the remainder of γ and 5 is non-zero, then carries out linear difference along γ directions, take
(C, γm+1)With(C, γm+2)Carry out linear difference calculating;If the remainder of C and 5 is non-zero, and the remainder of γ and 5 is zero, then edge
It C directions and carries out linear difference, take(C m+1, γ)With(C m+2, γ)Carry out linear difference calculating.
It is an advantage of the invention that:
1. algorithm is reliably transparent.The derivation of this method is based on trigonometric function variation and matrix operation theory, and reliability is higher,
Program realizes that cost is smaller, and compared with existing mainstream technology scheme, calculation process is clearly easy, is conducive to the frequency in practice
Numerous calling.
It is 2. larger with potentiality.It is confined to calculate the illumination numerical value of 30 point positions on road surface, the present invention compared to existing scheme
Arbitrary point position brightness value and brightness value on road surface can be theoretically calculated, for realizing that further analysis Lighting Design is as a result, comment
Estimate designing scheme quality, there are larger potentiality.
3. it is tight to calculate boundary.The new illumination coordinate of point is calculated after three axis of lamps and lanterns rotates up, on ground to have carried out sternly
Close logic analysis, for the x' value ranges different with y', corresponding C' has different computational methods, forms strict
Exploitation range.
4. tight connecting is practical.Existing scheme only considered the calculating of two axis, but with the gradually popularization and application of accurate lighting,
The new design and installation form of lamps and lanterns will more and more appear in engineering in practice, and the limitation of existing scheme will be more
Significantly.In view of this, this algorithm takes into account space factor, can preferably instruct Practical Project.
5. algorithm good compatibility.Under the premise of can more preferably meet existing code requirement 30 calculate point, this method is real
Existing basis is calculated for trigonometric function, realizes that cost is smaller, after correlation IES file interpolation algorithms are combined, compared to existing calculating side
Case can improve efficiency nearly 80%, can greatly reduce and calculate power consumption and memory space, be easy to Android, IOS,
The computing environment span Platform deployment such as Windows, Linux.Simultaneously, moreover it is possible to be required according to actual data analysis, computations point
Quantity, the computing capability for relying on X86 and Power frameworks powerful, calculates entire road surface any point brightness value, to realize various complexity
The more scientific quantization of operating mode, analysis and assessment provide objective result of calculation.
Description of the drawings
The invention will be further described with reference to the accompanying drawings and embodiments:
Fig. 1 is existing IES document illuminations data space distribution schematic diagram;
Fig. 2 is the hemispherical space matrix of brightness value interpolation computing method in hemispherical space of the present invention;
Fig. 3 is the flow chart of brightness value interpolation computing method in hemispherical space of the present invention;
Fig. 4 is the use order curve method interpolation of brightness value interpolation computing method in hemispherical space of the present invention in hemispherical space square
Battle array chooses the relational graph of 3 brightness values;
Fig. 5 is the specific condition calculating point schematic layout pattern of brightness value interpolation computing method in hemispherical space of the present invention.
Specific embodiment
Understand to make the object, technical solutions and advantages of the present invention clearer, With reference to embodiment and join
According to attached drawing, the present invention is described in more detail.It should be understood that these descriptions are merely illustrative, and it is not intended to limit this hair
Bright range.In addition, in the following description, the description to known features and technology is omitted, to avoid this is unnecessarily obscured
The concept of invention.
Embodiment:
In Lighting Design field, in order to weigh the luminescent properties of lighting source, normal Ordinary Light Sources Have light intensity carrys out recording light source and exists
Some direction glazed thread relative strength index of space, the symbol for recording the light intensity are represented with I.Its numerical values recited is used by specialized laboratory
Professional equipment measurement obtains, and specifically establishes a Space Angle coordinate system centered on light source, horizontal rotation angle C,
Vertical rotation angle is γ.When actually measuring lamps and lanterns light intensity value, by rotating two angles of C and γ, special measurement instrument is used
A series of light intensity numerical value in angles is measured, and the brightness value in records of values to IES files, established using C, γ as coordinate is built
Vertical hemispherical space matrix.
As shown in Fig. 2, since numerical term is numerous, data type belongs to floating type, when entire matrix participates in double-precision floating point
During calculating, it will generate larger memory space and calculate space requirement.Wherein stored items need to apply for 91*73=6643
Floating-point storage unit, byte 53K when double precision 64 stores.It can be using the computational methods of the present invention as a basic calculation list
Member will be called frequently in practice.General condition calculating in being calculated according to street lighting, five lamp stands of bicycle road it
Between will have minimum 120 calculating point, then need called to participate in calculating 120 times.It is required according to operational efficiency, software is often required to together
When submit the application of this 120 times calculating, then need the memory space of maximum 6377280 bytes of application.
As shown in figure 3, brightness value interpolation computing method in the hemispherical space, includes the following steps:
S01:IES illumination files are read, and read the brightness value in illumination file, using light source levels rotation angle C as horizontal stroke
Angle coordinate establishes hemispherical space matrix by vertical angle coordinate brightness value of the vertical rotation angle γ of light source;The value range of C is
0-360 °, stepping is 5 °, and the value range of γ is 0-90 °, and stepping is 1 °;
S02:It obtains and intends interpolation point, judge to intend interpolation point in the position of hemispherical space matrix;
S03:If intending interpolation point in the intermediate region of hemispherical space matrix, with order curve method interpolation calculation brightness value, if
In the borderline region of hemispherical space matrix, brightness value is calculated with linear interpolation.
The value range of C is 0-360 °, and stepping is 5 °, and the value range of γ is 0-90 °, and stepping is 1 °.
γ is the intermediate region that 0-65 ° is hemispherical space matrix, and the rest part of γ is on the boundary of hemispherical space matrix
Region.
If intend interpolation point in the intermediate region of hemispherical space matrix, selection hemispherical space matrix with intending interpolation recently three
The brightness value of a point, with order curve method interpolation calculation brightness value;If in the borderline region of hemispherical space matrix, it is empty to choose hemisphere
Between 2 points of brightness value nearest with intending interpolation in matrix, calculate brightness value with linear interpolation.
With reference to Fig. 4, the choosing method of the brightness value of three points of order curve method interpolation is:
S11:Intend interpolation point(C, γ)(Cm+1, γm+1)With(Cm+2, γm+2)Between;Wherein, C, Cm+1、Cm+2For hemisphere sky
Between the horizontal angle coordinate of matrix, γ, γm+1、γm+2Angle coordinate, γ are indulged for hemispherical space matrixm+2-γm+1=1 °, Cm+2-Cm+1=
5°;
S12:Compare C and Cm+1+ 2.5 ° and γ and γm+1+ 0.5 ° of size, if C>Cm+1+ 2.5 °, γ>γm+1+ 0.5 °,
Then C is close to Cm+2, γ is close to γm+2, selection(Cm+1, γm+1)、(Cm+2, γm+2)With(Cm+2+ 5 °, γm+2+1°)3 points into row interpolation
It calculates;If(Cm+2+5°)>360 ° or(γm+2+1°)>90 °, then take Cm+2+ 5 ° subtract 360 °, γm+2+ 1 ° force value be
γm+2Corresponding point afterwards;
S13:If C<Cm+1+ 2.5 °, γ<γm+1+ 0.5 °, then C is close to Cm+1, γ is close to γm+1, selection(Cm+1, γm+1)、
(Cm+2, γm+2)With(Cm+1- 5 °, γm+1-1°)3 points calculate into row interpolation;If(Cm+1-5°)<0 ° or(γm+1-1°)<0 °, then
It takes Cm+1- 5 ° or γm+1- 1 ° plus corresponding point after 360 ° or 180 °;
S14:If C<Cm+1+ 2.5 °, γ>γm+1+ 0.5 °, then C is close to Cm+1, γ is close to γm+2, selection(Cm+1, γm+1)、
(Cm+2, γm+2)With(Cm+1- 5 °, γm+2+1°)3 points calculate into row interpolation;If(Cm+1-5°)<0 ° or(γm+2+1°)>90 °,
It then takes Cm+1- 5 ° add 180 ° either 360 ° or γm+2It is γ that+1 °, which is forced value,m+2Corresponding point afterwards;
S15:If C>Cm+1+ 2.5 °, γ<γm+1+ 0.5 °, then C is close to Cm+2, γ is close to γm+1, selection(Cm+1, γm+1)、
(Cm+2, γm+2)With(Cm+2+ 5 °, γm+1-1°)3 points calculate into row interpolation;If(Cm+2+5°)>360 ° or(γm+1-1°)<0 °,
It then takes Cm+2+ 5 ° subtract 180 ° either 360 ° or γm+1- 1 ° plus corresponding point after 180 ° or 360 °.
The choosing method of 2 points of brightness value of linear interpolation is:
S21:Intend interpolation point(C, γ)(Cm+1, γm+1)With(Cm+2, γm+2)Between;Wherein, C, Cm+1、Cm+2For hemisphere sky
Between the horizontal angle coordinate of matrix, γ, γm+1、γm+2Angle coordinate, γ are indulged for hemispherical space matrixm+2-γm+1=1 °, Cm+2-Cm+1=
5°;
S22:If the remainder of C and 5 is zero, and the remainder of γ and 5 is non-zero, then carries out linear difference along γ directions, take
(C, γm+1)With(C, γm+2)Carry out linear difference calculating;If the remainder of C and 5 is non-zero, and the remainder of γ and 5 is zero, then edge
It C directions and carries out linear difference, take(C m+1, γ)With(C m+2, γ)Carry out linear difference calculating.
In specific condition calculating, several need to be chosen on the face of track and calculates point, to weigh lamps and lanterns between two lamp stands
Illuminating position.For being illustrated in fig. 5 shown below operating mode, when two lamp stand spacing are not more than 50 meters, usually along the longitudinal equidistant cloth of road
10 points of 3 row is put, wherein distance between two points is the 1/10 of lamp stand spacing.In road transverse direction, 3 points are arranged, point midway is in track
On medium line, 2 points of outside is respectively away from 1/6 lane width of track sideline.
As seen from Figure 5, the corresponding C and γ values of each point by distance and trigonometric function after calculating, most of numerical value
It cannot be discovered and seized in standard IES files.Particularly after considering that lamp installation has the operating modes factor such as elevation-depression angle, practical C
It will be more discrete with γ values.Therefore, with suitable algorithm, according to the practical C and γ values for calculating point, phase is obtained by calculating
The I values answered, are just particularly important.
Consider factors above, select quadratic power interpolation method, can both meet enough interpolation fitting precision, additionally it is possible to is maximum
Degree reduces algorithm complexity, can realize accurate rapid effect.Specifically, according to C the and γ values for intending interpolation, shining
Three points before and after choosing are spent in table, with quadratic curve, realize the fitting of data.
The present invention in hemispherical space matrix intermediate region, according to sampled point it is more regular intensive the characteristics of, use conic section
Method interpolation calculation, in borderline region, then with linear interpolation computational methods.Entire space is fitted by a section conic section
Brightness value calculates the brightness value for only needing three points near target point every time, and the complexity O (2) of algorithm is controlled in 2 powers
Hereinafter, under the premise of ensureing precision, the time complexity and space complexity of algorithm are effectively reduced.
It should be understood that the above-mentioned specific embodiment of the present invention is used only for exemplary illustration or explains the present invention's
Principle, without being construed as limiting the invention.Therefore, that is done without departing from the spirit and scope of the present invention is any
Modification, equivalent replacement, improvement etc., should all be included in the protection scope of the present invention.In addition, appended claims purport of the present invention
Covering the whole variations fallen into scope and boundary or this range and the equivalent form on boundary and repairing
Change example.