Click here to Skip to main content
14,426,608 members
Rate this:
Please Sign up or sign in to vote.
I want to have a color detection for a particular region in a video.
Afterwards, I want to check whether the brown color within the box is greater than threshold. If yes, the program print "detected".

How can I only detect the color within a specified region?

What I have tried:

For example, my program will detect people and bound him with a rectangular box.

image = cv2.imread(imagePath)
(rects, weights) = hog.detectMultiScale(image, winStride=(4, 4),
    padding=(8, 8), scale=1.05)

# draw the original bounding boxes
for (x, y, w, h) in rects:
    cv2.rectangle(orig, (x, y), (x + w, y + h), (0, 0, 255), 2)


Afterwards, I want to check whether the brown color within the box is greater than threshold. If yes, the program print "detected".

How can I only detect the color within a specified region?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100