Ask Your Question

Revision history [back]

click to hide/show revision 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.