Removing patterns by subtracting from "ground truth".

Based on this thread I developed a new idea: as the vertical stripes look the same and are on the same position all over the screen, I copied the pattern and spread it all over the screen. My goal is now to compare all pixel of the current image of the video with pixels of the reference image and whenever the same pattern comes through, the background should be set to white.
Pixel by pixel comparison is bad, though, as it is about the pattern and not occasionally the same colors.
How do I do this in a performant way?
Pixel by pixel comparison is bad, though, as it is about the pattern and not occasionally the same colors.
How do I do this in a performant way?