Bits of code using OpenCV2 in Python