CN110097613B - B spline curve generation method and system based on probability calculation - Google Patents

B spline curve generation method and system based on probability calculation Download PDF

Info

Publication number
CN110097613B
CN110097613B CN201910378599.5A CN201910378599A CN110097613B CN 110097613 B CN110097613 B CN 110097613B CN 201910378599 A CN201910378599 A CN 201910378599A CN 110097613 B CN110097613 B CN 110097613B
Authority
CN
China
Prior art keywords
group
module
binary string
spline curve
control point
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
CN201910378599.5A
Other languages
Chinese (zh)
Other versions
CN110097613A (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.)
Guangxi University
Original Assignee
Guangxi University
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 Guangxi University filed Critical Guangxi University
Priority to CN201910378599.5A priority Critical patent/CN110097613B/en
Publication of CN110097613A publication Critical patent/CN110097613A/en
Application granted granted Critical
Publication of CN110097613B publication Critical patent/CN110097613B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/203Drawing of straight lines or curves
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Complex Calculations (AREA)

Abstract

The invention discloses a probability calculation-based B-spline curve generation method and a probability calculation-based B-spline curve generation system. The method comprises the following steps: the method comprises the steps of carrying out coordinate transformation on an input control point set, carrying out normalization processing on the control point coordinate set, carrying out binarization processing on a mapping value set and an input node set to obtain a first binary string set and a second binary string set, carrying out multiplexing gating on the first binary string set based on the second binary string set by using a probability calculation method to obtain a probability value set, and carrying out random decoding normalization inverse operation on the probability value set in sequence. The system comprises a coordinate transformation module, a normalization module, a binarization module, a probability calculation module and a data decoding module which are sequentially connected, wherein the coordinate transformation module receives a control point group, and the binarization module receives a node group. Compared with a direct calculation mode, the method generates the B spline curve, can greatly reduce the complexity of the system, reduce the calculated amount and shorten the calculation time.

Description

B spline curve generation method and system based on probability calculation
Technical Field
The invention relates to the field of computer graph drawing, in particular to a method and a system for generating a B spline curve by using a probability calculation method.
Background
The B-spline curve surface has many excellent properties such as geometric invariance, convex hull property, degradation reducibility, local supportability and the like, and is a quite important parameter curve in computer graphics. The drawing efficiency of the B spline curve directly influences the drawing efficiency of the computer image.
At a known n+1 control points P i (i=0, 1,2,3 … … n) and node t, the general expression for the n-th order B-spline curve is as follows:
n is the number of times of B spline curve, t is the input node, P k Is a control point.
If the method is adopted for generating by direct calculation, the calculation complexity is high, and particularly when a high-order B spline curve is generated by calculation, the complexity is too high and the speed is low. The critical path of the current direct calculation method consists of a multiplier, an adder and the like. 3-degree B spline time complexity of O (t 3 ) The 4-degree B spline has a temporal complexity of O (t 4 ) The time complexity of the n-degree B spline is O (t n ). It can be seen that, with the increasing number of times of the B-spline curve, the time complexity of the conventional calculation method is O (t n ) Growth.
The probability calculation [1] is a numerical value representation and calculation method, and in the probability calculation, the value is represented by the proportion of the number of 1 contained in the sequence to the whole sequence length, and the probability calculation is realized by completing multiplication, addition and other operations through a gate-level circuit with simple structure. The probability calculation method has been applied to the research fields of digital filters, FFT, turbo decoders, multi-rate LDPC decoders [2-4] and the like in recent years. The use of probability calculations can greatly reduce the amount of computation.
The references to which the present invention relates are as follows:
[1]W.Qian and M.Riedel,“The synthesis of robust polynomial arithmetic with stochastic logic,”in DAC’08:Proceedings of the 45th Design Automation Conference,Anaheim,CA,USA,Jun.2008,pp.648–653.
[2] wu Saili, zhou Yan, gorgeous, li Jiaqing. Method for calculating probability of radar detection based on measured data [ J ]. Microcomputer information, 2008,7-3.
[3] Chen Jienan, hu Jianhao implementation of digital filters based on probability computation [ J ]. Chinese integrated circuits, 2010, 11.
[4] Hu Jianhao, chen Jienan. Probability computation application in communication signal processing system implementation [ J ]. Radio communication techniques, 2015, 41 (2): 01-06.
Disclosure of Invention
The invention aims at: in response to the above-mentioned problems, a method and system for applying probability calculations to the rendering of B-spline curves is provided. With the simple structure of utilizing probability calculation, through low complexity structure and less operand, draw comparatively accurate B spline curve fast.
The technical scheme adopted by the invention is as follows:
the B spline curve generation method based on probability calculation is characterized by comprising the following steps of:
transforming the coordinates of the input control point group to obtain a corresponding control point coordinate group;
normalizing the control point coordinate set to obtain a corresponding mapping value set;
respectively carrying out binarization processing on the values of each mapping value group and the input node group to obtain a corresponding first binary string group and a corresponding second binary string group;
a step of multiplexing the first binary string group based on the second binary string group to obtain a probability value group;
and randomly decoding the probability value group, and carrying out normalized inverse operation on the decoding result to obtain a corresponding point coordinate group.
The scheme generates the B spline curve based on a probability calculation method, the calculation process only involves addition, comparison and multipath gating, the method belongs to a method that the complexity grows linearly along with the increase of the times of the B spline curve, and compared with the direct calculation, the complexity is O (t 4 ) The method greatly reduces the calculated amount, reduces the calculation complexity, reduces the calculation time consumption, and has particularly remarkable effect when generating a high-order B spline curve.
Further, the binarization process is a process of comparing the data to be binarized with a pseudo-random code of a predetermined length to obtain a comparison result.
Further, the multiplexing the first binary string group based on the second binary string group specifically includes: the result of the addition of the corresponding bits of the second binary string set is used as a multiplexing gating control end to multiplex gate the first binary string set.
Further, in the normalization processing of the control point coordinate set, the normalization method is as follows: GP (GP) i =(A i -min(A 0 ,A 1 ,A 2 .....A n ))/(max(A 0 ,A 1 ,A 2 ....A n )-min(A 0 ,A 1 ,A 2 .....A n ) (i=0, 1,2, n); wherein min (-) is a minimum function, max (-) is a maximum function, n is the number of control point groups, A 0 ,A 1 ,A 2 .....A n For controlling the point coordinate set, GP i The resulting mapped values are normalized.
A B spline curve drawing system based on probability calculation comprises a coordinate transformation module, a normalization module, a binarization module, a probability calculation module and a data decoding module which are connected in sequence; wherein:
the coordinate transformation module is used for carrying out coordinate transformation on the input control point group and outputting a corresponding control point coordinate group;
the normalization module is used for carrying out normalization processing on the received control point coordinate set and outputting a corresponding mapping value set;
the binarization module is used for receiving the mapping value group output by the normalization module, receiving the input node group, performing binarization processing on the received data, outputting a corresponding binary string, correspondingly outputting a first binary string group for the received probability value group, and correspondingly outputting a second binary string for the received node group;
the probability calculation module multiplexes the first binary string based on the second binary string to output a probability value set;
and the data decoding module performs random decoding and normalized inverse operation on the received probability value group to obtain the position coordinates of the drawing points.
Further, the binarization module is used for performing binarization processing on the received data based on the pseudo-random code.
Further, the binarization module comprises a pseudo-random code generation unit and a comparator; the pseudo-random code generation unit is used for generating pseudo-random codes with preset length, the output end of the pseudo-random code generation unit is connected with the first input end of the comparator, the second input end of the comparator is used for receiving the output value of the normalization module, and the output end of the comparator outputs a binary string corresponding to data received by the second input end of the comparator. I.e. the output of the comparator outputs the first binary string when the second input of the comparator is the set of mapped values and the output of the comparator outputs the second binary string when the second input of the comparator is the set of nodes.
Further, the probability calculation module performs multiplexing on the first binary string group based on the second binary string group specifically includes: the probability calculation module multiplexes the first binary string group based on the result of the addition of the corresponding bits of the second binary string group.
Further, the probability calculation module comprises an adder and a multi-way selector, wherein the input end of the adder is used for receiving the second binary string group, the output end of the adder is connected with the control end of the multi-way selector, the coefficient input end of the multi-way selector is used for receiving the first binary string group, and the output end of the multi-way selector outputs the probability value group.
Further, the normalization method of the normalization module comprises the following steps:
GP i =(A i -min(A 0 ,A 1 ,A 2 .....A n ))/(max(A 0 ,A 1 ,A 2 ....A n )-min(A 0 ,A 1 ,A 2 .....A n ) (i=0, 1,2, n); wherein min (-) is a minimum function, max (-) is a maximum function, n is the number of control point groups, A 0 ,A 1 ,A 2 .....A n For controlling the point coordinate set, GP i The resulting mapped values are normalized.
In summary, due to the adoption of the technical scheme, the beneficial effects of the invention are as follows:
the prior proposal adopts a direct calculation mode, the calculated critical path mainly consists of multiplication, and for an n-degree B spline curve, the complexity of the drawing is O (t n ) It can be seen that it is O (t n ) The calculation amount is large, and the calculation time is long. The invention adopts the probability calculation mode to draw the B spline curve, the calculated key path is composed of addition, comparison and multipath gating, for n times of B spline curve, 2n times of comparison, 1 time of n bit addition and 1 time of n+1 choice multipath gating are needed, obviously, the calculation amount of the drawing is increased linearly with the increasing number of times of B spline curve, the complexity of calculation (or system structure) is increased linearly, compared with the direct calculation mode, the calculation complexity is greatly reduced, the calculation amount is small, the calculation speed is high (especially for drawing higher order B spline curve), and the realization on hardware such as FPGA is convenient.
Drawings
The invention will now be described by way of example and with reference to the accompanying drawings in which:
FIG. 1 is one embodiment of a B-spline curve generation method flow based on probability computation.
Fig. 2 is a block diagram of a B-spline curve drawing method based on probability calculation.
Fig. 3 is one embodiment of a binarization module structure.
FIG. 4 is one embodiment of a probabilistic computation module architecture.
Fig. 5 is a cubic B-spline curve drawn by the scheme of the present invention and by direct calculation.
Fig. 6 is a graph of a number of cubic B-splines drawn by the inventive approach.
In fig. 5 and 6, the dashed curve is a cubic B-spline curve drawn by the scheme of the present invention, and the solid curve is a cubic B-spline curve drawn by a direct calculation method; in fig. 6, (a) is a result of taking 256-bit pseudo random code, (b) is a result of taking 512-bit pseudo random code, (c) is a result of taking 1024-bit pseudo random code, and (d) is a result of taking 2048-bit pseudo random code.
Detailed Description
All of the features disclosed in this specification, or all of the steps in a method or process disclosed, may be combined in any combination, except for mutually exclusive features and/or steps.
Any feature disclosed in this specification (including any accompanying claims, abstract) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise. That is, each feature is one example only of a generic series of equivalent or similar features, unless expressly stated otherwise.
Example 1
The embodiment discloses a probability calculation-based B-spline curve generation method, which comprises the following steps:
based on the general expression of the B spline curve, the input control point P i (i=0, 1,2,3 … … n) to obtain corresponding control point coordinates A i (i=0, 1,2,3 … … n).
Normalizing the control point coordinates to obtain a corresponding mapping value GP i (i=0, 1,2,3 … … n), wherein, return toThe method comprises the following steps:
GP i =(A i -min(A 0 ,A 1 ,A 2 .....A n ))/(max(A 0 ,A 1 ,A 2 ....A n )-min(A 0 ,A 1 ,A 2 .....A n ) (i=0, 1,2, n); where min (-) is the minimum function and max (-) is the maximum function.
N-bit based pseudo-random code R i (i=0, 1,2,3 … … n), each map value GP is calculated i (i=0, 1,2,..n) and node t of the input k (k=0, 1,2,..n) respectively performing binarization processing to obtain a corresponding binary string B i (i=0, 1,2,..n) and X i (i=0, 1,2,..n).
By X i (i=0, 1,2, n) the result of the bitwise addition S (i) =x 0 (i)+X 1 (i)+X 2 (i)+...+X n (i) (i=1, 2..n.) as a multiplexing control terminal, B i (i=0, 1,2,..n) as a multiplexing coefficient input to obtain a probability value Y (i) =b S(i) (i=1, 2..n).
And randomly decoding the probability value, and carrying out normalized inverse operation on the decoding result to obtain the corresponding point coordinates. And drawing a corresponding B spline curve through points on the coordinates of each point.
Example two
As shown in fig. 1, the first embodiment discloses a B-spline curve generating method based on probability calculation, which includes the following steps:
1. based on the general expression of B spline curve, the input control point group P i (i=0, 1,2,3 … … n) to obtain a corresponding control point coordinate set A i (i=0, 1,2,3 … … n).
The expression of the B-spline curve is:
wherein P is 0 ,P 1 ,…P n A control point group which is a curve; n is the number of times of B spline curve, such as cubic B spline curve, n is 3; t is a fractional value between 0 and 1; k is the kth point, and the value range of k is 0,1,2 and … n. The formula (1) is transformed and arranged to obtain the following formula (probability calculation polynomial):
taking a cubic B-spline curve as an example, expanding the expression of the B-spline curve to obtain:
P(t)=1/6(P 0 (-t 3 +3t 2 -3t+1)+P 1 (3t 3 -6t 2 +4)+P 2 (-3t 3 +3t 2 +3t+1)+P 3 t 3 ) (2)
finishing from formula (2) gives formula (3):
P(t)=1/6((P 0 +4P 1 +P 2 )+(-3P 0 +3P 2 )t+(3P 0 -6P 1 +3P 2 )t 2 +(-P 0 +3P 1 -3P 2 +P 3 )t 3 ) (3),
corresponding to the control point coordinates, and transforming to obtain:
wherein:
A 0 =1/6(P 0 +4P 1 +P 2 ) (5),
A 1 =1/6(4P 1 +2P 2 ) (6),
A 2 =1/6(2P 1 +4P 2 ) (7),
A 3 =1/6(P 1 +4P 2 +P 3 ) (8)。
by input of a group of control points P 0 -P 3 Obtaining the control point coordinate set A 0 -A 3
2. Control point coordinate set A 0 A 1 ,A 2 ....A n Performing normalizationPerforming chemical processing to obtain a corresponding mapping value group GP i (i=0, 1,2,3 … … n).
The normalization processing is to make each control point coordinate set A 0 A 1 ,A 2 ....A n The values of (1) are mapped to [0, 1] respectively]The normalized mapping conversion method is as follows:
GP i =(A i -min(A 0 ,A 1 ,A 2 .....A n ))/(max(A 0 ,A 1 ,A 2 ....A n )-min(A 0 ,A 1 ,A 2 .....A n )),(i=0,1,2,...n) (9),
min (-) is a minimum function and max (-) is a maximum function.
3. N-bit based pseudo-random code group R i (i=0, 1,2,3 … … n) to be mapped to the value group GP i (i=0, 1,2,..n) and input node group t k (k=0, 1,2,..n) respectively performing binarization processing to obtain a corresponding binary string group B i (i=0, 1,2,..n) and X i (i=0, 1,2,..n).
The binarization processing respectively processes t k And GP i Corresponding conversion into binary string group X i And B i . Transition input t k Outputting to obtain X i Input GP i Output to obtain B i . The conversion process is completed based on a pseudo-random code set, and the generation of pseudo-random codes and computers is described in the literature (Wu Mingjie, du Tiancang, university of Liaoning engineering university, vol. 21, 2 nd) and takes primitive polynomials as characteristic polynomials of a feedback shift register, so that pseudo-random code sequences can be generated.
The pseudo-random code sets are generated by primitive polynomial shifting. The pseudo-random code set can be generated by using the primitive polynomial as the characteristic polynomial of the feedback shift register. The primitive polynomial is as follows:
in this embodiment, the primitive polynomial takes 10 th order, i.e., n takes 10, and moves with 110000101 feedbackBit generation of N-bit random code R i N takes 256 bits, 512 bits, 1024 bits and 2048 bits respectively for experiments. The corresponding cubic B-spline curves are plotted as shown in fig. 6 (a), (B), (c), and (d).
In the process of GP i And R is R i (i=0, 1,2 …, n) when the shift comparison is performed, GP i R is greater than or equal to R i The output is "1", and the output is "0" if the output is less than the "1". Experiments prove that the obtained B i In the binary string of (i is 0,1,2, … n), "1" is the ratio of GP to GP i The values indicated are the same. This provides a basis for applying probability calculations to B-spline curve rendering. If GP is i With a value of 0.4 and N of 128 bits, B i The number of "1" in (a) is 128 x 0.4, although B i The proportion of "1" in (C) is the same, but due to R i The position of "1" in (B) is random, so that i The positions of "1" in the binary string in (a) are also random. Also, t k And R is R i Shift comparison (i=0, 1,2 …, n) is performed to obtain a random binary string group X i
4. By X i (i=0, 1,2, n) result of corresponding bit addition S (i) =x 0 (i)+X 1 (i)+X 2 (i)+...+X n (i) (i=1, 2..n.) as a multiplexing control terminal, B i (i=0, 1,2,..n) as a multiplexing coefficient input to obtain a probability value set Y (i) =b S(i) (i=1, 2..n).
As shown in FIG. 4, in the probability calculation, an adder and a multiplexer are used to X i (i=0, 1,2,..n) as input to the adder, each bit is added correspondingly to obtain S (1) S (2)..s (N), wherein S (i) =x 0 (i)+X 1 (i)+X 2 (i)+...+X n (i) (i=1, 2. N.). Adder output S i (i=1, 2, 3..n.) as the control terminal of the multiplexer, B i (i=0, 1,2,..n) as a coefficient input (data input) of the multiplexer, the multiplexer output outputs Y (i) =b S(i) (i=1, 2. N., the output value Y (1) Y (2). Cndot.Y (N) is obtained. B (B) S(i) The calculated truth table is shown in the following table:
input signal B Gating signal S Output signal Y
B 0 (1)B 0 (2)B 0 (3)...B 0 (N) 0 B 0 (t)
B 1 (1)B 1 (2)B 1 (3)...B 1 (N) 1 B 1 (t)
...... ......
B n (1)B n (2)B n (3)...B n (N) n B n (t)
5. And randomly decoding the probability value group, and carrying out normalized inverse operation on the decoding result to obtain the point coordinates of the curve. And drawing a corresponding B spline curve through points on the coordinates of each point.
The random decoding method comprises the following steps:
the proportion of the number of 1 in Y (1) Y (2) and Y (N) in the binary string is counted, and the random decoding process is a probability calculation process. And carrying out normalization inverse operation by the formula (12) to obtain the position coordinates of the drawing points.
DY=Y(max(A 0 ,A 1 ,A 2 ....A n )-min(A 0 ,A 1 ,A 2 .....A n ))+min(A 0 ,A 1 ,A 2 ....A n ) (12),
DY is the AND input value t obtained by probability calculation k And control point group P 0 ,P 1 ,…P n And outputting coordinate values correspondingly. The B-spline curve can be directly drawn from the values of DY. As shown in FIG. 5, for the cubic B-spline curve drawn by the method of the present embodiment, the pseudo-random code length is selected to be 512 bits.
Example III
As shown in fig. 2, the embodiment discloses a B-spline curve generating system based on probability calculation, which comprises a coordinate transformation module, a normalization module, a binarization module, a probability calculation module and a data decoding module which are sequentially connected; wherein:
the coordinate transformation module is used for controlling the input point P i (i=0, 1,2,3 … … n) and outputting the corresponding control point coordinates a i (i=0、1、2、3……n);
The normalization module is used for performing normalization processing on the received control point coordinates and outputting a corresponding mapping value GP i (i=0、1、2、3……n);
The binarization module is used for receiving the data output by the normalization module and also receiving the input node t k (k=0, 1,2, N), the binarization module is used for carrying out binarization processing on the received data based on the N-bit pseudo-random code, outputting the corresponding binary string for the received probability value GP i Then correspondingly outputs the binary string B i (i=0, 1,2, n), for the receiving node t k Output two-wayString X i (i=0,1,2,...n);
The probability calculation module uses X i (i=0, 1,2, n) result of corresponding bit addition S (i) =x 0 (i)+X 1 (i)+X 2 (i)+...+X n (i) (i=1, 2.. The third party.n.: as a control end of the multi-way strobe, in B way i (i=0, 1,2,..n) as a multiplexing coefficient input, outputting a probability value Y (i) =b S(i) (i=1,2...N);
The data decoding module receives the data (Y (i) output by the probability calculation module) (i=0, 1, 2..n)) in order, performing random decoding and normalization inverse operation, and obtaining the position coordinates of the drawing points. Marking each calculated drawing point on the graph to reach the B spline curve. As shown in fig. 5, the dashed line is a cubic B-spline curve drawn by the drawing system according to the present embodiment under the condition that the pseudo-random code length takes 512 bits.
Example IV
The embodiment discloses a B spline curve generation system based on probability calculation, which comprises a coordinate transformation module, a normalization module, a binarization module, a probability calculation module and a data decoding module which are sequentially connected, as shown in fig. 2.
The coordinate transformation module comprises a control point input port for inputting the control point group P from the control point input port i (i=0, 1,2,3 … … n) and outputting a corresponding control point coordinate set A i (i=0, 1,2,3 … … n). The coordinate transformation method comprises the following steps:
the expression of the B-spline curve is:
wherein P is 0 ,P 1 ,…P n A control point group which is a curve; n is the number of times of B spline curve, such as cubic B spline curve, n is 3; t is a fractional value between 0 and 1; k is the kth point, and the value range of k is 0,1,2 and … n. The method comprises the steps of (1) transforming and finishing to obtain:
taking a cubic B-spline curve as an example, expanding the expression of the B-spline curve to obtain:
P(t)=1/6(P 0 (-t 3 +3t 2 -3t+1)+P 1 (3t 3 -6t 2 +4)+P 2 (-3t 3 +3t 2 +3t+1)+P 3 t 3 ) (2)
finishing from formula (2) gives formula (3):
P(t)=1/6((P 0 +4P 1 +P 2 )+(-3P 0 +3P 2 )t+(3P 0 -6P 1 +3P 2 )t 2 +(-P 0 +3P 1 -3P 2 +P 3 )t 3 ) (3),
corresponding to the control point coordinates, and transforming to obtain:
wherein:
A 0 =1/6(P 0 +4P 1 +P 2 ) (5),
A 1 =1/6(4P 1 +2P 2 ) (6),
A 2 =1/6(2P 1 +4P 2 ) (7),
A 3 =1/6(P 1 +4P 2 +P 3 ) (8)。
by input of a group of control points P 0 -P 3 Obtaining the control point coordinate set A 0 -A 3
The normalization module is used for performing normalization processing on the received control point coordinate set and outputting a corresponding mapping value set GP i (i=1、2、3……n)。
The normalization processing is to make each control point coordinate set A 0 A 1 ,A 2 ....A n The values of (1) are mapped to [0, 1] respectively]The normalized mapping conversion method is as follows:
GP i =(A i -min(A 0 ,A 1 ,A 2 .....A n ))/(max(A 0 ,A 1 ,A 2 ....A n )-min(A 0 ,A 1 ,A 2 .....A n )),(i=0,1,2,...n) (9),
min () is the minimum function, max () is the maximum function, and n is the control point coordinate set number.
The binarization module also comprises a node input port, and is used for receiving data based on the N-bit pseudo-random code group R i (i=0, 1,2,3 … … n) to obtain a corresponding binary string. For a received set of probability values GP i Correspondingly outputting the binary string group B i For a received node group t k Correspondingly outputting the binary string group X i Wherein i=0, 1,2, 3..n, k=0, 1,2, 3..n.
As shown in fig. 3, the binarization module includes a pseudo-random code generating unit and a comparator, and an output end of the pseudo-random code generating module is connected with an input end of the comparator. During binarization processing, data to be processed is input to the other input end of the comparator, and the output end of the comparator outputs a corresponding binary string.
In one embodiment, the pseudo-random code generating unit is a shift register whose characteristic polynomial is a primitive polynomial:
in this embodiment, the primitive polynomial takes 10 th order, i.e., N takes 10, and N-bit random code R is generated by 110000101 feedback shift i N takes 256 bits, 512 bits, 1024 bits and 2048 bits respectively for experiments. The corresponding drawing results correspond to (a), (b), (c), and (d) in fig. 6 in order.
The probability calculation module uses X i The result S (i) =x of (i=0, 1,2, 3..n) bit addition corresponding to (i=0 0 (i)+X 1 (i)+X 2 (i)+...+X n (i) (i=1, 2 …, N) as multiplexing control terminal, B i (i=0, 1,2,..n) as a multiplexing coefficient inputEnd, output probability value group Y (i) =b S(i) (i=1,2...N)。
As shown in FIG. 4, the probability calculation module, in one embodiment, includes an adder and a multiplexer, the adder input for receiving X i (i=0, 1,2,..n) and the adder output is connected to the control of a multiplexer, the coefficient input of which is adapted to receive B i (i=0, 1,2,..n), the output of the multiplexer outputs Y (i) =b S(i) (i=1,2...N)。B S(i) The calculated truth table is shown in the following table:
input signal B Gating signal S Output signal Y
B 0 (1)B 0 (2)B 0 (3)...B 0 (N) 0 B 0 (t)
B 1 (1)B 1 (2)B 1 (3)...B 1 (N) 1 B 1 (t)
...... ......
B n (1)B n (2)B n (3)...B n (N) n B n (t)
The data decoding module decodes the received data (Y (i) (i=1, 2, and (N)) sequentially performing random decoding and normalized inverse operation to obtain the position coordinates of the drawing points.
The random decoding method comprises the following steps:
statistics of Y (1) Y (2) in "Y (N) the number of 1's is in proportion to the binary string. And carrying out normalization inverse operation by the formula (12) to obtain the position coordinates of the drawing points.
DY=Y(max(A 0 ,A 1 ,A 2 ....A n )-min(A 0 ,A 1 ,A 2 .....A n ))+min(A 0 ,A 1 ,A 2 ....A n ) (12),
DY is the AND input value t obtained by probability calculation k And control point group P 0 ,P 1 ,…P n And outputting coordinate values correspondingly. The B-spline curve can be directly drawn from the values of DY. As shown in fig. 5, for the cubic B-spline curve drawn by the position coordinates output by the system according to the present embodiment, the pseudo-random code length is selected to be 512 bits. The resulting errors are shown in the following table:
as shown in fig. 6, the curves (a), (B), (c), (d) correspond to 256-bit pseudorandom codes, 512-bit pseudorandom codes, 1024-bit pseudorandom codes, and 2048-bit pseudorandom codes in this order, which are cubic B-spline curves (other cubic B-spline curves are drawn similarly) drawn by the position coordinates outputted by the system according to the present embodiment. The errors of B-spline curves plotted for different length pseudorandom codes are as follows:
as can be seen from the above table, as the length of the pseudo-random code increases, the difference decreases, and the result becomes more and more accurate.
The critical path of the system of this embodiment is composed of adders, comparators, multiplexers, etc. As can be seen from fig. 3, the 3-order B-spline curve requires 6 comparators, 1 adder and 1 one-by-one multiplexer, the 4-order B-spline curve requires 8 comparators, 1 adder and 1 one-by-one multiplexer, and the n-order B-spline curve requires 2n comparators, 1 addition and 1 n+1 one-by-one multiplexer. Therefore, with the increasing number of times of the B-spline curve, the hardware required by the probability calculation method is increased linearly, and the calculation complexity is low.
The invention is not limited to the specific embodiments described above. The invention extends to any novel one, or any novel combination, of the features disclosed in this specification, as well as to any novel one, or any novel combination, of the steps of the method or process disclosed.

Claims (2)

1. The B spline curve generation method based on probability calculation is characterized by comprising the following steps of:
for input control point group P i Coordinate transformation is carried out on i=0, 1,2 and 3 … … n, and a corresponding control point coordinate set A is obtained i I=0, 1,2,3 … n; the coordinate transformation method comprises the following steps:
the expression of the B-spline curve is:
wherein P is 0 ,P 1 ,…P n A control point group for a B spline curve; n is the number of times of the B spline curve; t is an input node, and is a decimal value between 0 and 1; k is the kth control point, and the value range of k is 0,1,2 and … n;
the formula (1) is transformed and tidied to obtain the following formula:
for control point coordinate set A i Normalization processing is carried out to obtain a corresponding mapping value group GP i A step of i=0, 1, 2..n; the normalization method comprises the following steps:
GP i =(A i -min(A 0 ,A 1 ,A 2 .....A n ))/(max(A 0 ,A 1 ,A 2 ....A n )-min(A 0 ,A 1 ,A 2 .....A n ) I=0, 1, 2..n; wherein min (-) is the minimum function, max (-) is the maximum function, GP i Mapping values obtained for normalization; n-bit based pseudo-random code group R i I=0, 1,2, … n, for the set of mapping values GP i And input node group t k Binarization processing is respectively carried out on k=0, 1,2, 3..n to obtain a corresponding first binary string group B i I=0, 1, 2..n and a second binary string group X i I=0, 1, 2..n, the conversion process is completed based on a pseudo-random code set, the pseudo-random code set is generated by shifting a primitive polynomial, the primitive polynomial is used as a characteristic polynomial of a feedback shift register, and the pseudo-random code set can be generated, wherein the primitive polynomial isThe binarization processing process is a process of performing shift comparison on data to be binarized and a pseudo-random code with a preset length to obtain a comparison result; based on the second binary string group X i I=0, 1,2. Binary string group B i A step of multiplexing i=0, 1, 2..n to obtain a set of probability values; comprising the following steps: using an adder and a multiplexer to form a second binary string group X i As an input of the adder, the bits are added to S (1) S (2)..s (N), where S (i) =x 0 (i)+X 1 (i)+X 2 (i)+...+X n (i),i=1, 2..n; adder output S i I=1, 2..n as control terminal of the multiplexer, a first binary string group B i As the coefficient input end of the multiplexer, the output end of the multiplexer outputs Y (i) =B S(i) ,i=1,2...N;
Randomly decoding the probability value group, and carrying out normalized inverse operation on the decoding result to obtain a corresponding point coordinate group; the random decoding method comprises the following steps:the normalized inverse operation method comprises the following steps:
DY=Y(max(A 0 ,A 1 ,A 2 ....A n )-min(A 0 ,A 1 ,A 2 .....A n ))+min(A 0 ,A 1 ,A 2 ....A n ) The method comprises the steps of carrying out a first treatment on the surface of the DY is node group t with input k And control point group P 0 ,P 1 ,…P n Corresponding output coordinate values;
and drawing a corresponding B spline curve through the point coordinate set.
2. The B spline curve drawing system based on probability calculation is characterized by comprising a coordinate transformation module, a normalization module, a binarization module, a probability calculation module and a data decoding module which are connected in sequence; wherein:
the coordinate transformation module is used for inputting the control point group P i Coordinate transformation is carried out on i=0, 1,2 and 3 … … n, and a corresponding control point coordinate set A is output i I=0, 1,2,3 … n; the coordinate transformation method comprises the following steps:
the expression of the B-spline curve is:
wherein P is 0 ,P 1 ,…P n A control point group for a B spline curve; n is the number of times of the B spline curve; t is an input node, is a small value between 0 and 1A numerical value; k is the kth control point, and the value range of k is 0,1,2 and … n;
the formula (1) is transformed and tidied to obtain the following formula:
the normalization module is used for carrying out normalization processing on the received control point coordinate set and outputting a corresponding mapping value set; the normalization method of the normalization module comprises the following steps:
GP i =(A i -min(A 0 ,A 1 ,A 2 .....A n ))/(max(A 0 ,A 1 ,A 2 ....A n )-min(A 0 ,A 1 ,A 2 .....A n ) I=0, 1,2,..n; wherein min (-) is a minimum function, max (-) is a maximum function, n is the number of control point groups, A 0 ,A 1 ,A 2 .....A n For controlling the point coordinate set, GP i Mapping values obtained for normalization;
the binarization module is used for receiving the mapping value group GP output by the normalization module i Also received is an input node group t k K=0, 1,2, 3..n, the binarization module is for N-bit based pseudo-random code group R i I=0, 1,2, … n, performing binarization processing on the received data, outputting a corresponding binary string, outputting a first binary string group for the received probability value group, and outputting a second binary string for the received node group; the binarization module comprises a pseudo-random code generating unit and a comparator, wherein the pseudo-random code generating unit is a shift register, and a characteristic polynomial of the shift register is a primitive polynomial:the pseudo-random code generating unit is used for generating pseudo-random codes with preset length, the output end of the pseudo-random code generating unit is connected with the first input end of the comparator, the second input end of the comparator is used for receiving the output value of the normalization module,the output end of the comparator outputs a binary string corresponding to the data received by the second input end of the comparator;
the probability computation module multiplexing the first binary string based on the second binary string to output a set of probability values, comprising: the probability calculation module is based on the second binary string group X i I=0, 1,2 n. Corresponding bit addition result pair first binary string group B i I=0, 1,2 n. Performing multipath gating; the probability calculation module comprises an adder and a multiplexer, wherein the input end of the adder is used for receiving the second binary string group X i I=0, 1, 2..n, the adder output is connected to the control of the multiplexer, and the coefficient input of the multiplexer is used for receiving the first binary string set B i I=0, 1, 2..n, the output of the multiplexer outputting a set of probability values Y (i) =b S(i) ,i=1,2...N;
The data decoding module performs random decoding and normalized inverse operation on the received probability value group to obtain the position coordinates of the drawing points, and the random decoding method comprises the following steps:the normalized inverse operation method comprises the following steps:
DY=Y(max(A 0 ,A 1 ,A 2 ....A n )-min(A 0 ,A 1 ,A 2 .....A n ))+min(A 0 ,A 1 ,A 2 ....A n ) The method comprises the steps of carrying out a first treatment on the surface of the DY is node group t with input k And control point group P 0 ,P 1 ,…P n Corresponding output coordinate values; marking each drawing point on the graph to obtain a B spline curve.
CN201910378599.5A 2019-05-08 2019-05-08 B spline curve generation method and system based on probability calculation Active CN110097613B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910378599.5A CN110097613B (en) 2019-05-08 2019-05-08 B spline curve generation method and system based on probability calculation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910378599.5A CN110097613B (en) 2019-05-08 2019-05-08 B spline curve generation method and system based on probability calculation

Publications (2)

Publication Number Publication Date
CN110097613A CN110097613A (en) 2019-08-06
CN110097613B true CN110097613B (en) 2023-08-25

Family

ID=67447265

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910378599.5A Active CN110097613B (en) 2019-05-08 2019-05-08 B spline curve generation method and system based on probability calculation

Country Status (1)

Country Link
CN (1) CN110097613B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111325815B (en) * 2020-03-05 2023-05-02 成都威爱新经济技术研究院有限公司 Editing method of multi-level B spline curve
CN112836982B (en) * 2021-02-22 2023-06-23 长春汇通光电技术有限公司 Instruction list generation method and device and computer readable storage medium
CN115861547B (en) * 2023-02-15 2023-05-30 南京铖联激光科技有限公司 Model surface spline generating method based on projection

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007328522A (en) * 2006-06-07 2007-12-20 Tokyo Electric Power Co Inc:The Failure probability calculation device, method, and program
CN102222353A (en) * 2011-05-24 2011-10-19 南京信息工程大学 Curve drawing method based on secondary B spline iteration
CN103646422A (en) * 2013-12-19 2014-03-19 哈尔滨工程大学 Genetic multilayer B-spline interpolation algorithm based three-dimensional display method
CN107317701A (en) * 2017-06-13 2017-11-03 电子科技大学 A kind of network flow abnormal detecting method based on empirical mode decomposition

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007328522A (en) * 2006-06-07 2007-12-20 Tokyo Electric Power Co Inc:The Failure probability calculation device, method, and program
CN102222353A (en) * 2011-05-24 2011-10-19 南京信息工程大学 Curve drawing method based on secondary B spline iteration
CN103646422A (en) * 2013-12-19 2014-03-19 哈尔滨工程大学 Genetic multilayer B-spline interpolation algorithm based three-dimensional display method
CN107317701A (en) * 2017-06-13 2017-11-03 电子科技大学 A kind of network flow abnormal detecting method based on empirical mode decomposition

Also Published As

Publication number Publication date
CN110097613A (en) 2019-08-06

Similar Documents

Publication Publication Date Title
CN110097613B (en) B spline curve generation method and system based on probability calculation
Sarkis et al. Fast polar decoders: Algorithm and implementation
CN105955706B (en) A kind of divider and division operation method
CN111984227B (en) Approximation calculation device and method for complex square root
KR102581403B1 (en) Shared hardware logic unit and method for reducing die area
CN112256236A (en) FFT circuit based on approximate constant complex multiplier and implementation method
CN109375897B (en) Method for generating pseudo-random sequence
Xiong et al. Hardware implementation of an improved stochastic computing based deep neural network using short sequence length
CN110187866B (en) Hyperbolic CORDIC-based logarithmic multiplication computing system and method
CN111835671A (en) Method and device for generating four-phase Z complementary sequence pair with low PMEPR
CN108449091B (en) Polarization code belief propagation decoding method and decoder based on approximate calculation
Chen et al. A novel FIR filter based on stochastic logic
Anantharaman et al. Hardware implementation analysis of min-sum decoders
Yu et al. Approximate divider design based on counting-based stochastic computing division
CN108347250B (en) Fast coding method and apparatus suitable for small amount of redundant Reed-Solomon codes
Fathi et al. Ultra high speed modified booth encoding architecture for high speed parallel accumulations
Wu et al. Improving common subexpression elimination algorithm with a new gate-level delay computing method
CN110275693B (en) Multi-addend adder circuit for random calculation
JP3913921B2 (en) Circuit for reciprocal of arbitrary element in finite field
CN110457008B (en) m sequence generation method, device and storage medium
CN110096677B (en) Quick calculation method and system for high-order derivative function based on probability calculation
CN113971015B (en) UIA2 computing circuit, data processing method, chip, electronic device and storage medium
Arthireena et al. Efficient sign detection using parallel prefix adder
Stamenković et al. The use of residue number system in the design of the optimal all-pole IIR digital filters
CN113127802B (en) Complex logarithm implementation method, device and equipment based on CORDIC algorithm and computer storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant