In order to enable intelligent orchard management and the application of harvesting robots, it is necessary to improve the accuracy of computer vision technology for green fruit segmentation in complex orchard environments. However, existing segmentation algorithms are unable to generate precise fruit masks in such environments. This paper proposes a novel and efficient segmentation algorithm called Mask Positioner for accurate fruit segmentation. The Mask Positioner applies a layer-by-layer filtering approach to refine feature maps generated by the detail refinement network, resulting in a refined mask. The selected pixels are then input to the order decoder to determine their relevance to the fruit region. Finally, the determined pixels are used to generate the final mask, resulting in accurate and efficient fruit segmentation. Mask Positioner is verified by a green persimmon dataset made for the complex background. The experimental results show that the segmentation accuracy of Mask Positioner reaches 67.4%, and the detection accuracy reaches 69.1%. For small fruits, its detection and segmentation accuracy are at least 1.0 and 3.2 percentage points higher than other algorithms. Additionally, the generalization ability of the algorithm is verified using a green apple dataset. Experiments show that it does well in the green fruit segmentation.