OpenCV  3.4.4
Open Source Computer Vision
samples/cpp/squares.cpp

A program using pyramid scaling, Canny, contours and contour simplification to find squares in a list of images (pic1-6.png). Returns sequence of squares detected on the image.