Skip to main content

Shape detection using OpenCV

Project description

Color Thief

A module for detecting shapes using OpenCV.

Installation

pip install shape-detection-jdla

Overview

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

Example

from shape_detection.square import Square
import numpy as np

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

    square = Square.is_square(contour)

    print(square)

except Exception as e:
    print(e)

Links

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.1.tar.gz (6.7 kB view hashes)

Uploaded Source

Built Distribution

shape_detection_jdla-0.0.1-py3-none-any.whl (8.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page