# Study and Testing of Processing Trajectory Measurement Method of Flexible Workpiece

Authors: Yaohua Deng; Sicheng Chen; Bingjing Li; Jiayuan Chen; Liming Wu
Journal: Mathematical Problems in Engineering
 (2013)

---

## Abstract

Flexible workpiece includes the materials like elasticity spline, textile fabric, and polyurethane sponge, due to the fact that processing trajectory is composed by small arc or small line segment primitives and the deformation of the flexible workpiece during the processing trajectory, making the captured image of processing trajectory not clear, the edge of processing image over local uneven gray, and also the pixels of boundaries between the processing trajectory image edge and background organizations not obvious. This paper takes corner search of processing trajectory as the cut-in-point, slope angle curve of starting and terminal point of each primitive is also designed, put forward the search algorithm that regards Daubechies (4) as wavelet operator to conduct slope angle curve for multiple scales wavelet transform, by judging whether there is a point of the curve appears wavelet transform extremum to determine whether the point is a corner point based on wavelet edge modulus maxima extract principle. Finally, proposed a decomposition/reconstruction design method of FIR filters based on wavelet transform of processing image. Eight-tap transpose FIR filter is used to design the decomposition of Daubechies (4) and reconfigurable computing IP core. The IP core wavelet decomposition of the total time-consuming increases only 5.561% in comparsion with PC. Trajectory angle relative error is 2.2%, and the average measurement time is 212.38 ms.


---

## Body

## 1. Introduction

Flexible workpiece trajectory processing refers to the procedure of conducting all kinds of complicated image processing in workpiece which is consisted of multilayer soft material, and emerged some uneven pattern on the surface of workpiece [1, 2]. Straightness, roundness, and primitives angle error geometrical are the important measurement parameters of machining profile of flexible workpiece trajectory processing which is an important indicator of evaluating the trajectory processing precision, also providing a basis for the processing feedback compensation control [3]. However, the edge and corner of the pattern of flexible workpiece processing trajectory are fuzzy and shaped; the extraction of processing image feature information (such as edges, corners and shapes) is a key issue in processing trajectory visual measure method. At present, there are two main kinds of fuzzy edge detection algorithms: Pal fuzzy edge detection algorithm and multiresolution image detection algorithm. Pal and King put forward the Pal fuzzy edge detection algorithm that the awaiting image is mapped into fuzzy membership matrix; maximum and minimum operator are used to extract edge [4] from the viewpoint that the uncertainty of the image is caused by the fuzziness, while Shi Chengxiang puts forward the extended multiscale fuzzy edge detection algorithm that extends 8 neighborhood to 16 of gray, making a merger of wavelet multiscale and fuzzy theory and using competition rules to select the edge points from the viewpoint that the image pixel of the edges changes in different neighborhoods gray [5]. Literature [6] puts forward an error compensation method that consists of an element-free error interpolation scheme and a recursive software error compensation scheme. Literature [7] proposes a density-based clustering algorithm for trajectory data stream.Flexible workpiece includes the materials like elasticity spline, textile fabric, and polyurethane sponge; its material mode shows the physics nonlinearity or geometry nonlinearity, macroscopic property respond to low rigidity intensity, low elasticity modulus, soft mechanics property, and so on. The processing trajectory discussed in this paper refers to processing completion in flexible workpiece, with the following characteristics.(1) The deformation is generated by extruding during the process of flexible workpiece trajectory processing; there is a certain lag about elastic recovery of workpiece after processing, it will make the captured image not clear especially the edges of the image over local gray uneven near the trajectory. (2) Due to the fact that processing trajectory is composed by small arc or small line segment primitives and the diversity of geometry, the pixels of boundaries between the processing trajectory image and background organizations are not obvious in the convergence department of small arc and small line segment. Thinking about the edge blur and diversity of geometry of flexible workpiece processing trajectory pattern, the edge detection based on multiscale fuzzy and rapid positioning of the image corner is the key to accurately measure trajectory profile. This paper focuses on the measurement of the angle error due to the fact that the processing angle error can evaluate processing effects of right, sharp angle and line or arc which are the composition of the angle and can be easily measured online.


## 2. Mathematical Description and Measurement Ideas of Flexible Workpiece Processing Trajectory Angle

The trajectory straightness errorfl, angle error fa, and roundness error fc all can reflect the deviation of trajectory, owing to the fact that the angle error fa can evaluate the integration processing effects of right angles, sharp corners, and the included angle which consists of straight lines or arcs, and the angle error fa can measure online easily, so the paper focuses on the method of flexible workpiece trajectory processing distortion compensation control with angle error fa that can measure feedback. Processing trajectory is composed by small arc or small line segment primitives; Figures 1 to 3 are the three types of processing trajectory element angle (including straight line-straight line-angle al-l, arc-arc-angle ac-c, and straight line-arc-angle al-c). From Figures 1 to 3 we can know that the angle of the handover of lines and line segments is easy to obtain; as for seeking the angle of handover of arc and line segment (or arc), we must firstly seek the arc tangent, and then the angle between tangent and line segment; therefore, the actual angle can be found by correctly extracting line segment, arc profile of processing trajectory.(1)
Straight-Straight-Angleal-lof Figure1. L1, L2 are the processing trajectory fitting straight lines AB, BC after the extraction of profile al-l is the angle between the two straight lines, A1, B1, C1 and A2, B2, and C2 are constants; formula (1) can be obtained by the linear equation of L1, L2:
(1)L1:A1x+B1y+C1=0L2:A2x+B2y+C2=0⟹al-l=arccos|A1A2+B1B2|A12+B12·A22+B22.(2)
Arc-Arc-Angleac-cof Figure2.  M(x0,y0) is the intersection point of two extracted fitting arcs trajectory R1, R2; arc-arc-angle ac-c is formed by tangents L1, L2 of circle P1, P2, D1, E1, F1, and D2, E2, F2 are the geometric equation coefficients of circle P1, P2; formula (2) can be obtained by the tangents equation of L1, L2:
(2)L1:(x0+D12)x+(y0+E12)y+D12x0+E12y0+F1=0L2:(x0+D22)x+(y0+E22)y+D22x0+E22y0+F2=0⟹ac-c=arccos(·(x0+D22)2+(y0+E22)2)-1(|x02+y02+D1+D22x0+E1+E22y0+D1D2+E1E24|)×((x0+D12)2+(y0+E12)2·(x0+D22)2+(y0+E22)2)-1).(3)
Straight Line-Arc-Angleal-cof Figure3. straight line-arc-angle al-c is formed by fitting straight line L1 of straight line trajectory and the tangent L2 of fitting arc R1 of arc trajectory. A1, B1, and C1 are constants, D1, E1, and F1 are the geometric equation coefficients of circle P1, and formula (3) can be obtained by straight line L1 and tangent equation L2:
(3)L1:A1x+B1y+C1=0L2:(x0+D12)x+(y0+E12)y+D12x0+E12y0+F1=0⟹al-c=arccos(·(x0+D12)2+(y0+E12)2)-1(|A1x0+B1y0+D12A1+E12B1|)×(·(x0+D12)2+(y0+E12)2)-1A12+B12·(x0+D12)2+(y0+E12)2A12+B12)-1).Figure 4 is the flow chart of processing trajectory angle measurement. The processing is composed by the following parts. Firstly, PAL analog camera collects and processes image video information; the information enters into image sensor signal acquisition module after it converted to digital video through decoder chip TVP5150. Secondly, conduct wavelet transform of processing image, thirdly, extract processing trajectory profile. Finally, locate the origin and terminal of primitive, and calculate the angle of primitives.Figure 1
Straight line-straight line.Figure 2
Arc-arc.Figure 3
Straight-arc.Figure 4
Flow chart of processing trajectory angle measurement.


## 3. Angle Measurement and Implementation of Flexible Workpiece Processing Trajectory Base on Wavelet Multiscale

Angle measurement of flexible workpiece processing trajectory is based on the wavelet decomposition of processing image; measure angle can be obtained by extracting processing trajectory profile, determining corner of each trajectory primitive (the start and terminal position of primitive), and drawing out the angle measurement auxiliary line. Since the processing trajectory profile can be extracted through wavelet modulus maxima [8, 9], in the following content, the positioning algorithm of starting, terminal points position will be discussed combining the information processing of wavelet multiscale [10].


### 3.1. Corner Multiscale Wavelet Positioning Algorithm of the Flexible Workpiece Processing Trajectory

For closed processing trajectory of geometric patterns, the place where starting, terminal points of primitive located is also the place of each corner in the trajectory; they are in the greater curvature of the trajectory image profile. As Figure5 shows, the curve ϕ(p)-p can be obtained by obtaining the slope angle ϕ(p) of each point p along the processing trajectory profile, and the corner region of each corner shows a step change on the curve; the sharper the corner is, the greater the step amplitude will be. If the adjacent angle curves ϕ(p) are not overlapped, the corner of the corner point is in the range of {p-q~p+q} (q≤3, and is an integer), the slope is represented by k, the constant is represented by C, and assuming its curve ϕ(p)-p is monotonic rise (or fall), in that way, the curve can be seen as Figure 6 shows, a monotonic rise curve composed by three lines; the curve equation is shown as follows:
(4)ϕ(p)={C,p<-qk(p+q)+C,-q≤p≤q2kq+C,p>q.Figure 5
The slope curveϕ(p)-p of processing trajectory profile.Figure 6
Piecewise linear approximation of the curveϕ(p)-p.According to extraction algorithm of wavelet edge modulus maxima, at an arbitrary point(x1,x2) of the image, if the modulus value Mjf(x1,x2) is a local maxima along given gradient direction of the argument Ajf(x1,x2), it is considered as the proof of an edge point [9, 10]; the curve ϕ(p)-p can be conducted multiple scales wavelet transform and by judging whether a point of the curve appears wavelet transform extrema to determine whether that point is a corner one.Lets be the scale factor, cubic spline is smooth function θ(p), and φs(p) is the first derivative of θ(p), let φs(p) be the basic wavelet; therefore,
(5)θ(p)={a1|p|3-b1|p|2+d1,|p|≤0.5,-a2|p|3+b2|p|2-c2|p|+d2,0.5≤|p|≤10,|p|≥1,,(6)φs(p)={3a1|p|3p-2b1|p|2p,|p|≤0.5,-3a2|p|3p+2b2|p|2p-c2|p|p,0.5≤|p|≤1,0,|p|≥1.φs(i) conducts wavelet transform on ϕ(i):
(7)WTϕ(s,p)=ϕ(p)*φs(p)=ϕ(p)*ddpθ(ps)=[ddpϕ(p)]*θ(ps)=k∫p-qp+qθ(p-us)du.
It can be seen that extremum of WTϕ(s,p) appears in the place where p=0; that is,
(8)|WTϕ(s,p)|max=|WTϕ(s,0)|=k∫-q+qθ(us)du=k∫-q+q(a1|us|3-b1|us|2+d1)du=k∫-q0(-a1(us)3-b1(us)2+d1)du+k∫0+q(a1(us)3-b1(us)2+d1)du⟹|WTϕ(s,p)|max=k(a1q42s3-b1q33s2+2d1q).Then, the extrema ratio of two different scale factorss1, s2 (s1<s2), can be obtained as formula (9).Therefore, corner detection procedure of processing trajectory image is expressed as follows.(1) Extract the edge profile of processing image trajectory based on wavelet edge rapid extraction algorithm. (2) Calculate the wavelet transform WTϕ(s,p) of ϕ(p) in the three adjacent scales s=2-1, 2-2, and 2-3, and the result is stored in the specified array. (3) Detect the extremum |WTϕ(s,p)|max in three adjacent scales of WTϕ(s,p), if there is wavelet extrema in each corresponding position of the three adjacent scales and its value is not less than the set value Ts, the corner is a candidate one. (4) Calculate the extrema ratio K(s1,s2) of two different scale factors while s1=24, s2=26, or s1=25, s2=27, if Kl<K<Ku (0.9<Kl<1, 0.9<Ku<1), the corner is a candidate one, otherwise, forgone the corner:
(9)K(s1,s2)=|WTϕ(s1,0)|max|WTϕ(s2,0)|max=∫-q+qθ(u/s1)du∫-q+qθ(u/s2)du=∫0+qθ(u/s1)du∫0+qθ(u/s1)du=a1q4/4s13-b1q3/3s12+d1qa1q4/4s23-b1q3/3s22+d1q.


### 3.2. Hardware Implementation of Processing Image Wavelet Transform of FIR Filter Accelerating Decomposition/Reconstruction

Letf(x1,x2) be the flexible workpiece trajectory processing image. A1f(x1,x2) reflects low-frequency components in both the horizontal direction (x1) and vertical direction (x2) after conducting the two-dimensional wavelet transform of processing image, d1(1)f(x1,x2) reflects the low-frequency components in direction x1 and high-frequency components in direction x2, and d1(2)f(x1,x2) reflects the high-frequency components in direction x1 and low-frequency components in direction x2, d1(3)f(x1,x2) reflects high-frequency in both directions x1, x2 [11]; L represents the low-pass filter having the impulse response and H represents the high-pass filter having the impulse response, according to Mallat algorithm, wavelet decomposition, or reconstruction of f(x1,x2) is consisted of several levels high-pass filter H and low-pass filter L, H, L can be built by using finite length (FIR) filter as Figure 7 shows when the filter coefficients is known [12–14].Figure 7
Structure of FIR filter with the lengthk.Based on Figure9, choose Daubechies (4) as the filter of wavelet decomposition and reconstruction procedure of f(x1,x2); since the wavelet filter coefficients are eight, each H, L filter can be built by 8 gap FIR filter.Figure8 is the structure of FIR filter based on Xilinx VC4VSX25 FPGA and DSP48 Slice of Xilinx Xtreme DSP.Figure 8
Structure of 8 gap FIR filter based on DSP48 Slice.Figure 9
Eight-tap FIR filter FSL control state machine.(
1
) Configure port OPMODE = 0000101 of the left first DSP48 slice in the figure while other OPMODE = 0010101, port A of all levels are the input terminal of image signal x[n], expressing it in complement; data width is 18 bits, including 1 sign bit, 9 integer bits and 8 decimal bits. (2) Response of Daubechies (4) filter coefficients Coef(k) of each level is stored in register B, expressing it in complement; data width is 18 bits, including 1 sign bit and 17 decimal bits. By connecting port BCIN, BCOUT of all levels of register B to form a register chain, it can easily modify the entire filter coefficients of all levels by operating port B of the first level DSP48. (3) The input CIN and output COUT of processing results at all levels interconnect; the final result y[n] is output through port B, with the width 48 bits. As for the input of 8-bit image pixel, the data is first shifted to the left by 8 and then input; finally output intercept high 32 bits (4) 8-tap FIR filter is connected to VC4VSX25 FPGA embedded Microblaze Processor in coprocessing way, performing data communication through interface of fast single-link bus FSB bus and control logic state machine is consisted of awaiting image data input (IDLE), configuration register coefficient (CONFIG), and start filter (EXEC) three states. The switch of each state is controlled by the two signals FSL_S_ Exists and FSL_S_ Control of FSL interface. Figure 9 is an 8-tap FIR filter FSL control state machine.


## 3.1. Corner Multiscale Wavelet Positioning Algorithm of the Flexible Workpiece Processing Trajectory

For closed processing trajectory of geometric patterns, the place where starting, terminal points of primitive located is also the place of each corner in the trajectory; they are in the greater curvature of the trajectory image profile. As Figure5 shows, the curve ϕ(p)-p can be obtained by obtaining the slope angle ϕ(p) of each point p along the processing trajectory profile, and the corner region of each corner shows a step change on the curve; the sharper the corner is, the greater the step amplitude will be. If the adjacent angle curves ϕ(p) are not overlapped, the corner of the corner point is in the range of {p-q~p+q} (q≤3, and is an integer), the slope is represented by k, the constant is represented by C, and assuming its curve ϕ(p)-p is monotonic rise (or fall), in that way, the curve can be seen as Figure 6 shows, a monotonic rise curve composed by three lines; the curve equation is shown as follows:
(4)ϕ(p)={C,p<-qk(p+q)+C,-q≤p≤q2kq+C,p>q.Figure 5
The slope curveϕ(p)-p of processing trajectory profile.Figure 6
Piecewise linear approximation of the curveϕ(p)-p.According to extraction algorithm of wavelet edge modulus maxima, at an arbitrary point(x1,x2) of the image, if the modulus value Mjf(x1,x2) is a local maxima along given gradient direction of the argument Ajf(x1,x2), it is considered as the proof of an edge point [9, 10]; the curve ϕ(p)-p can be conducted multiple scales wavelet transform and by judging whether a point of the curve appears wavelet transform extrema to determine whether that point is a corner one.Lets be the scale factor, cubic spline is smooth function θ(p), and φs(p) is the first derivative of θ(p), let φs(p) be the basic wavelet; therefore,
(5)θ(p)={a1|p|3-b1|p|2+d1,|p|≤0.5,-a2|p|3+b2|p|2-c2|p|+d2,0.5≤|p|≤10,|p|≥1,,(6)φs(p)={3a1|p|3p-2b1|p|2p,|p|≤0.5,-3a2|p|3p+2b2|p|2p-c2|p|p,0.5≤|p|≤1,0,|p|≥1.φs(i) conducts wavelet transform on ϕ(i):
(7)WTϕ(s,p)=ϕ(p)*φs(p)=ϕ(p)*ddpθ(ps)=[ddpϕ(p)]*θ(ps)=k∫p-qp+qθ(p-us)du.
It can be seen that extremum of WTϕ(s,p) appears in the place where p=0; that is,
(8)|WTϕ(s,p)|max=|WTϕ(s,0)|=k∫-q+qθ(us)du=k∫-q+q(a1|us|3-b1|us|2+d1)du=k∫-q0(-a1(us)3-b1(us)2+d1)du+k∫0+q(a1(us)3-b1(us)2+d1)du⟹|WTϕ(s,p)|max=k(a1q42s3-b1q33s2+2d1q).Then, the extrema ratio of two different scale factorss1, s2 (s1<s2), can be obtained as formula (9).Therefore, corner detection procedure of processing trajectory image is expressed as follows.(1) Extract the edge profile of processing image trajectory based on wavelet edge rapid extraction algorithm. (2) Calculate the wavelet transform WTϕ(s,p) of ϕ(p) in the three adjacent scales s=2-1, 2-2, and 2-3, and the result is stored in the specified array. (3) Detect the extremum |WTϕ(s,p)|max in three adjacent scales of WTϕ(s,p), if there is wavelet extrema in each corresponding position of the three adjacent scales and its value is not less than the set value Ts, the corner is a candidate one. (4) Calculate the extrema ratio K(s1,s2) of two different scale factors while s1=24, s2=26, or s1=25, s2=27, if Kl<K<Ku (0.9<Kl<1, 0.9<Ku<1), the corner is a candidate one, otherwise, forgone the corner:
(9)K(s1,s2)=|WTϕ(s1,0)|max|WTϕ(s2,0)|max=∫-q+qθ(u/s1)du∫-q+qθ(u/s2)du=∫0+qθ(u/s1)du∫0+qθ(u/s1)du=a1q4/4s13-b1q3/3s12+d1qa1q4/4s23-b1q3/3s22+d1q.


## 3.2. Hardware Implementation of Processing Image Wavelet Transform of FIR Filter Accelerating Decomposition/Reconstruction

Letf(x1,x2) be the flexible workpiece trajectory processing image. A1f(x1,x2) reflects low-frequency components in both the horizontal direction (x1) and vertical direction (x2) after conducting the two-dimensional wavelet transform of processing image, d1(1)f(x1,x2) reflects the low-frequency components in direction x1 and high-frequency components in direction x2, and d1(2)f(x1,x2) reflects the high-frequency components in direction x1 and low-frequency components in direction x2, d1(3)f(x1,x2) reflects high-frequency in both directions x1, x2 [11]; L represents the low-pass filter having the impulse response and H represents the high-pass filter having the impulse response, according to Mallat algorithm, wavelet decomposition, or reconstruction of f(x1,x2) is consisted of several levels high-pass filter H and low-pass filter L, H, L can be built by using finite length (FIR) filter as Figure 7 shows when the filter coefficients is known [12–14].Figure 7
Structure of FIR filter with the lengthk.Based on Figure9, choose Daubechies (4) as the filter of wavelet decomposition and reconstruction procedure of f(x1,x2); since the wavelet filter coefficients are eight, each H, L filter can be built by 8 gap FIR filter.Figure8 is the structure of FIR filter based on Xilinx VC4VSX25 FPGA and DSP48 Slice of Xilinx Xtreme DSP.Figure 8
Structure of 8 gap FIR filter based on DSP48 Slice.Figure 9
Eight-tap FIR filter FSL control state machine.(
1
) Configure port OPMODE = 0000101 of the left first DSP48 slice in the figure while other OPMODE = 0010101, port A of all levels are the input terminal of image signal x[n], expressing it in complement; data width is 18 bits, including 1 sign bit, 9 integer bits and 8 decimal bits. (2) Response of Daubechies (4) filter coefficients Coef(k) of each level is stored in register B, expressing it in complement; data width is 18 bits, including 1 sign bit and 17 decimal bits. By connecting port BCIN, BCOUT of all levels of register B to form a register chain, it can easily modify the entire filter coefficients of all levels by operating port B of the first level DSP48. (3) The input CIN and output COUT of processing results at all levels interconnect; the final result y[n] is output through port B, with the width 48 bits. As for the input of 8-bit image pixel, the data is first shifted to the left by 8 and then input; finally output intercept high 32 bits (4) 8-tap FIR filter is connected to VC4VSX25 FPGA embedded Microblaze Processor in coprocessing way, performing data communication through interface of fast single-link bus FSB bus and control logic state machine is consisted of awaiting image data input (IDLE), configuration register coefficient (CONFIG), and start filter (EXEC) three states. The switch of each state is controlled by the two signals FSL_S_ Exists and FSL_S_ Control of FSL interface. Figure 9 is an 8-tap FIR filter FSL control state machine.


## 4. Testing Laboratory

Figure10 is physical photo of the Xilinx FPGA IP core verification platform. Experimental hardware environment is Computer PC, Intel Core i5 processor, the operating frequency 2.19 GHz, memory 2 GB, Xilinx VC4VSX25 FPGA development system; software environment is Microsoft Windows XP Professional operating system, Xilinx ISE10.1i EDK 10.1i Modelsim6.5, MATLAB R2008a. To establish IP core verification project by using Xilinx Platform Studio (XPS), the frequency of MicroBlaze Processor processor is 165 Mhz and PLB bus clock cycle is 1 × 105 ms. Processing trajectory image (grayscale image) of Figure 11 is taken as test picture, with the size of 720 × 576 pixels; Daubechies (4) filter is choose as wavelet transform [11].Figure 10
Xilinx FPGA IP core verification platform.Figure 11
Test picture of flexible workpiece trajectory processing.


### 4.1. FIR Hardware Implementation Test of the Processing Image Wavelet Transform

Conduct a two-stage wavelet decomposition on trajectory processing test image, with each stage including the horizontal and vertical direction wavelet decomposition, image decomposition effect, and wavelet decomposition timeTwmrt of each stage.(
1
) Wavelet decomposition of processing image is divided into 2 levels: the first level of decomposition includes 2 stages; the first stage is the wavelet transform in vertical direction, and in this stage, the low-frequency component is in the upper half part of the image, while high-frequency component is in the below half part; the decomposition results can be seen in Figure 12(a). The second stage is the wavelet transform in horizontal direction; in this stage, the low-frequency component is in the left half part of the image, while high-frequency component is in the right half part; the decomposition results can be seen in Figure 12(b). The second level decomposition also includes 2 stages; the first stage is the wavelet transform in horizontal direction, and in this stage, the low-frequency component is in the left half part of the image, while high-frequency component is in the right half part; the decomposition results can be seen in Figure 13(a). The second stage is the wavelet transform in vertical direction; in this stage, the low-frequency component is in the left half part of the image, while high-frequency component is in the right half part; the decomposition results can be seen in Figure 13(b).Decomposition result of the first level wavelet transform.
(a)
The first stage
(b)
The second stageDecomposition result of the first level wavelet transform.
(a)
The first stage
(b)
The second stageFrom Figures12 and 13, we can know that frequency components of the first and second level decomposition relative to wavelet decomposition result of f(x1,x2) given in Section 3.2.Figure14 is the processing image after conducting wavelet transform reconstruction; the image is nearly the same with original drawing in Figure 11, proving that the correctness of designing processing image wavelet transform of FIR filter for image decomposition and reconstruction.Figure 14
Reconstruction image Wavelet decomposition.(
2
) In the condition that PLB bus clock cycle is 1 × 105 ms, make a test of 11 times about the time required to FIR filter wavelet decomposition, respectively, statistic the consuming time of two levels wavelet decomposition Twmrtc1, Twmrtc2, and the total consuming time Twmrt, and make a comparation with consuming time Twmrtpc of computer PC. The total consuming time of two levels wavelet decomposition calculated by hardware in Table 1 is Twmrt=Twmrtc1+Twmrtc2≈130.27 ms which is 5.561% longer than Twmrtpc≈123.41 ms the calculated time of PC.Table 1
Time-consuming comparison table of wavelet decomposition.
Testing times
Consuming time of two levels wavelet decomposition calculated by hardware (ms)
Consuming  time of PC (ms)
First-stage  decomposition
Second-stage decomposition
Decomposition
Matrix transpose
Summation
Decomposition
Matrix transpose
Summation
1
34.6506
0.00000
34.6506
74.2829
21.3355
95.6184
123.4057
2
34.6506
0.00000
34.6506
74.2827
21.3355
95.6182
123.4058
3
34.6507
0.00000
34.6507
74.2828
21.3355
95.6183
123.4056
4
34.6506
0.00000
34.6506
74.2828
21.3355
95.6183
123.4056
5
34.6507
0.00000
34.6507
74.2828
21.3355
95.6183
123.4057
6
34.6506
0.00000
34.6506
74.2828
21.3355
95.6183
123.4056
7
34.6506
0.00000
34.6506
74.2829
21.3355
95.6184
123.4058
8
34.6506
0.00000
34.6506
74.2827
21.3355
95.6182
123.4055
9
34.6506
0.00000
34.6506
74.2828
21.3355
95.6183
123.4056
10
34.6506
0.00000
34.6506
74.2826
21.3355
95.6181
123.4058
11
34.6506
0.00000
34.6506
74.2828
21.3355
95.6183
123.4058
Average value
T
wmr
t
c
1
≈ 34.65
T
wmr
t
c
2
≈ 95.62
T
wmr
t
pc
≈ 123.41


### 4.2. The Angle Measurement Laboratory of Processing Trajectory

Leta1=8, b1=8, d1=1.33,Kl=0.93, Ku = 0.95, and  q= 1, put them into formula (6), and make a search for the corner in specified region of processing trajectory image which is shown in Figure 15 (arc primitive R1, R2), and Figure 16 shows that the testing results of origin and terminal location.Figure 15
Processing trajectory image.Figure 16
Positioning results of primitive starting, terminal corner.It can be seen that algorithm can accurately locate the position of the corner, the position where the starting, terminal points are of arc primitiveR1, R2. In order to make a further test of angles R1, R2, firstly take 12 fitting points of each arc R1, R2 and search outwardly with the length of 20 pixels, finally the fitting circles P1, P2 can be got. Combining with calculation formula (2) of arc-arc angle, the angle of arc primitive R1, R2 can be calculated (see Figure 17). Table 2 is the comparison table of measured value resulting from repeating 10 times measurements and actual value; the average relative error of measurement method is 2.2% and the average measured time is 212.38 ms.Table 2
Comparison table of angle measurement.
Testing times
Angle measurement
Testing  time (ms)
Realvalue (°)
Measure value (°)
Relative error
1
32.50
33.24
2.28
212.38
2
32.50
33.21
2.18
212.38
3
32.50
33.23
2.25
212.38
4
32.50
33.19
2.12
212.38
5
32.50
33.24
2.28
212.38
6
32.50
33.21
2.18
212.38
7
32.50
33.19
2.12
212.38
8
32.50
33.23
2.25
212.38
9
32.50
33.21
2.18
212.38
10
32.50
33.22
2.22
212.38
Average value
2.2
212.38Figure 17
Measure result of trajectory angle.


## 4.1. FIR Hardware Implementation Test of the Processing Image Wavelet Transform

Conduct a two-stage wavelet decomposition on trajectory processing test image, with each stage including the horizontal and vertical direction wavelet decomposition, image decomposition effect, and wavelet decomposition timeTwmrt of each stage.(
1
) Wavelet decomposition of processing image is divided into 2 levels: the first level of decomposition includes 2 stages; the first stage is the wavelet transform in vertical direction, and in this stage, the low-frequency component is in the upper half part of the image, while high-frequency component is in the below half part; the decomposition results can be seen in Figure 12(a). The second stage is the wavelet transform in horizontal direction; in this stage, the low-frequency component is in the left half part of the image, while high-frequency component is in the right half part; the decomposition results can be seen in Figure 12(b). The second level decomposition also includes 2 stages; the first stage is the wavelet transform in horizontal direction, and in this stage, the low-frequency component is in the left half part of the image, while high-frequency component is in the right half part; the decomposition results can be seen in Figure 13(a). The second stage is the wavelet transform in vertical direction; in this stage, the low-frequency component is in the left half part of the image, while high-frequency component is in the right half part; the decomposition results can be seen in Figure 13(b).Decomposition result of the first level wavelet transform.
(a)
The first stage
(b)
The second stageDecomposition result of the first level wavelet transform.
(a)
The first stage
(b)
The second stageFrom Figures12 and 13, we can know that frequency components of the first and second level decomposition relative to wavelet decomposition result of f(x1,x2) given in Section 3.2.Figure14 is the processing image after conducting wavelet transform reconstruction; the image is nearly the same with original drawing in Figure 11, proving that the correctness of designing processing image wavelet transform of FIR filter for image decomposition and reconstruction.Figure 14
Reconstruction image Wavelet decomposition.(
2
) In the condition that PLB bus clock cycle is 1 × 105 ms, make a test of 11 times about the time required to FIR filter wavelet decomposition, respectively, statistic the consuming time of two levels wavelet decomposition Twmrtc1, Twmrtc2, and the total consuming time Twmrt, and make a comparation with consuming time Twmrtpc of computer PC. The total consuming time of two levels wavelet decomposition calculated by hardware in Table 1 is Twmrt=Twmrtc1+Twmrtc2≈130.27 ms which is 5.561% longer than Twmrtpc≈123.41 ms the calculated time of PC.Table 1
Time-consuming comparison table of wavelet decomposition.
Testing times
Consuming time of two levels wavelet decomposition calculated by hardware (ms)
Consuming  time of PC (ms)
First-stage  decomposition
Second-stage decomposition
Decomposition
Matrix transpose
Summation
Decomposition
Matrix transpose
Summation
1
34.6506
0.00000
34.6506
74.2829
21.3355
95.6184
123.4057
2
34.6506
0.00000
34.6506
74.2827
21.3355
95.6182
123.4058
3
34.6507
0.00000
34.6507
74.2828
21.3355
95.6183
123.4056
4
34.6506
0.00000
34.6506
74.2828
21.3355
95.6183
123.4056
5
34.6507
0.00000
34.6507
74.2828
21.3355
95.6183
123.4057
6
34.6506
0.00000
34.6506
74.2828
21.3355
95.6183
123.4056
7
34.6506
0.00000
34.6506
74.2829
21.3355
95.6184
123.4058
8
34.6506
0.00000
34.6506
74.2827
21.3355
95.6182
123.4055
9
34.6506
0.00000
34.6506
74.2828
21.3355
95.6183
123.4056
10
34.6506
0.00000
34.6506
74.2826
21.3355
95.6181
123.4058
11
34.6506
0.00000
34.6506
74.2828
21.3355
95.6183
123.4058
Average value
T
wmr
t
c
1
≈ 34.65
T
wmr
t
c
2
≈ 95.62
T
wmr
t
pc
≈ 123.41


## 4.2. The Angle Measurement Laboratory of Processing Trajectory

Leta1=8, b1=8, d1=1.33,Kl=0.93, Ku = 0.95, and  q= 1, put them into formula (6), and make a search for the corner in specified region of processing trajectory image which is shown in Figure 15 (arc primitive R1, R2), and Figure 16 shows that the testing results of origin and terminal location.Figure 15
Processing trajectory image.Figure 16
Positioning results of primitive starting, terminal corner.It can be seen that algorithm can accurately locate the position of the corner, the position where the starting, terminal points are of arc primitiveR1, R2. In order to make a further test of angles R1, R2, firstly take 12 fitting points of each arc R1, R2 and search outwardly with the length of 20 pixels, finally the fitting circles P1, P2 can be got. Combining with calculation formula (2) of arc-arc angle, the angle of arc primitive R1, R2 can be calculated (see Figure 17). Table 2 is the comparison table of measured value resulting from repeating 10 times measurements and actual value; the average relative error of measurement method is 2.2% and the average measured time is 212.38 ms.Table 2
Comparison table of angle measurement.
Testing times
Angle measurement
Testing  time (ms)
Realvalue (°)
Measure value (°)
Relative error
1
32.50
33.24
2.28
212.38
2
32.50
33.21
2.18
212.38
3
32.50
33.23
2.25
212.38
4
32.50
33.19
2.12
212.38
5
32.50
33.24
2.28
212.38
6
32.50
33.21
2.18
212.38
7
32.50
33.19
2.12
212.38
8
32.50
33.23
2.25
212.38
9
32.50
33.21
2.18
212.38
10
32.50
33.22
2.22
212.38
Average value
2.2
212.38Figure 17
Measure result of trajectory angle.


## 5. Conclusions

(1)
According to the fact that processing trajectory is composed by small arc or small line segment primitives and the pixels of boundaries between the processing trajectory image and study a search algorithm of origin and terminal location combined with wavelet multiscal algorithm, the results show that relative error and average measure time of trajectory angle is 2.2% and 212.38 ms.
(2)
FIR filters accelerated decomposition/reconstruction design method of processing image wavelet transform is put forward. Eight-tap transpose FIR filter is used to design the decomposition of Daubechies(4) and reconfigurable computing IP core; total consuming time Twmrt of the two level hardware core wavelet decomposition is only 5.561% longer than Twmrtpcthe calculated time of PC.



---

*Source: 798274-2013-11-13.xml*