Skip to main content

Color Detection using OpenCV

Project description

Color detection with OpenCV

Python module for detecting the color of a OpenCV frame.

Installation

> pip install jdla-color-detection

Usage

from color_detection.detect import Mask
import numpy as np
import cv2

# Get dominant color
image = cv2.imread("img/blue.jpg")
color = Mask.detect_dominant(image)
print(color)

# Detect color
my_mask = Mask("Blue", [90, 60, 0], [121, 255, 255])
detected_mask = Mask.detect(color, [my_mask])
print(detected_mask.name)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Acknowledgments

This module uses ColorThief for grabbing the most dominant color of a contour.

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

color-detection-jdla-0.0.1.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

color_detection_jdla-0.0.1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file color-detection-jdla-0.0.1.tar.gz.

File metadata

  • Download URL: color-detection-jdla-0.0.1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.25.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.2

File hashes

Hashes for color-detection-jdla-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d5af2e7f39f8a47cbc0b817064c733b916eec7bd07e8ed79ed2b522c3bbfbd71
MD5 cf4c081c03a497b00a7744a40c2a741c
BLAKE2b-256 01ef40dead92e9b00dd65be34b48479508bd0ba8f9efbf09e045381125f4abc7

See more details on using hashes here.

File details

Details for the file color_detection_jdla-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: color_detection_jdla-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.25.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.2

File hashes

Hashes for color_detection_jdla-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 96aab933463dd7b54c466cc3f7a1a927ee4a420fb6db46501418b6abb7dc4757
MD5 bbae6f49260f12731b95bba368bd0b0d
BLAKE2b-256 60e053734d4266b8ead3d7d586a64694d694f54d2563d726189689f746161273

See more details on using hashes here.

Supported by

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