Identification and recovery path planning of Marine garbage patch based on Machine vision

At present, the environmental problems in the water are becoming more and more prominent, and many teams are working on the research of the automation of garbage collection at sea. In order to a ready-made sea on the garbage recycling equipment automation, intelligent recognition for all white plastic and in identifying regional planning the path of the recycling of recycling equipment, aiming at different times during the day under the sea lighting situation, puts forward a visual processing and multi-step sea boundary identification method. After the image is processed by using two peak method normalized Canny boundary scan and other methods, the vertical and horizontal scanning and boundary recognition are carried out to obtain the closed Marine garbage main body area. Finally, Zigzag algorithm is used to carry out recovery path planning in the scanned area, and the results under different search radii are compared and analysed. The experimental results show that this method is applicable to a wide range of applications and has high accuracy and practicability, and the recognition results are satisfactory.


Introduction
The use of plastic products is increasing year by year due to its many advantages, but at the same time, it also brings serious white pollution. A large amount of unlandfilled plastic waste flows to the ocean through rivers, sewers and other channels, and migrates to a long distance under the action of ocean currents and wind waves [1], which has become a serious pollution problem across countries and regions.
The traditional way to clean up floating garbage on the water is mainly by manual fishing, but this way is not suitable for the cleaning and recycling of far-sea garbage. The use of automation equipment on the sea can greatly improve the efficiency and scope of application of garbage cleaning and recycling at sea, while ensuring the safety of personnel. Therefore, using machine vision to identify floating garbage on the water surface is of great significance.
At present, the research on surface target recognition in China is still in the initial stage. Previously, some scholars used convolutional neural network to identify and detect large targets on the water surface [1]. However, due to the diversity of types of marine garbage, different forms and high coincidence degree, as shown in Figure.1. If the convolutional neural network is used to locate the target, it will produce very high time complexity and too many redundant Windows, which will affect the speed and performance of subsequent feature extraction and classification. In this paper, according to the changes of sea water colour at different times in a day, and the linear subtraction of the sea water colour and the collected image, after a series of operations such as normalization, binarization and edge detection to remove the noise, the binary image after removing the sea water area is obtained. Then, the images were scanned vertically and horizontally, other interfering elements were removed from the images, and the range of the recognized garbage belt was defined. Finally, the Zigzag block scanning algorithm was used to plan the path of the platform independent recovery within the obtained range.

Figure1
. The image to be processed

Visual image processing
This section mainly introduces the internal processing process of the machine after the camera obtains the image data 2.1. Image pre-processing Due to the frequent changes of meteorological illumination conditions under different climates and different times, the color of sea water varies greatly. This paper takes a sea area in Shenzhen, Guangdong Province, China as an example. As shown in Figure.2, it is a picture of color changes of sea water under different lighting conditions within 24 hours collected by the same camera at the same place. In order to solve this problem, our team collected a large number of sea surface image data at different moments in the sea area and extracted local RGB values within 100x100 pixels, as shown in Figure.3. Figure.2: Images of seawater at different times. Figure.3: Pixel RGB value at different times. After obtaining the RGB data of the seawater at different moments, the image data collected by the camera of the garbage collection platform at a certain moment is subtracted from the RGB data of the seawater at that moment to obtain the preprocessed image data. The gray values before and after image preprocessing are shown in Figure.4 (a) and (b). As can be seen from the figure, pixel areas with low gray values are greatly increased and most seawater areas are removed from the image, which is conducive to further processing of Marine garbage identification in the future.
(a) Before (b) After Figure.4: Grayscale histogram of images before and after pre-processing.

Binarization and edge detection
For an 8-bit deep image, a fixed grayscale threshold cannot be used because the image may be overexposed or underexposed. We use the bimodal method to calculate the adaptive gray threshold of the preprocessed image, and use this threshold to binaries the image. Firstly, the gray value of all pixels in the image with the size of is traversed, and the sum of the last pixels at point n is: Where P is the image array to be calculated.
Then the 0-1 value of the final image is: The processed binary image is shown in Figure.5.  In order to make the boundary area of the sea water on the image more obvious and distinguishable, the Canny detection algorithm is also needed to smooth the lines and deburr the image. Based on the traditional algorithm, the improved weighted median filtering canny detection algorithm [4] is helpful to reduce the noise in the image neighborhood, retain more image details and improve the effect of denoising. The image results processed by canny detection are shown in Figure.6.

Vertical scan & lateral scan
In terms of image vision, the sea water and the sky show relatively similar colors under specific climate and specific light. In order to make a clear distinction between the sea and the sky, it is necessary to search out the boundary between them and make a distinction. Furthermore, in order to distinguish the garbage fishing area from the non-fishing area, the separation line of the water surface should be searched in the horizontal direction, so the image needs to be scanned in the longitudinal and horizontal direction.
Take the longitudinal scanning process as an example, traverse in sequence within the image range of size m n: Where k 0 is the upper limit of the set discrimination, which is related to the relative size of the image. If k 0 is too large, part of the edge line may be lost; otherwise, the edge line may be identified as interference. Here, the particle swarm optimization algorithm is used to carry out iterative calculation on the upper limit value, and the best result is 19.864, which is set as 20 here.
After longitudinal scanning, the sea level curve is obtained, and then the area above the sea level curve is removed to obtain the sea water area. After transverse scanning and merging the two scanning curves, the closed main area of floating garbage on the sea can be obtained. The final scanning result is shown in Figure.

Zigzag algorithm implementation
Zigzag is an extremely widely used block scanning algorithm. Using the Zigzag scanning principle, the "Z" shape scanning is carried out from bottom to top in the closed identification area to complete the generation and planning of the Marine garbage recycling path. Zigzag scanning starts from the bottom of the visual sensor on the platform and goes back and forth within a given garbage collection radius rc. If the rc distance ahead of the path is detected to overlap with the edge of the scanned closed area, it indicates that the line has been scanned and the scanning should be continued in the opposite direction in a further direction. It will drive along the offset curve inside the edge line to a distance of 2rc from the center of the original path until the end of scanning or an interrupt signal is detected. Thus, the shortest driving distance and the maximum coverage of garbage collection area are achieved. A major advantage of this processing is that the whole image data acquired by the camera each time is fully discretized, and there is no need to carry out secondary quantization processing of the data, so the time and space complexity of the program can be significantly reduced. The finally calculated Zigzag path is shown in Figure.8.

Result analysis
In order to verify the correctness of the results, the total length of paths generated by the planning under different collection radii and the scope of garbage covered were tested, as shown in Figure.9.  As the scanning radius increases, the total length of the path decreases gradually, while the total area scanned in the region does not change much, which is the same as the predicted result, which proves the correctness of the algorithm.

Conclusion
This paper, on the basis of the marine garbage collection platform, improved the marine garbage identification visual system. After preprocessing, binarization, edge detection, lateral scanning and vertical scanning of the identified images, the garbage collection path is calculated by using Zigzag algorithm to generate garbage collection path, and analyzed the generated results under different scanning radius. It is shown that this kind of visual processing method has a better recognition degree and calculation accuracy when facing the Marine targets, which provides a great help for the Marine garbage recovery.