I have an image like the one attached. I have it in binary format.
How do I complete the white lines so the first lines crosses x=0 point, and the remaining lines are finished until they cross each other?
This script should be flexible enough so the number of lines may change (more gaps) and they don't necessarily are lines. They may also be curves.
Here is another example where there are more gaps in data.
Thank you for your help!