In recent years, with the rapid development of artificial intelligence, machine vision and other related technologies, there has been a demand for higher levels of intelligence in UAVs. There are many excellent SLAM systems available, but most of them assume that their working environment is static. When there are dynamic objects in the environment the localization and mapping accuracy of the SLAM system is reduced, and it can even cause its tracking to fail. To solve this problem. In this paper, we propose a target detection-based SLAM algorithm for real-time operation in crowded dynamic environments.The algorithm removes feature points of dynamic objects from key frames and then constructs a point cloud map of based on the state-of-the-art SLAM system ORB-SLAM3. Finally, the proposed method is validated and evaluated on multiple dynamic datasets and real environments. The results show that the algorithm in this paper outperforms other visual SLAM algorithms in terms of localization and map building accuracy in more highly dynamic datasets, while guaranteeing performance.