{'fraction_non_alphanumeric': 0.021968676918715895, 'fraction_numerical': 0.010133938062504429, 'mean_word_length': 4.597778659262198, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Real-time Autonomous Robot for Object Tracking using Vision System

Researchers and robotic development groups have recently started paying special attention to autonomous mobile robot navigation in indoor environments using vision sensors. The required data is provided for robot navigation and object detection using a camera as a sensor. The aim of the project is to construct a mobile robot that has integrated vision system capability used by a webcam to locate, track and follow a moving object. To achieve this task, multiple image processing algorithms are implemented and processed in real-time. A mini-laptop was used for collecting the necessary data to be sent to a PIC microcontroller that turns the processes of data obtained to provide the robot's proper orientation. A vision system can be utilized in object recognition for robot control applications. The results demonstrate that the proposed mobile robot can be successfully operated through a webcam that detects the object and distinguishes a tennis ball based on its color and shape.


INTRODUCTION
Mobile robots incorporating vision systems are the most desirable in their environment. They can move around freely, without being fixed to one particular physical position [1]. A mobile robot needs appropriate real-world information in real-time for improved navigation [2]. In addition, object tracking methods such as autonomous vehicle navigation, surveillance and many other applications are used in various robot vision applications. Although many studies and experiments have been carried out in recent decades, they have been concerned and committed to solving the problematic issues of monitoring the desired objective in chaotic and noisy environments [3]. The precision and versatility of intelligent robot solutions are improved by a robot with vision capability [4]. There exist many applications involving robots with vision systems, particularly in the manufacturing industry, research in science development, as well as space navigation purposes, because the vision system has provided numerous advantages [5]. A controller must be programmed to adjust the robot's movements in order to create an autonomous mobile robot equipped with a vision system (i.e. camera) to navigate through the desired locations and locate desired objects [6]. By introducing this autonomous robot according to the images obtained, many advantages could be accomplished using image processing, such as securing buildings, maneuvering through dangerous environments, and so on. In this work, the Visual Basic programming language was used to program RoboRealm software [7]. Matlab was used to program the PIC microcontroller using a fuzzy logic concept [14][15][16]. In this paper, we developed a real-time autonomous robot for object tracking using the vision system by controlling a camera in the vision range of a robot that was used as a sensor in front of the robot, then by extracting camera information, it is used to actuate the motion of the robot. Figure 1 depicts the system's overall layout. The device includes a camera attached to a minilaptop as a vision sensor. The laptop is connected to the main controller through a motor driver circuit that interfaces with the robot motor using a PIC chip [8]. The mobile robot is programmed to find its path, monitor and use a webcam to follow an object, follow the path and monitor the object [9]. A control system helps the robot to keep tracking the object and follow it as it travels once the object is detected. The boards are mounted on the robot, including the camera that captures images which processes them through the compact microcontroller that adjusts the robot's motion and orientation according to the object's location. The robot must be capable to independently detect an object of interest and track it [10].

II. METHODOLOGY
A web camera is used and mounted on the front of the robot. Due to cost constraints and for the purposes of small robots, it is intended to be as simple as possible [11]. A PC was used to be mounted on the top of the robot as the main controller for faster image processing, due to the computational complexity and extensive processing needed for image processing. This PC holds the decision-making algorithms. It performs the task of obtaining and processing image data from the camera, instructing the microcontroller to communicate with the positioning motors, and enabling the robot to move [12]. The PC is chosen because it provides a large competency of data processing results that can be visualized on the computer monitor, hence facilitating the fine-tuning process. To interpret, process and adjust the robot according to the incoming signals captured by the camera, a microcontroller is used. The microcontroller works as an interface to convert the computer system's serial data into a motor control signal to coordinate the robot's motors and drives. The robot's movements are determined by two stepper motors. The microcontroller controls them via a UCN5804B motor driver circuit to facilitate the programming section [13].

Vision System
(Camera) Computer system as the main controller to process the image To control the electronic instruments and drive motors, an appropriate power source supply was used. In order to enable the movement of the robot motors, the main circuit and circuit driver of the robot are supplied by 12V and ~2A battery.   The three layers of the mobile robot are located 6 cm apart to allow the circuits to be mounted at a sufficient distance. The complete structure of the robot is shown in Figures 2 and 3. The main board is put on the top layer including the microcontroller and stepper motor controller circuit in the second layer. The stepper motors are also carried on both sides of the layer, and a mini laptop is put in the third layer. A cargo ball is mounted in the front part of the layer. The battery to power the robot is located in the second layer. The stepper motor controls the motor drivers shown in Figure 7, and consists of a UCN5804B controller for the stepper motor speed and direction control. There are three operating modes that can be selected according to the desired operation. For stepper motors, the two-phase operating mode is usually used, and the DIP switch is used to choose the appropriate mode of operation. Figure 7 shows the schematic view of the UCN5804B circuit, while Figure 4 shows the circuit 's actual configuration [17]. Two UCN5804B chips were used in both figures to independently power each motor. For the stepper motors, a 12 v power supply (battery) was used, while the circuit was operated by a 5 V source [7].

Figure 7. Motor Schematic Circuit
Image processing was used with the help of RoboRelm software with fast image real-time processing. It is resistant to different sizes, regardless of how far the object from the camera is. It uses a color filtering technique to consider the specific colors of objects, while other object colors are ignored. Since the object to be found is a tennis ball, the circular detection algorithm was used to check for the ball's centroid, even with some surface erosion of the circular form. If the ball is detected, an estimate of the ball's position is sent to the microcontroller, to give commands to the motor driver circuit to operate the motors to travel to the desired object and continue tracking it. Until the ball is detected, the robot is programmed to spin and search for the object if it disappears from the view of the camera. Figure 8 shows the image processing task.

Solid State Technology
Volume: 63 Issue: 6 Publication Year: 2020 Figure 8. Image processing techniques flowchart Figure 9 displays the PIC flowchart to regulate the direction and orientation of the motors. First, it specifies and initializes the input and output ports and the UART. Two red LEDs will blink to indicate that the initialization has been completed. It will wait for a moment to check if the data in the UART buffer is ready. The UART receives the data and initiates a selection loop to execute the appropriate command, based on the received data. Figure 9 shows six possible data items could be gathered with their corresponding actions. When the signal in the buffer is ready, the UART is read repeatedly [13]. Read   The complete ball detection process is as shown in Figure 10. The predefined custom color is green when only the green color channel is used, and any green color variation is caused by the other channels. The RGB filter in Roboleam's vision uses its values, and the filtration decreases all pixels that do not belong to the selected colors, depending on the particular color selected. This feature varies from the RGB channel in that white pixels are often diminished, even though the selected color may be included where G = (G-R) +(G-B) and R=0, B=0 (1) The pixels with dark or white colors are omitted using a thresholding property that does not contain a sufficient green color. Any green noises caused by changes in lighting or intensity are removed by a degree of hysteresis that is applied to the object. Figure 12 shows the segmentation of the green ball from the background for further processing. The noises created by additional factors such as lighting intensity and the presence of moving particles are filtered out by a mean or average filter. By taking the average of pixels, the object is further smoothed and blurred, which has the benefit of removing any unwanted differences in noise factors. Figure 13 shows the resulting object. It can be shown that the green pixels in Figure 12 are connected by comparing Figures 11 and 12, removing any gaps between neighboring pixels or any other pixels that are not part of the ball. It also helps to eliminate textures beyond the ball's diameter [13]. The shape of the ball represents the image using circular shape properties to lead to an absolute spherical ball. The circular shape is detected based on the selected threshold angle. In addition, the radius is specified within a specific range of 10-210 pixel values. The pixels that are not part of the object are ignored by applying point clustering and linking pixels that are similar to each other to group objects. It is a method of discarding any pixels that are not part of the ball by adding a limit. The product of point clustering is shown in Figure 13.   Figure 14 shows the eliminated portions of the image after a thresholding process has been passed to eliminate portions of the image that fall within a defined range of intensity. The image is divided into parts that have consistent intensity values. Only green color pixels are selected, and the other colors are deleted. Lighting conditions are considered to avoid the need to adjust the parameters as the lighting variables change. The robot may also be used in various environments with varying lightening conditions. The center of gravity is used to locate the coordinates of the ball's center, which allows the robot to align it itself according to its coordinates, which are considered the most sensual part image processing. The ball centroid coordinates are shown in X and Y, as shown in Figure 16. The location of the ball is required to be identified by using the X coordinate, and whether the ball is in the left or right of the reference point. This is calculated as follows: where x_n is the coordinate of the n th pixel, and n is the total pixels in the chosen object. The box encircles the ball, and its size is important to evaluate how far the ball is from the camera. The robot will go backwards and stop if the size of the box is large to avoid hitting the ball.   The mobile robot's orientation and direction are centered on the ball's location, relative to the reference point indicated by the image's mid-point (640 by 480). Figures 17 to 22 display the six different potential mobile robot directions. If the robot camera does not locate the ball, the search mode is set by spinning on the spot before the ball is located, as shown in Figure 18. When the RoboRealm program gives the order "P" to the microcontroller, the robot starts the "navigation" mode. Otherwise, the robot moves forward to the ball within a certain value range of 70 pixels to the left or right of the center of the frame if the RoboRealm gives the microcontroller order of 'F', as shown in Figures 17 and 18.

Figure18. Forward
The box size determines whether the ball is close to the robot. If the robot is sufficiently in close proximity to the ball, the PIC receives an "S" signal to inform the robot to stop moving. The robot will stop due to the location of ball if the size of the box is 136 with the range 130 to 130 + 100. The robot moves backwards and prevents the ball from crashing if the ball approaches the robot within a range greater than 230. As a consequence, the PIC receives the "B" signal, as shown in the Figure 19. The PIC receives the command "L" if the ball is on the left, and command "R" if it is on the right, as shown in Figures 22 and 23 respectively. The PIC gives the order to the motors to travel left and right, tracking the ball. The box size surrounds the ball within the range of 10 to about 130, to make the robot move forward, left or right, and also makes the robot stop or move backwards. The size of the box is needed for calculation of movement.

IV. CONCLUSION
The vision system object tracking robot was successfully accomplished using only a webcam as the main object detection sensor, demonstrating a great ability to distinguish a tennis ball based on the color and shape, and track the ball as it travels in any direction. The robot has been fitted with the mechanism to search for the ball, and keeps monitoring it if the ball is not present in the view of the camera by spinning in place until the ball is detected. Extensive image processing techniques and algorithms need to be processed on-board using a mini-laptop for rapid processing to accomplish the task. The interpreted information is transmitted to the microcontroller, and converted into real world orientation.