Modern high-density apple orchards utilize trellis support systems to provide robust tree architecture that improves overall orchard health, supports increasing crop load, and enhances the opportunity for orchard automation. However, these trellis wires can create a significant issue when agricultural robots interact with the apple trees to pick fruits or prune branches. These issues can interfere with the robotic field operations due to collision, harming the robot, tree, or trellis wire itself. This study localizes trellis wires to assist robotic apple harvesting using RGB images captured with an Intel RealSense 435D camera. Trellis wires are positioned horizontally, have a very thin diameter, and are only partially visible throughout the image. In this study, a Mask RCNN-based model was trained to detect the visible segments of trellis wires in the orchard environment using images collected for robotic apple harvesting. These segments were then processed using Hough Transform to estimate the wire location even when the wires were occluded by foliage or other canopy structures. As the trellis wires have linear geometry, their slope and intercept were computed and compared with the ground truth reading for performance evaluation. The proposed system detected the trellis wires in 81 of the 100 test images. In more than 88% of the cases when a trellis was detected, the intercept measured was within 9 mm of the ground truth. Similarly, slope error was within 9 degrees for > 88% of the time. In the future, a field test with a robotic end-effector will be conducted further to validate the outcome and usefulness of this study. Copyright (C) 2022 The Authors.