How do I convert the following image graph into data (if possible into function)?
I checked this answer and found that my problem is grid and plot have same color.
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityHow do I convert the following image graph into data (if possible into function)?
I checked this answer and found that my problem is grid and plot have same color.
If the problem is only to remove the grid, that's relatively easy. You just remove everything but the grid, then take the difference.
You can use Closing
with a rectangular structuring element to remove everything but the horizontal / vertical grid lines, like this:
img = Import["https://i.stack.imgur.com/TkvSR.png"];
hFilter = Closing[img, BoxMatrix[{10, 0}]];
vFilter = Closing[img, BoxMatrix[{0, 10}]];
then take the pixel-wise min to get the full grid:
grid = ImageApply[Min, {hFilter, vFilter}];
Then simply binarize the difference:
Binarize[ImageDifference[img, grid]]
(From here, you should be able to use code from the answers already linked.)