# Computer Vision Algorithms on a Raspberry Pi 4 for Automated Depalletizing
## 1 Introduction  
In modern factory settings, depalletizing, which involves the ordered removal of specific objects from a pallet, is a crucial task for maintaining efficient material handling and inventory management. Traditional depalletizing methods are labor-intensive, time-consuming, and prone to errors, leading to potential safety risks and productivity losses. Consequently, there is a growing demand for automated depalletizing systems that can streamline this process, reduce human intervention, and enhance overall operational efficiency. Automated depalletizing systems equipped with robotic arms can operate continuously without fatigue, significantly increasing the throughput compared to manual depalletizing. Robots can handle repetitive tasks with consistent speed and precision, leading to higher productivity and reduced cycle times. For industrial use cases, several solutions have been available for quite a long time. Many of them rely heavily on computer vision algorithms for accurate object detection and localization. They leverage imageprocessing algorithms to identify and locate the desired objects on the pallet, enabling a robotic system to pick and move them precisely. With technical, economical, and societal changes, however, automation is becoming more and more pervasive. Robotics has entered small productive contexts and even everyday life, and machine learning-based artificial intelligence is being adopted in almost every aspect of productivity. In this scenario, the need has arisen for solving the depalletizing problem in a cost-effective way so as to make the technology available, for instance, to retailers of goods such as wood pellet bags or to small warehouses, just to mention two use cases. Out of a complete depalletizing system, involving mechanical parts, power, and other components, this paper studies the sub-problem of identifying and locating objects on a pallet. These are assumed to have mildly irregular shapes and to be featuring possibly complex textures and patterns. The focus is on small-scale, cost-effective computers suitable for implementing edge-computing systems, i.e., systems not relying on either the cloud or a central server. The reference architecture here is a Raspberry PI 4, a single-board computer built around a custom Broadcom SoC particularly suitable for Internet of Things (IoT) and edge-computing applications due to its low cost, low power consumption, and ease of interfacing with cameras and other sensors, even if these advantages are counterbalanced by its small memory size and low computing power. It should be noted, however, that working under the hypothesis of computing limitations constitutes a specific design requirement. These limitations rule out the use of more sophisticated, but computationally demanding, solutions. The focus is therefore on some classic object detection algorithms that, while lacking the flexibility of recent deep learning-based models, can be easily implemented in this kind of hardware architecture. This paper presents a comprehensive comparative analysis of four computer vision algorithms for implementing a depalletizing system as follows: pattern matching, scale-invariant feature transform (SIFT), Oriented FAST and Rotated BRIEF (ORB), and Haar cascade classifier [1; 2; 3; 4; 5; 6; 7; 8]. Each of these algorithms offers unique strengths and limitations, and their performance is evaluated based on several key factors, including accuracy, robustness to variability, computer speed, detection sensitivity, and resource consumption. Although in the literature, the four chosen algorithms have already been implemented on various Raspberry architectures [9; 10; 11; 12; 13; 14], in this work, we developed them on a specific Raspberry PI 4 platform and evaluated their performance on the same test images specific to the depalletizing application so that we could compare them and choose the most suitable ones for a specific system, considering their accuracy and recognition latency.