There are so many ways to try and see. Random thoughts:
- search twice, with two patterns, one for white paper, another for green paper
- convert image to grayscale
- convert to grayscale and binarize with threshold
- look for a single segment pattern, not the entire line. Then, in the result, look for a dotted horizontal line
- use morphological operation hit-or-miss:
https://docs.opencv.org/master/db/d06/tutorial_hitOrMiss.html