Developed an Automated Design Sorting System According to Outer Edges of Object

The automated sorting systems are used in the industrial sectors to increase the rate of production. This research developed the sorting system by using a vision machine to detect the matching of capturing image with the storage base image. The system will be matching and sorting in real-time with 5 cm/s conveyor belt speed. The vision system is based on three stages to arrive at the sorting decision. The first stage is to covert the capturing image to a binary image, the second stage is applying edge detection of the product, and the third stage is matching this result with the base image. The system was successful to sort any product with complexity in shape and with high efficiency. The system sorting can be detected and sorted any product/machine element at any position or orientation. The system uses real-time analysis in order to provide the required results. The results arrived at the sorting gate at the end conveyer belt of the system if open that means the product matching. Three different products were selected in order to investigate the response and the accuracy of the results. It was found that the maximum of error to detect the product is not exceeding 2% for all cases.

1. Introduction e automated sorting system become an essential element in industrial sectors due to decreased time and increased rate of sorting. It was using sensors that connect to control the microcontroller or PLC for producing the right decision. e sorting method depends on the color, shape, volume, size, and type of detection products. e actuator sorting consists of an arm robot, sorting gate, and hydraulic link. e sorting process uses mainly vision computers with artificial intelligence and statistical methods. e application of sorting systems is in all industrial sectors such as sorting fruits by size with three categories, finding the radius, and calculating the area and perimeter based on light detection and ranging (LIDAR) sensor [1]. Some researchers design the systems to sort fruits using a vision system and robot with tracking the positions [2,3]. PLC controller is used to sort objects based on the material of the subject such as wood, steel, and plastic with three sensors at different positions with acceptable average time [4]. Machine vision adds to sorting systems for detecting and automated sorting [5][6][7]. Also, the image processing approach with deep learning as a system is used to sort objects [8].
e sorting of an object is based on four methods that are related to color, shape, texture, and hybrid approach [9]. e support vector machine (SVM) is utilized in some systems with a mobile manipulator in cases where the system accomplished the step tasks such as the recognition of objects at any varying scales and rotations, motion control plan for mobile manipulation, and grasping control plane for objects at any position [10].
Sorting parts and remanufacturing processes use logic cube inspection to detect the product and sort based on its weight and volume with machine vision, but the system does not work in real-time [11]. Automated defect detection by a visual inspection system for cylindrical objects is performed using a camera and multimirror handle, but such a system does not work with real-time detection [12]. Some vision systems are using robots to recognize and sort objects, and such systems sometimes use PLC control units [13,14].
e sorting system is also used for sorting lima beans or sorting the connected characters of multiline license plates [15,16]. e automated sorting system based on vision detection for fruit functions is based on the detection of the size and the shape of fruit in real-time [17,18]. 3D vision sorting systems detect the object and pick it up using the robot arm, where the systems used two cameras to obtain 3D detection [19]. Figure 1 shows the types of sensors used in sorting systems in different applications.
Ilas et al. [20] explored different types of algorithms in order to find the possible trajectories of an autonomous robot moving through different types of obstacles. Based on the developed approach, the distance between the robot and the obstacles was determined by taking into account the width of the robot. It was found that the optimal trajectory can be chosen to plan the robot. e most significant advantages of the presented algorithms are the height accuracy and simplicity even when the resources for the calculations are at a medium level.
Benicky et al. [21] presented a developed technique based on the real-time aspect. e partial solution was found to detect fast movement using different algorithms such as corner detection and edge detection. e authors presented the way to classify the motion. Furthermore, the optimal and effective forms were found by applying the corner and edge detection methods that can be used in the applications of redundant data. ey recommended to filter the redundant data (enter image) that will be used in the real-time analysis.
Alexander and athan [22] presented a developed control circuit that can be used for the solar-fed cascaded multilevel inverter for the 3-kW solar plant. e switches of the semiconductor of the multilevel inverter were reduced by decreasing the total harmonic distortion that leads to enhanced output power. Based on the developed system, the level of the output voltage was increased without using the output transformers of boost converters. MATLAB/Simulink was used to simulate the developed system under different working circumstances. e obtained results from Simulink agreed completely with the experimental results. It was also found that the presented inverter is more optimal for the grid-connected and standalone systems. Table 1 shows the most available sensors and methods that are used for different types of sorting operations. Based on the available literature that used the camera with edge detection, Hough line transform was used to detect all line edges of the product and the cross-correlation method was used to scan all lines of template and product capturing image.
e main objective of this work is to develop a real-time sorting system for any specific product (complex shape) that can detect it from different products by using a camera and based on an image processing approach with minimum cost and time.
e matching method is applied in this system at a speed that is calculated according to the characteristics of a camera such as the number of the frame. Increasing the characteristics of the selected camera will increase the system performance and accuracy. e developed system can match the target product with high accuracy and in different positions and orientations. e main contribution of this work was building a new sorting system with cost and high accuracy to sort any complex product/object with an acceptable time. Based on the available literature, it was found that most of the researchers used or developed complex and expensive sorting systems, which is considered an economic disadvantage from the view of the industrial sector.

Description and Working Principle of Sorting
System. e developed sorting system consists of a conveyor belt that is connected to a DC motor, to handle the products to detect. Below this conveyor belt, two IR sensors were fixed, where the first sensor is to detect the arriving product under the camera to send the signal trigger to the camera. e camera is fixed above the conveyor belt to capture the images in realtime for the products. e second IR sensor is located before the sorting gate to detect the arrived target product. e gate is connected to the second DC motor to change the path of the target product when the target product arrives at the second IR sensor, then the sorting gate will be opened. Figure 2 illustrates the details of the elements of the developed sorting system. e microcontroller is the control unit in the system that connects with the program platform to transform input and output control signals. e optical encoder connects to the shift of the conveyor belt to calculate the speed of the belt which must be in the range of the frame of the camera. e sorting gate subsystem consists of a gate connected to a DC motor with a limited switch to open the gate at the suitable gap that is best to cross the desired product. en, the gate closed after a few times need to cross the product as shown in Figure 3.

eoretical Methodology of the Target Product Matching.
e template image of the target product is prepared to match the color-capturing image for all products. e Canny edge detection method was applied to detect the desired line.
e Canny strategy activity comprises six steps for the edge detection [23]. e gradient image P(x, y) is calculated from the partial derivatives in the x-direction and y-direction of the 2D image as e measure pixel intensity rate at x-direction as and the measured pixel intensity rate at y-direction as e gradient magnitude can be found from 2 e Scientific World Journal Now, the Image Processed Hough Lines for Path Planning Application is applied to find the target line from capturing the image and detect its coordinate. e Hough transform obtained from the polar equation is Here, r is the length of the line from the inception to the nearest point, and θ is the angle between the x-axis and the line associating the cause with that nearest point. It is subsequently conceivable to connect with each line of the picture, a couple (r, θ). e (r, θ) is the plane alluded as Hough space for the arrangement of straight lines in the two measurements. is portrayal causes the Hough to change reasonably exceptionally near the two-dimensional Radon change. e Hough change is numerically identical to the Radon change, yet the two changes have distinctive computational understandings customarily connected with them. Given a solitary point in the plane, at that point, the arrangement of every single consecutive line experiencing that point relates to a sinusoidal bend in the (r,θ) plane, which is novel to that point. A lot of at least two focuses that structure a straight line will create sinusoids which cross at the (r,θ) for that line. Hence, the issue of identifying collinear focuses can be changed over to the issue of finding simul-Sensor types used in sorting system

Material sensor
Vision sensor Color sensor Weight sensor  Oscillator frequency [4] Material types 5 Histogram + SVM [6] Object properties 6 Deep learning + CCD sensor [8] Object properties 7 Municipal solid waste + SVM [10] Recyclable materials 8 Camera + weight sensor + silhouette algorithm [11] Defect detection and remanufacturing 9 Camera + fuzzy logic algorithm [12] Defect detection and classification 10 HMI (human-machine interface) [14] Color box where B is the most distant separation between inverse corners in the image. e cell at organizes (i, j) with aggregator esteem A (i, j) relates to the square connected with parameter space arranges (r i , θ j ). At first, these cells are set to zero. At that point, for each nonfoundation point (x k , y k ) in the picture plane (i.e., the xy-plane), it was assumed that θ is equivalent to every one of the permitted subdivision values on the θ-axis, where it explains the relating p that utilizing the condition r � x k cos θ+ y k sin θ.
e subsequent R-values are adjusted in the next step to the closest permitted cell esteem along the r-axis. e comparing accumulator cell is increased as well. In order to finish the process of this methodology, an estimation of P value in the cell was performed. An (i, j) implies that P focuses in the xy-plane that lies on hold x cos θj + y sin θj � r i . e quantity of subdivisions in the rθ-plane will be decided by the accuracy of the collinearity of these focuses. e aggregator cluster is alluded to the tool kit as the Hough transform matrix, or basically as the Hough transform.
An improved Hough transform (HT) technique is proposed to recognize line portions in images with entangled foundations.
is work concentrates around distinguishing line sections of particular lengths, absolutely autonomous of earlier information on the first image [24]. e statistical method depends on the Hough transforms of line fragment location by taking about quantization error, picture clamor, pixel unsettling influence, and pinnacle spreading, likewise considering the decision of the facilitate starting point [25,26]. Improvement of image processing by the changed Hough transformation applied for seam following the framework in gas metal arc (GMA) welding [27]. An improved Hough algorithm for line detection, which shares the comparative qualities of the modified Hough transform (MHT) and the Windowed random Hough transform (RHT) [28]. Hough transform (HT) has discovered monstrous viable applications in vision issues such as object detection, movement detection, biometric validation, medical imaging, remote information processing, and robot route [29]. Applying Hough transform formulation depends on the utilization of the inverse Radon operator, which decides the location and orientation of the lines in the image to the noise information image [30].
A matching technique consolidated Hough transform and Random sample consensus (RANSAC), which changes the issue of finding the right pixel-wavelength matching pairs into finding the privilege direct model [31]. A productive algorithm for line discovered from LRS information utilizing a novel jumping focuses singular value decomposition (SVD) and Hough transform-based transform, in which SVD is applied to irregular LRS focuses to accelerate the transform [32]. A modified amassing plan for the Hough transform makes it appropriate for computer frameworks with little, however, quick read-write memory [33]. Realtime lane detection for a driving system that uses edge detection and Hough transform has been created to help a driver in the path takeoff basic leadership, in order to decrease lost fixation and forestall a mishap while driving [34]. e cross-correlation method is applied to scan the pixel of the template and capture images to find the similarity between them. e cross-correlation is calculated as where the f(t) is the complex conjugated for the f (t) that is represented the function of pixels.

Experiment of the Developed Sorting
System. e starting step of the sorting system is capturing pictures of the target product. Image processing Canny edge detection, Hough line transform, and cross-correlation are applied in the developed sorting system. e next step is the matching process between the image capturing and the templet of the selected product. Figure 4 shows the flowchart of the main steps of the process achieved in the developed sorting system.
e matching operation will be scanned pixels of templet and then compare them with pixels of capturing images. e comparison is at the edge of the product that detects in the template image with the edge that detects in the capturing image. If the matching is obtained, the gate will be opened to change the path of the selected product. e microcontroller is the center of the control unit of this system, where the signal that came from the IR1 sensor gives the signal to the microcontroller, and then it gives the signal to capture the new image. If matching happened, the platform gives the signal to the microcontroller and waits for the signal from the IR2 sensor to give the motor of the gate a new signal to open it. Figure 5 demonstrates the block diagram of the control unit in the developed sorting system. e microcontroller circuit consisted of a (pic16f84a) microcontroller and two relays to control the sorting gate motor with a buffer that regulates the signal that comes from the software platform ( Figure 6). e system was designed and implemented at a low-cost component with high sorting efficiency in real-time.

Results of the Sorting System and Discussions
e automated industrial sorting system results are the decision to choose the target product from any product. e template image was obtained from edge detection for the target image of the product.
e system scans all pixels capturing the image to detect the matching with the template image (Figures 7, 8 and 9) and shows the results of product detection.
e results show the template edge is converted to the red line and finds the edge of the product; then, the system tracks this product until arrived at the IR2 sensor. e template has a different orientation compared to the 4 e Scientific World Journal product, but the system has the ability to scan the pixel of the capturing image for the product to apply the matching process. e template is basically the image of the product that was taken in the early stage. In the next step, the image processing edge detection was applied with filtering to obtain this image edge templet. Any product that needs to sort it will call up the template and start the process of the system. In the experimental work, three different samples of products were used to examine the accuracy of the sorting  operation. e developed system can be sorted these three different shapes of product but with different time speeds of detection. e time of detection (matching image processing) is a function of the product shape, where the detection time increases if the geometry of the product has a complex shape and decreases if the geometry of the product has a simple shape. It was achieved 100 tests for each sample of selected products in order to explore the accuracy of sorting and the average time of detection for each product as shown in Table 2. It was found that the lowest time (6 s) needed for detection was for sample 2 and the highest one was for sample 3 (10 s). e reason behind such results is the shape of the sample which contains a number of lines and curvatures that affect significantly the sorting process. Table 3 shows the accuracy of detection of the developed sorting system for the same samples. It was found that the highest accuracy (99%) was obtained for samples 1 and 2, and the lowest accuracy (98%) was obtained for sample 3. e results of the developed sorting system are used to detect the target product by capturing an image at any position or orientation. One of the reasons to appear such kind of error is the lack of clarity for capturing the image that makes the edge of the product not distinguished. It can be considered the vibration of the camera or product is one of  In this research paper, other techniques of edge detection were explored in order to verify the selected technique and show the advantages of the selected approach compared with other available approaches. Figures 10-12 show the results of sorting based on other edge techniques, where Prewitt, Roberts, and Sobel techniques were selected. Based on the obtained results, existing errors can be noticed to detect the desired product. e Prewitt method finds the product but not in the correct position, and such a case will lead to an inaccurate sorting process and affect the overall performance of the system as shown in Figure 10.
On the other hand, Roberts and Sobel's methods cannot find the desired product and the position was not correct, and then the sorting gate was opened at the wrong time as shown in Figures 11 and 12. e reason for incorrect detection of the products is the detecting process does not cover the entire template of the outer edge for the desired product. e results of the image processing program of the system will give the wrong boundary of pixels in the template and the product image captured. Based on the all obtained   results, it was proved that the optimal method is Canny which is used in this system that has the ability to find the optimal outer edge of the product and obtain high-performance sorting.

Conclusions and Remarks
In this paper, a new automated sorting system was designed and implemented that has the ability to sort any product in real-time. e system can detect the product at any position or orientation and determine the edge of the target product. e template image was prepared out of the processing of the system and changes with changing the type of product. It was found that the time of processing is different, and it is a function of the size of the capturing image and the volume of the detecting product. One of the disadvantages that lead to an increase in the time and decrease in the accuracy of the detections is the low resolution of the used camera. e 8 e Scientific World Journal captured image at a high-speed conveyer belt increased the error in the sorting system because of distorting the image, where the matching process needs sufficient time for detection. e main advantages of the new sorting system are the ability to sort any product with different shapes, even if it is complex in shape. e complex shape products have sharp edges and a lot of curves, for example, sample no. 3 and gears. e limitation of this system is the similar out edge of products like they are all circular or square, etc. Also, there is another important point that should be mentioned which is the suitability of the illumination, where it should be with suitable intensity and distance from the conveyor belt to capture the image clearly. One of the most important points that will be discussed in detail in the subsequent research is how to sort products that are completely identical in their external borders but contain holes and cavities in different locations and sizes. Such kind of sorting needs to study the internal details of the object/product, such as the locations and sizes of the holes, and how to sort it in any orientation.

Data Availability
No data were used to support the study.

Conflicts of Interest
e authors declare that they have no conflicts of interest.