A Real-Time Renewable Plastic Particles Sorting Algorithm Based on Image Processing

. According to the demand of harmonia renewable particles sorting in domestic plastics recycling industry,mainly for white and gray recycled plastic particles,a mathematical model is built in RGB color space and a kind of high accuracy, real-time sorting algorithm based on image processing is proposed.This algorithm is intended to use related multiplication, addition and comparison operations of particles pixels R, G, B component,,instead of sorting algorithm based on the difference and threshold processing commonly used in domestic products,and verify its effectiveness through simulation.


Introduction
Waste plastics contains huge renewable resources, waste plastic for recycling and processing into recycled plastic is significant: Firstly, recycling can compensate for raw material consumption, and saving energy ; Secondly, it can reduce the white pollution formed by the discarded plastic trash to protect the environment;Thirdly,you can take advantage of recycled plastic as a raw material in manufacturing of plastic products to create considerable economic benefits for related industries.Since entering twenty-first Century,waste plastic recycling has received heightened attention from the world. To make better use of recycled plastics and generate more economic benefits, we need to sort particles of different colors, and achieve a certain sort of purity.Therefore, recycled plastic particles (hereinafter referred to as renewable particles) sorting industry has broad market prospects. Figure 1 shows the renewable particles.

Figure 1. Renewable Particles
At present, some foreign countries such as Switzerland, Germany, the United States have been using high-precision digital cameras and automatic identification technology to produce Plastic color separation machine for automatic sorting of renewable particles. However, the high price (RMB 200-400 million) of foreign-related products is not acceptable to the plastic products industry in china. Currently,in our country,utilization of waste plastics recycling is not high, waste plastic recycling plant is not much, especially uneven distribution;on the other hand, in recent years, domestic manufacturing has been developed rapidly and the market is very prosperous, the number of large plastics markets is more than ten .Renewable particles has been in short supply,and Prices have been rising,so renewable particles process will be Hot spot in the future development [1] .The few large-scale plastics recycling companies in China use self-developed sorting device to realize renewable particles sorting.As the Renewable particles sorting algorithm is the core technology of sorting device,it determines the sorting accuracy and realtime sorting speed.

RGB color space model of white renewable particles
At present, most of the domestic renewable particles sorting device (color separation machine) use CCD camera acquisition capture renewable particles color information, calling sorting algorithm to achieve realtime sorting recycling particles base on the DSP or FPGA hardware platform.Mainstream sorting algorithms are based on image processing techniques to construct a three-dimensional mathematical model in the RGB color space, then use difference and threshold algorithm to complete sorting process [2][3] .
For white and gray recycling particles,the sorting algorithm based on the difference and the threshold operation is treated the qualified renewable particle image as a gray image, the image captured by the CCD camera is basically white,which means that the three component value of R, G, B are substantially equal in the renewable particles image data.In the RGB three-dimensional color space,such image data points located substantially on the main diagonal (Gray axis) which has the same angle with three axes,as shown in Figure 2.In the filming process,we capture the particles information through the reflected light,but the particles reflect light intensity is different at different angles,so the particles of the gray image data has a certain range.
Considering the factors of light,raw material itself characteristic, the front plastic particles renewable technology and so on,making the white and gray renewable particles image is not gray scale image entirely,that is the value of the three components of RGB particles pixels may not exactly equal-------In the RGB color space, the data points of the regenerated particles are not only distributed in the gray level, but also in a certain range of the gray axis. When collecting a large number of qualified white renewable particles for image acquisition, image data in the RGB color space formed a "mallet" shape, the main in gray axis which has the same angle with RGB three axes,as shown in Figure 3.This is the model characteristic of the white renewable particles in RGB three-dimensional color space.Thus,if only based on the difference and threshold operation to make the harmonia sorting algorithm ,it will affect the sorting accuracy and especially when sorting smaller particle size, that will bring great error.  When collected a sufficient number of standard white renewable particles,then we can be sure this is the qualified renewable particles space range,the remaining are heterochromatic particles which to be picked out .Foreign fiber detection work is making use of the algorithms to determine the spatial extent and judge the image point is within this range or not.
Through the observation of renewable particles, you will find harmonia particles generally have the following three categories.

1) Black particlesincluding renewable black particles
and the large black impurities which do not be filtered by the filter during the regeneration process,the color is nearly black,the brightness is low in the particle image and locate in the end of the gray axis.
2) Harmonia particlesrefers to the particles whose color"is obviously not black and white," maybe blue, yellow, red and so on.
3) Color-impured particlesthe main is white,but in poor quality.Data points fall out of the "mallet" range formed by the white renewable particles,but the deviation is in a narrow range.
In summary, these types of major heterochromatic particles in RGB color space,do not overlap with the white particles space,so this feature models has already met the sort requirements.

Renewable particles sorting algorithm
Combined research experience in similar projects completed by author with the proposed white particles feature model, renewable particles sorting algorithm is proposed.

Determine the Scope of Qualified Particle Data
Gathering a large number of qualified white renewable particles image data, depict these data points in the RGB color space,and determine the symmetry axis of "mallet".
Reexamining the qualified white particle image RGB space model from an engineering point, we find that the deviation between the "mallet" symmetry axis and the RGB cube space gray axis is not large,in the introduction of error conditions,under the conditions of certain errors,view the two axes as one. After thus approximation,use some plane which are perpendicular to the gray axis to cut the "mallet", then we can get a series of concentric circles. Then, theorem 1 can be proved based on the previous approximation , that is : Theorem 1 -the value of (R+G+B) which is the summation of R, G and B coordinates for every image pixel in a given plane that is perpendicular to the symmetry axis of the 3D stick is equal to each other, this uniform summation can be recorded as a constant 3m [4] , which can be expressed as below: (1) Then, we can use the added value of R, G, B coordinate components of the particles data point to determine circular section of the "mallet".As in the case of 3m,establish a mapping table which includes all qualified circular section . Obviously,by determining the minimum value of 3m,we can regard the min as the threshold(At the low end of the gray axis) sorting the first category harmonia particles(black).In real-time sorting process ,compared the added three coordinate value of actual regeneration of particle image data point 3m with the min,then make the judgment:if f , particles are first category harmonia particles.
As the circular cross-section is determined by the calculated value of 3m, another theorem can be proved based on strict researching and demonstrating , that is: Theorem 2the cross-sectional radius of the circle is approximately equal in value to the average of the difference between maximum and minimum of R,G and B coordinates in the section multiplied by a constant [4] .
So,the circle radius can be approximately figured out listed below: Furthermore,we can determine the maximum distance r from each point on the section of qualified particle space "mallet"to the RGB color space coordinate origin: 2 2 ) ( 3 radius m r (3) The actual distance from the renewable particle image data points to the RGB coordinate origin is: While real-time sorting, compare D with r value to make a certain judgement based on the comparison result if r D d , the actual particle being detected is qualified renewable particle ; if r D ! , the actual particle being detected belongs to the second or third harmonia particle. The schematic of renewable particles mallet cross section is shown in Figure 4. For the convenience of DSP and other chips for real-time processing, we can compare 2 D and 2 r to increase sorting speed. In summary, in order to get qualified particle data range,we can calculate(and storage) the value of 3m(to determine the circular section,meanwhile ,we can obtain the min as the threshold sorting the first category harmonia particles);then make 3m to be the index, calculate (and storage) the maximum distance r (as the comparison threshold to determine the second or third harmonia particles)from point of each section in the qualified particle space mallet body to the RGB color space coordinate origin.

Renewable Particle Real-time Sorting Algorithm
Real time sorting for renewable particles may start after the data range of qualified particles is obtained . Realtime sorting algorithm steps are listed as follows: 1) Capture an image point of the particles to be picked with CCD camera. The algorithm flow is shown as Figure 5.

Algorithm Validation
To visualize verify the validity of the algorithm, we can verify the validity of the algorithm by observing the renewable particles image which is processed through the renewable particles sorting algorithm.The picture (the background is under smooth processing)of qualified white renewable particles is shown as figure 6.The picture of renewable particles mixed with harmonia particles is shown as figure 7. Processing the figure 7 using the algorithm-------marking the harmonia particles pixels with striking dark color,and the verification results is shown in Figure 8. From the experimental results we can know that the algorithm can effectively pick harmonia particles from the mixed white particles.Compared the number of picked harmonia particles through the algorithm with the number of manually sorted,we can verify that this algorithm sorting rate is more than 95%,and the algorithm is effective.
At the same time, it must be pointed out that the accuracy of the algorithm depends largely on the accuracy of the data range of qualified particles .In practical engineering applications, we should strive to select a large number of different types of qualified particles for analyzing in the process of determining qualified particle data range,thus we can guarantee the accuracy and the validity of the algorithm.

Conclusion
After the analysis and data simulation experiments,we can prove the proposed renewable particles particles sorting algorithm which aims at improve the accuracy of real-time sorting,uses the pixel R, G, B components related multiplication, addition and comparison operations instead of domestic common sorting algorithm that based on the difference and threshold process, is a feasible sorting algorithm.In this paper ,the mathematical model and sorting algorithms can be applied and transplanted to other related projects.