Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900