This article proposes a more accurate grasping strategy for the recognition and grasping of moving targets based on binocular vision cameras. Firstly, the front and back scene separation algorithm is used to identify the moving target grabbing object in the production line. Then, by setting an appropriate threshold, the SiamMask target tracking algorithm is improved to achieve dynamic target tracking. Finally, the conveyor belt speed is detected and the real-time position of the object is obtained. Then, the Cartesian strategy is used to achieve path planning and optimization methods for the robotic arm during movement. Through experimental simulation, the effectiveness and stability of the proposed method in this paper have been demonstrated.