Can someone please guide the steps/the operation to be performed to construct this image and detect the broken fence position of the Image.
- Thresholding the image to a binary image : to convert the input image to a binary image
- Inverting the image : inverting it to get a black background and white lines
- Dilation with SE one unit of the fence structure
- Apply Erosion
- Bitwise-and masks together: retrieve the original back- and foreground the image is inverted by subtracting the bitwise_or from 255
- Constructed Image - Original Image will give us the position of the broken fence
Will this solution work ?

Depends what you call locate.
After large horizontal erosion and binarization: