I'm in the process of designing a semi-automatic graph digitizer that can convert screenshots of a graph into a CSV file with the data.
I'm running into an issue when certain graphs contain characters and text boxes in the graph space, as in the example images below:
After removing the gridlines and producing a binary image "curve" (that's supposed to contain just the curve), my current code uses
to determine the x and y position of points on the curve. However, if there is any text on the graph, the code thinks it's part of the data curve and finds points in its location. As in the above examples, the code "finds" datapoints where the 'Conditions' and '3C96' text is located.
My question is: Is there any way to automatically detect and mask over this text, perhaps using OCR? Or is automating it a lost cause, and I should instead manually crop out any text initially?