Autonomous navigation of unmanned aerial vehicles (UAVs) has become in the past decade an extremely attracting topic, also due to the increasing availability of affordable equipment and open-source control and processing software environments. This demand has also raised a strong interest in developing accessible experimental platforms to train engineering students in the rapidly evolving area of autonomous navigation. In this paper, we describe a platform based on low-cost off-the-shelf hardware that takes advantage of the Matlab/Simulink programming environment to tackle most of the problems related to UAV autonomous navigation. More specifically, the subject of this paper is the autonomous control of the flight of a small UAV, which must explore and patrol an indoor unknown environment. Objectives: to analyse the existing hardware platforms for autonomous flight indoors, choose a flight exploration scenario of unknown premises, to formalize the procedure for obtaining a model of knowledge for semantic classification of premises, to formalize obtaining distance to obstacles using data camera horizontally employment and building on its barrier map. Namely, we use the method of image segmentation based on the brightness threshold, a method of training the semantic segmentation network, and computer algorithms in probabilistic robotics for mobile robots. We consider both the case of navigation guided by structural visual information placed in the environment, e.g., contrast markers for flight (such as path marked by a red tape), and the case of navigation based on unstructured information such as recognizable objects or human gestures. Basing on preliminary tests, the most suitable method for autonomous in-door navigation is by using\ object classification and segmentation, so that the UAV gradually analyses the surrounding objects in the room and makes decisions on path planning. The result of our investigation is a method that is suitable to allow the autonomous flight of a UAV with a frontal video camera. Conclusions. The scientific novelty of the obtained results is as follows: we have improved the method of autonomous flight of small UAVs by using the semantic network model and determining the purpose of flight only at a given altitude to minimize the computational costs of limited autopilot capabilities for low-cost small UAV models. The results of our study can be further extended by means of a campaign of experiments in different environments.