## 3 Materials and Methods  
Our suggested solution for the sorting task incorporates Microsoft Azure Custom Vision, a cloud service that enables the localization (obtaining the position) and identification (obtaining the type) of items in a picture using a user-created custom model. The position is denoted by a bounding box in which the object is contained, and the type is represented by a tag and a detection confidence returned by the service. The model was trained using 40 images, taken by a camera in good illumination conditions, with plenty of natural light, of 5 objects of different shapes and colors (a black circle with a radius of 16.5 mm; a purple square with sides of 25 mm; a green rhombus with sides of 25 mm; two yellow trapezoids with bases measuring 50 mm and 25 mm, respectively; and a red hexagon with sides of 25 mm), placed in different positions and orientations. The training is performed by assigning bounding boxes and tags for the objects present in the training images, and then an ONNX model is computed by the service. The result of the training process can be seen in Figure 1.  
The layout of the system is made up of an industrial robot, an IRB 140 from ABB, a vision system, an Ace2 R a2A2590-22 gcBAS [23] camera from Basler with a C125-1620-5M f16 mm lens [24], the Microsoft Azure Custom Vision cloud service, and a computer that acts as an interface between the previously mentioned components, as shown in Figure 2. The same system is presented in Figure 3a, where the vacuum suction gripper used for manipulating the objects is highlighted. The computer is the centerpiece of the system. It runs a Python script that connects to the camera via a GigE connection, using the Basler pyPylon wrapper and requests images from the camera. The vision system, upon receiving a request, takes a picture and sends it back to the computer, where the same Python script creates a connection to the cloud and sends the pictures to Microsoft Azure Custom Vision over an API, and then awaits a response. When the cloud service API response is received, it is processed and transmitted to the robot arm-robot controller pair for the sorting process. Figure 1: Training result of the model. Figure 2: Cloud vision system architecture. Azure AI Custom Vision provides an API answer in JSON format that includes the kind of item identified, the position, indicated by a bounding box, and the detection probability. Following camera calibration, the object location in camera frame, in millimeters, is calculated using the pixel-to-millimeter ratio. Applying a coordinate system transform (Figure 3b), the position of the handling point in the robot frame is obtained and finally transmitted to the robot controller over the Ethernet connection by the Python script. The coordinate system (P1P3P2) for robot-camera calibration is adjusted in the vision system based on the points that are learned with the robot. For this, a special target (arrow) is used. The event diagram for the whole procedure can be seen in Figure 4.  
Figure 4: The event diagram. Figure 3: (**a**) The physical system and its components. (**b**) The transformation from the robot plane to the vision plane. Experiments were conducted through a material handling task executed by the already introduced industrial robot, which uses guidance information from two sources:  
1. The proposed machine vision service;
2. A commercial machine vision software, namely MVTec Merlic. Both vision systems use the same acquisition solution, namely a fixed network industrial camera (the GIGE type from Basler) that inspects the vision plane. The handling principle, presented in (Figure 3b), uses the concept of workobject which is a reference frame used to define the position and orientation of a workpiece or fixture in space. In our case, the workpiece is in the vision plane. The robot-camera or hand-eye calibration (ref) consists of the following:  
1. Aligning the axis of the vision plane with the axis of the robot workobject;
2. Overlaying the origin.