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.3.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.3-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: color-detection-jdla-0.0.3.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.0

File hashes

Hashes for color-detection-jdla-0.0.3.tar.gz
Algorithm Hash digest
SHA256 faf38e06a60f13df024f6ec345560b7b013fa3f6d9e7f6a3786c8c4bd016abe9
MD5 5fe478f9b1c3bd78d87647e0823695e7
BLAKE2b-256 c36bcb25e67ca84cb744f5e6b8324ec4f42c5a8bc5e41b11087a868e01eebeaa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for color_detection_jdla-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 553618de57ac92a8db83da86ad036be30155832d27e1a66a95ff4b192b19a649
MD5 1aec3096770498d59bd4cb7a76e73495
BLAKE2b-256 733a91dd22ca382bcaf3c132b6c39fad8648c7123a3feac04f53abfc516ec527

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