1 | initial version |
I already figured it out. What I did was delete the if else
part and put this code in the ToggleEraser() function:
[...]
Mat res;
image.copy(res, result);
[...]
in that way it creates a new Mat for me everytime I want to use my erasor and 'overwrites' the previous image thus making it work.