Skip to main content

Shape detection using OpenCV

Project description

Color Thief

A module for detecting shapes using OpenCV.


pip install shape-detection-jdla


Square detection rules:

  • There must be four corners
  • All four lines must be the same length
  • All four corners must be 90°
  • Lines AB and CD must be horizontal lines
  • Lines AC and BC must be vertical lines
  • The contour must be concave


from shape_detection.square import Square
import numpy as np

    contour = np.array([[[368, 160]], [[391, 163]],
                        [[384, 200]], [[361, 194]]])

    square = Square.is_square(contour)


except Exception as e:


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shape-detection-jdla-0.0.2.tar.gz (7.2 kB view hashes)

Uploaded source

Built Distribution

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page