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.2.tar.gz (4.3 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.2-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: color-detection-jdla-0.0.2.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for color-detection-jdla-0.0.2.tar.gz
Algorithm Hash digest
SHA256 f3d4c741ac97b247d901b53c88ef2313573364364e7ecaac25919da4756274ce
MD5 0b86bdcc6aae899e9b01d5ecf395b883
BLAKE2b-256 b07c52f4ebf41319466fb5577fca49752595e5bea12f5bb4edd315c8383018e0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: color_detection_jdla-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for color_detection_jdla-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fb13cef5fce917003aa1ef6bd84ed7c1c115e089d332f874fd22807599e53969
MD5 b40fb93b868e4a777c9cfe1ab64bac21
BLAKE2b-256 e84153389e752cf1c2afd5c899c051aadc88ff6312c55eb592732a872f1ea027

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