The advancement of automation and Internet of Things technology has bolstered the automation process in the logistics sector. To address the challenge of localizing and generating grasping positions for intelligent robots in logistics sorting, this study developed an algorithm for item localization. The algorithm relies on enhanced YOLOv3 target detection and instance segmentation technologies to design a position generation algorithm for the robotic arm, which was further refined using sampling evaluation. The experimental results showed that the research-improved target detection model performed better on different datasets in terms of F1 value, accuracy and Area under the Curve (AUC) metrics, with the highest values of 95.77%, 94.05%, and 91.30%, respectively, which was effective in localizing document-like parcels. Meanwhile, the instance segmentation algorithm with fused features took significantly lower values than other target detection algorithms in terms of average absolute value error and root mean square error. The accuracy rate and all-class average precision value were higher than other target detection models, and the fluctuation of the value taken was smaller, which was suitable for logistics parcel localization. The position generation model, based on a sampling evaluation, yielded significantly different values compared to other algorithms. The relative position error and absolute trajectory error indexes were all below 0.4. The combined indexes of grasping accuracy and error indicate the superior performance of the research-designed algorithms. They can effectively enhance the sorting effects of real logistics scenarios. This research contributes to the improvement of the automated sorting system through the use of visual robotic arm technology. Additionally, it encourages the development of logistics automation and the establishment of intelligent logistics factories.