 Research
 Open Access
 Published:
Modeling of the highperformance PLDbased sectioning method for classification of the shape of optical object images
SpringerPlus volume 2, Article number: 692 (2013)
Abstract
An analysis of the sectioning method to control a shape of the laser beam spot is conducted in this paper. A possibility is discussed to use a form factor for solving the problem raised, and the experimental study of the sectioning method and the form factor for control of the shape of the laser beam spot was conducted. A PLDbased technical implementation of the method was realized.
Introduction
Rapidly growing requirements to modern computational media encourage development of new intelligent methods of information transfer and processing. Rigid requirements to realtime information processing systems force scientists to regularly create and upgrade data transfer systems. Today most internet channels cannot provide data exchange of the required quality between such systems, which, in turn, results in the congestion of those channels and formation of socalled digital bottlenecks. A possible solution of the problem of transfer of large volumes of information is to use a fiberoptic cable, but laying such cable is rather expensive, even on short distances. At the same time, this problem can be solved through application of the laserbased technologies (Khosrofian and Garetz, 1983; Kozhemyako et al., 2003; Basov et al., 1998), one of the most promising models of information transfer for the near future. In this case, for instance, tons of fulllength films and virtual worlds could be transferred to any part of the globe in a blink of an eye.
Most satellites transmit information, such as TV programs, by means of microwave radiation, while laserbased information transmission could be hundreds of times faster, which, in turn, will considerably increase the carrying capacity of the channel.
The laserbased information transmission requires that both a satellite and a receiving unit (RU) were located in a certain position. A position of the RU lens, whose diameter is only several centimeters, must be adjusted to one thousandth degree, otherwise the information transmission will not happen.
During the process of tracing a satellite by a receiving unit, one of the main tasks is to classify a shape of the laser beam spot image, namely, its geometrical characteristics distorted by turbulence and air masses.
To solve a problem of classification and increase an accuracy of determination of the spot object center (Mana et al., 2001; Orlov and Neverova, 2003) by means of the maximal usage of its informational characteristics, frames of the series of laser beam spot images should be classified in order to filter the laser route from significantly noisedistorted images.
Known methods of analysis of the optical object shape, for instance described in (Magnes et al., 2010; Wright et al., 2011; Gannot et al., 2002), due to complexity of operations performed do not allow estimate their shape properly with simple computer aids. That’s why image processing using the PLD is particularly relevant in our time (Hartmann et al., 2008; Chien and Chen, 2008).
A goal of the work is to solve a scientific problem of developing a computationally simple and therefore highperforming classification method of surfaces of laser beam spot images with its further modeling using the PLD.
The sectioning method for the realtime control of the shape of the beam spot surface
When realizing subsystems of image control and processing in such devises as laser locators or laser transfer system, a number of requirements arises that influence a choice of the method and processing instruments:

1.
A unit should be lowweighted, smallsized, and have low energy consumption.

2.
Processing should be conducted in the real time operation mode.
All that imposes certain restrictions on the choice of the algorithm and time of its execution. One of the methods allowing to conduct image processing and classification with acceptable parameters is a sectioning method for realtime control of the shape of the beam spot.
The approximate classifying function
A traditional way of solving a problem of control of the shape of laser beam spots includes formation of the beam spot image В(х, у) on the photosensitive surface of the photo receiver and its further transformation into a signal U(х, у). An amplitude of this signal in each point of the expansion with coordinates (х, у) corresponds to the intensity in В(х, у), i.e. U(х, у) ↔ В(х, у). Then the signal U(х, у) is being compared with a reference signal W(х, у) for all points of signal expansion. Signals U(х, у) constitute certain surfaces that may differ by type, relative scale coefficient, vector of the relative coordinate matching, and relative turning angles in the threedimensional space. That is why comparison of those surfaces must be conducted taking into consideration all possible situations, which requires a huge amount of calculations and is difficult for the realtime realization.
In practically important situations, a required comparison of surfaces U(х, у) and W(х, у) can be realized with a new sectioning method described below. This method includes the following operations:

1)
find maximum amplitudes of signals U(х, у) and W(х, у) (Figure 1):

2)
find values of areas S_{0,75u} and S_{0,5u} of sections at levels 0,75 h_{ u } and 0,5 h_{ u } respectively for the signal U(х, у), and S_{0,75w} and S_{0,5w} at levels 0,75 h_{ w } and 0,5 h_{ w } respectively for signal W(х, у);

3)
Calculate approximate values of form factors {\tilde{r}}_{v,u} and {\tilde{r}}_{v,w} for signals U(х, у) and W(х, у) respectively;
{r}_{v,u}\approx {\tilde{r}}_{v,u}={r}_{s,u}={S}_{0,75u}/{S}_{0,5u},(1){r}_{v,w}\approx {\tilde{r}}_{v,w}={r}_{s,w}={S}_{0,75w}/{S}_{0,5w},(2)
where ~ is a sign of the approximate value,
V_{0,5u} and V_{0,5w} are cumulative values of amplitudes of signals U(х, у) and W(х, у), below levels 0,5 h_{ u } and 0,5 h_{ w } respectively;
We will prove that r_{ v } ≈ r_{ s } on the example of the current signal U(х, у) in the following way.
A volume {\stackrel{\u2322}{\mathit{V}}}_{0,5u} of the figure above the section of its surface U(х, у) at the level 0,5 h_{ u } may be found by one of the known formulas of the approximate calculation of integrals for equidistant nodes, for instance, by Simpson’s formula (Kendall, 1989):
As S(U_{max}) = S_{1u} is a sectional area of the surface at the level of the maximal amplitude, most often S_{1u} ≈ 0.

4)
compare form factors r_{s, u} and r_{s, w} (instead of the polyelemental comparison of surfaces).
Using (5), one can easily obtain
from which follows
A linear dependence between factors {\tilde{r}}_{v} and r_{ s } makes it possible to use the factpr r_{ s } as a characteristic of the form of the respective surface.
Possibilities of classification of surface types with the factor r_{ s } are reflected in Table 1. Different values of the factor r_{ s } correspond to different types of surfaces of figures, whose examples presented in the table.
An important advantage of the factor r_{ s } for some types of surfaces is its independence from the scale coefficient, shift and orientation of the respective surface.
The factor 4r_{ s } characterizes a generalized surface convexity: if 4r_{ s } > 1, the surface is convex; if 4r_{ s } < 1, the surface is flat in the generalized sense; and if 4r_{ s } = 1, the surface is linear in the generalized sense.
It is important to mention that a surface can be characterized by the area of the effective crosssection S_{ э }:
The sectioning method may be used for a laser beam signal sample, and the shape coefficient may be used as a sample parameter. This method will be used to determine laser beam centers.
where S_{1} is a sectional area of the signal on its maximal level.
The algorithm of control of the laser beam spot shape and experimental results
An algorithm of the method for a frame of 128∗128 decomposition elements (DE further on) is the following:

1)
Find a point with the maximum brightness W_{max} on the image;

2)
Find values of brightness:
\begin{array}{ccc}\hfill {\mathrm{w}}_{0.75}={\mathrm{W}}_{\mathit{\text{max}}}\ast 0,75\hfill & \hfill \text{and}\hfill & \hfill {\mathrm{w}}_{0,5=}0,5\ast {\mathrm{W}}_{\mathit{\text{max}}}\hfill \end{array}. 
3)
Find areas of surfaces S_{0.75} and S_{0.5}:
\begin{array}{c}\hfill {S}_{0.75}={\displaystyle \sum _{x=0}^{N1}{\displaystyle \sum _{y=0}^{N1}\left\{\begin{array}{c}\hfill {S}_{0.75}+1,w(f\left(x,y\right)\ge {w}_{0.75}\hfill \\ \hfill {S}_{0.75},w(f\left(x,y\right)<{w}_{0.75}\hfill \end{array},\right.}}\hfill \\ \hfill {S}_{0.5}={\displaystyle {\sum}_{x=0}^{N1}{\displaystyle {\sum}_{y=0}^{N1}\left\{\begin{array}{c}\hfill {S}_{0.5}+1,w(f\left(x,y\right)\ge {w}_{0.5}\hfill \\ \hfill {S}_{0.5},w(f\left(x,y\right)<{w}_{0.5}\hfill \end{array},\right.}}\hfill \end{array}(10)
where N is a number of decomposition elements in the frame line (column) equal to 128, W(f(x,y)) is a brightness value of the point.

4)
Then we will find form factors r:
r={\scriptscriptstyle \frac{S0.75}{S0.5}}(11)
It was found out experimentally, that an image is “good” if 0.7 < r <0.8; if not, go to step 1.

5)
Find image centers (González and Woods, 2003):
\begin{array}{l}x=\frac{1}{M}{\displaystyle {\sum}_{x=0}^{N1}{\displaystyle {\sum}_{y=0}^{N1}w\left(f\left(x,y\right)\right)\ast x}},\\ y=\frac{1}{M}{\displaystyle {\sum}_{x=0}^{N1}{\displaystyle {\sum}_{y=0}^{N1}w\left(f\left(x,y\right)\right)\ast y}},\\ M={\displaystyle {\sum}_{x=0}^{N1}{\displaystyle {\sum}_{y=0}^{N1}w\left(f\left(x,y\right)\right)}},\end{array}(12)
where x, y are values of x and y coordinates respectively; w(f(x,y)) is the point brightness value; М is the image “mass” (a sum total of brightnesses of all points of the image).
The following operations are performed during the investigation of the laser beam route:
An initial sample is formed of 10% laser beam spot images. During its formation, tunnel boundaries are determined with the enumerative technique. After that, sampling of laser beam spot images is conducted, and a group of “good” images is determined (Figure 2).

15
laser beam routes were studied (Basov et al., 1998), and the following results were obtained (presented for two routes):
Tunnel boundaries a = 0.77, b = 0.7. Those values are determined by analyzing a training sample with a method of optimization immediately before running the algorithm.
Difference between the maximum and minimum values of coordinates is 1.147.
Modeling of the sectioning method for classification of laser beam spots based on the PLD
The algorithm described in The algorithm of control of the laser beam spot shape and experimental results section is relatively simple but has high performance, which allows to use it in addin systems. The algorithm was used for the first time for this problem based on the Texas Instruments signal processor TMS320C5510 (Timchenko and Kutaev, 2002) with clock frequency of 200 MHz; it takes 10 ms to process one image. About 130 commands are used per one decomposition element.
At the same time, the following drawbacks were revealed in the process of operation: a high enough frequency presents increased requirements to the electromagnetic compatibility and a level of unit realization; almost all processor time is used for image processing, which does not allow to use the processor for other operations.
In addition, at present, video matrixes with higher resolution may be used to increase image refinement. Processing time of one image with the same process for work, for instance, with a matrix of 256 by 256 decomposition elements, may be calculated by the formula:
where F is the processor frequency of 200 MHz, k = 130 is a number of commands per decomposition element, n is a number of decomposition elements in a frame (256 by 256 DE = 65536 DE), i.e. processing of one frame takes:
Processing time τ indicates that the processor frequency is not sufficient for the realtime processing and requires a four times more powerful processor. And in case of an even bigger matrix, a need in increased performance grows exponentially.
Development of a parallel algorithm for the sectioning method
The following conclusions can be made after a more detailed study of the algorithm:

1.
Most operations used in the algorithm are simple mathematical operations (multiplication and addition, comparison and counting).

2.
Some formulas use the same variables (for instance, w(f(x, y)) in formulas 1 and 3), which provides an opportunity of their sharing.
Hence, a conclusion can be made about a possibility to use the computational hardware developed especially for the algorithm realized, which would allow building the parallel computational structures. The most flexible tool for that are the programming logic devices (PLDs).
A parallel algorithm of position determination and classification of laser beam spot images is presented in Figure 3.
Though the flowchart is consequential, operations in each computational unit are performed simultaneously, which results in timesaving in performing operations of the same type.
In the process of development of this algorithm, an order of some operations was changed in comparison with the consequential algorithm. For instance, according to step 4 of the algorithm, a form factor is calculated, and then on its basis a decision about the position computation is made. Instead, in the parallel algorithm, the position is calculated simultaneously with finding a decomposition element with the maximum brightness W_{max}. This is explained by the fact that in the PLD, unlike the traditional programming, algorithm elements occupy the circuit space regardless of whether they will be performed at a certain stage or not (Wakerly, 1999). In addition, this technique allows to decrease a number of iterations performed over one image frame.
For the simplicity of implementation, the algorithm implies a PLCbased computational part of the schematic, and the computational process is controlled by means of an external controller or an embedded controller kernel of PLD (Altera, 2011). A block diagram of the device is presented in Figure 4.
In this schematic, a microcontroller unit is controlling a camera, the PLD and PC communication, and the PLD is occupied with calculations of coordinates and image characteristics.
The PLDbased modeling of the parallel algorithm of the sectioning method
According to the parallel algorithm, a schematic of the image control and processing unit should meet the following requirements:

1.
be friendly to upgrades depending on the video matrix used;

2.
have a module structure for controlling individual units and maximally reduce the operation time.
Those requirements are satisfied by a schematic presented in Figure 5 and developed on the basis of the Quartus II 10.1 software by Altera, one of the world leaders in PLD production. The software uses a graphics builder and VHDL hardware description language (Ashenden, 1995) in respect to possessing of 128 by 128 DE frames. At the same time, usage of registers with excessive capacity allows to apply it to bigger matrixes as well without significant alterations.
The device consists of the following blocks:
The coordinate calculation unit (CCU) calculates values of X and Y and the maximal brightness W_{max}; the counter (CN) is used to submit input byte coordinates (its number) to the CCU; the data storage unit (DSU) stores intermediate values of X and Y and values of W_{0,5} (W0.5) and W_{0,75} (W0.75), the image classification unit (ICU) determines a form factor r (classifies images as “good” or “bad”); the 16384byte circular buffer (BF) is used to store frame data during the circuit operation; the output multiplexor (OM) is an asynchronous multiplexor enabling a serial output of X or Y coordinates.
External buses of the circuit are presented in Table 2:
The circuit works in the following way:
After a signal “1” arrives at the bus aclr, all registers are cleared, and a circuit is converted into an initial state. After that, a signal of logical “1” is sent to the bus input ena1 (it also gets to the BF storage input); a data byte is delivered to the input Datain; then a clock pulse passes. A value of the counter CN increases at the clock pulse edge, and the data is recorded in the buffer BF. The operation is repeated for 16384 clock pulses until the processing of the frame with the dimensionality of 128 by 128 DE is completed, and values of X and Y coordinates and of the maximal brightness W appear at the CCU output therewith.
At the next step, a signal of logical ‘1’ is fed to the ena2 input, and a signal of logical ‘0’ is fed to the ena1 input; then a clock signal CLK arrives; as a result, data for X, Y and W are recorded for storage in the DSU.
The third step includes nulling of ena1 and ena2 and feeding a signal of logical ‘1’ to the ena3 input; then 16384 clock pulses arrive to the CLK input. As a result, comparison of brightness of the individual byte with values of half (W05) and ¾ (W075) of maximal brightness takes place in the ICU, and areas of respective sections are determined. If their dividend (form factor r) falls within permissible limits, the image is considered “good”. To save time during this unit’s operation, values of X and Y may be obtained from the output DataXY using a control output XYsel (logic ‘0’ signal means value X, ‘1’ – value Y respectively).
After that, an asynchronous reset should be performed, and the system is ready to process a new image. Therefore, the image processing time is 32770 clock pulses.
Let us consider individual units of the schematic in more details. The coordinate calculation unit CCU is presented in Figure 6, and functions of its inputs are presented in Table 3.
The unit consists of the following elements:
MAx, MAy – multiplieraccumulators for X and Y coordinates respectively, they store all values for x and y; AC – accumulator of weight values (ΣW); CM – comparator and 8digit register – a circuit of selection and storage of the maximal brightness point; FPC13 (code converter) – converters of the 32digit unsigned integer into a 32digit floatingpoint number; DIVх, DIVу (X and Y dividers respectively) – 32digit dividers of floatingpoint numbers.
After a general reset, logical “0” is set up in registers of all elements, then the byte appears at the input DataIn, and after the clock pulse is received, its value is sent to the inputs Max, where it is multiplied by the counter value. After that, the result obtained is accumulated in the accumulator. Data for Y coordinate are processed similarly, and for W data a simple addition with accumulation is realized. Then obtained sums arrive to dividers Divх, Divy through the code converter (FPC). At the same time, the CM circuit compares value W of the previous byte with its current value, and if the new value is bigger, it is being registered in the register. As we stated above, one frame of 128 by 128 DE requires 16384 clock pulses. As a result, values of X, Y and W appear on the outputs.
The data storage unit (DSU) is a simple register where intermediate data is stored.
The image classification unit (ICU) is the most complicated element (Figure 7). This unit is designed for calculation of the form factor r, i.e. for image classification into “good”, with r = 1, and “bad”, with r = 0 respectively. The unit consists of the following elements and connections (Table 4).
The СW0.5, СW0.75 are comparators that compare incoming frame byte with respective values of brightness; counters CN1, CN2 count a number of points above a respective brightness threshold; code converters FPC1, FPC2 transform an integer into a floatingpoint number; Div is a divider of floatingpoint numbers received from CN1 and CN2; threshold comparators TC1 and TC2 compare values received from the Div with preset constants (TC1 for r = 0.7 and TC2 for r = 0.8).
The circuit works in the following way:
When an input byte arrives, comparators СW0.5 and СW0.75 produce authorization signals for their counters. On arrival of the clock pulse, counters increase their indications by one subject to the authorizing signal of the comparator (СW0.5, СW0.75). This operation is repeated for 16384 times for all frame decomposition elements. Then counter indications are transformed into floatingpoints numbers, and an operation of their division is performed in the Div. The number obtained is compared in the threshold comparators TC1 and TC2 with constants. If this number is within the limits, logical “1” will appear at their outputs, which send a signal of logical “1” through the element “&” to the output, therefore signaling about a “good” image.
The circuit was modeled in the media ModelSim Altera 6.6. on the basis of the Cyclone II microchip of EP2C20Q240C8 type. As a result, the following results were obtained:
Number of logic elements – 2,454/18,752 (13%).
Number of pins used – 47.
f_{ max } – 112 MHz.
Therefore, a microchip with a lower capacity may be used for the real device.
A timing diagram of the PLD unit is presented in Figure 8.
Discussion of the obtained results
Experiments demonstrate that due to various destabilizing factors, coordinates of energy centers of laser beam spots cannot be measured accurately; however, accuracy can be substantially increased by using a calculation of the form factor of images with their further classification into “good” and “bad”.
According to the suggested sectioning method, the comparison of surfaces is reduced to the comparison of their form factors and does not require their comparison by element with consideration of all cases of difference in their types, scale coefficient, relative shift and turn in space. It is important to mention that equality of form factors of surface, in the general case, allows to attribute them to the same generalized surface type or to approximate surfaces with that type.
Obviously, the sectioning method can easily be extended to the case of the increased number of equidistant sections of the surface, of changes in values of section levels, changes of weight coefficients in areas of sections. In this case, it also makes sense to use a suitable formula of approximate calculation of integrals.
The sectioning method discussed is also promising for the usage in problems of realtime image classification and archiving. An important advantage of this method is simplicity of its realization in terms of both software and hardware.
A conclusion can be made from the diagram (Figure 8) that the schematic is completely static, and that its operation requires (2N + 2) clock pulses to process an image (where N is a number of decomposition elements), knowing that the initial circuit uses τ = 10 ms per frame. A required PLD frequency may be calculated:
As the maximum chip frequency is 100 MHz, it can be used for matrixes of up to 512∗512 DE without changing a chip for a more expensive and highperformance one.
Therefore, this schematic may be used to improve characteristics of laser transfer systems of various types. A flexibility of PLD programming allows to create such subsystem with a single circuit solution, and characteristics of image processing may be changed through reprogramming the PLD for a target transfer system.
In addition, a relatively small space used by the circuit developed in relation to the capacity of PLD logic cells allows making a conclusion that a research should be conducted on embedding one of broadly available chip architectures. This would allow to remove the microcontroller (Figure 4) from the circuit, thus making it even simpler.
The circuit developed may also serve as a basis for developing subsystems of forecasting characteristics of spot images, which becomes more and more needed with a growth in speed and distance between the transfer systems.
Conclusions

1.
A sectioning method for classification of laser beam spots was developed, which does not require performing timeconsuming calculations.

2.
A sectioning methodbased parallel algorithm developed meets conditions by a number and complexity of operations.

3.
The image processing and classification device allows to release the main processor from making onetype operations.

4.
The working frequency of the circuit in its basic is 40 times lower than with the use of the digital transfer system, which allows to reduce requirements by the electromagnetic compatibility.

5.
The processing device design is modular, which makes it possible to use it for matrixes with higher resolution.
References
Altera: Nios II Processor Reference. 2011. http://www.altera.com/literature/hb/nios2/n2cpu_nii5v1.pdf
Ashenden PJ: The Designer’s Guide to VHDL. 1st edition. Morgan Kaufmann, USA; 1995:668.
Basov NG, Zemskov EM, Kutaev YF, et al.: Laser control of near earth space and possbilities for removal of space debris from orbit with explosive photodissociation lasers with phase conjugation. Proceedings of GCL/HPL 98, SPIE Symposium, St. Petersburg, Russia, Vol. 3574 1998, 219228.
Chien SY, Chen LG: Reconfigurable morphological image processing. Journal of SPS 2008, 56(2–3):155165.
Gannot I, BenDavid M, Inberg A, Waynant RW: Beam shape analysis of waveguide delivered infrared lasers. SPIE, Opt Eng 2002, 41: 244.
González RC, Woods RE: Digital Image Processing Using MATLAB. Pearson Prentice Hall, Upper Saddle River, NJ; 2003:609.
Hartmann M, Pantazis V, Vander Aa T, Berekovic M, Hochberger C: Still image processing on coarsegrained reconfigurable array architectures. Journal of SPS 2008, 60(2):225237.
Kendall E, Atkinson: An Introduction to Numerical Analysis. 2nd edition. John Wiley & Sons, Canada; 1989:256.
Khosrofian JM, Garetz BA: Measurement of a Gaussian laser beam diameter through the direct inversion of knifeedge data. Appl Opt 1983, 22: 34063410. 10.1364/AO.22.003406
Kozhemyako VP, Timchenko LI, Poplavskyy AA, et al.: Analysis of the methodological approaches in connection with the problem solving of extrapolation of object trajectory. SPIE Symposium, USA 2003, 5175: 222236.
Magnes J, Kinneberg M, Khakurel R, Melikechi N: Optomechanical shape analysis using group theory. Appl Opt 2010, 49(22):41884192. 10.1364/AO.49.004188
Mana G, Massa E, Rovera A: Accuracy of laser beam center and width calculations. Appl Optics 2001, 40(9):13781385. 10.1364/AO.40.001378
Orlov DA, Neverova EA: Determination of the position of the center of a laser beam when the dynamic range of the matrix receiver is exceeded. Meas Tech 2003, 53(10):11401146.
Timchenko LI, Kutaev YF: Method for training of a parallelhierarchical network, based on population coding for processing of extended laser paths images. Proc SPIE 2002, 4790: 465479. 10.1117/12.453865
Wakerly JF: Digital Design: Principles and Practices. Prentice Hall, Upper Saddle River, NJ; 1999:949.
Wright MW, Wilson KE, Kovalik J, Biswas A, Roberts WT: A bidirectional low earth orbittoground optical link experiment. SPIE Newsroom 2011, 3. doi:10.1117/2.1201109.003826
Author information
Authors and Affiliations
Corresponding author
Additional information
Competing interests
The authors declare that they have no competing interests.
Authors’ contributions
VG and YK conducted field research of laser tracks, and took a part in development of the sections method. LT and NK participated in the design of the study, carried out the statistical analysis and drafted the manuscript. MP has developed a parallel algorithm and it's implementation on PLD. All authors read and approved the final manuscript.
Authors’ original submitted files for images
Below are the links to the authors’ original submitted files for images.
Rights and permissions
Open Access This article is distributed under the terms of the Creative Commons Attribution 2.0 International License (https://creativecommons.org/licenses/by/2.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
About this article
Cite this article
Tymchenko, L., Petrovskiy, M., Kokryatskaya, N. et al. Modeling of the highperformance PLDbased sectioning method for classification of the shape of optical object images. SpringerPlus 2, 692 (2013). https://doi.org/10.1186/219318012692
Received:
Accepted:
Published:
DOI: https://doi.org/10.1186/219318012692
Keywords
 Image processing
 Laser systems
 PLD(FPGA)