Error when using Colour Picker
Hi Jonathan,
I am trying to use the colour picker Python script, but when I run the file I get this error:
usage: color_picker.py [-h] -i IMAGE [-l LOWER] [-u UPPER]
color_picker.py: error: argument -i/--image is required
How do I define an image in this script? Thanks for helping.
@tjbruce17594: You will need to take a picture or slice an image from your video that includes the object you'd like to track. You can use the included image as an example: python color_picker.py -- image IMG_1964.JPG.
The color picker is used to help identify the HSV values to use for the upper and lower bounds when creating the pixel mask that identifies the object. The idea is you would create an image of the object, use color_picker.py to find the upper and lower bounds by clicking on the ball in the image, then input those colors into ball_tracking.py https://github.com/jonathanfoster/ball-tracking/blob/master/ball_tracking.py#L28.
Currently, the upper/lower color bounds are hard coded for the included video. There's an image I attempted to use for the get upper/lower bounds, but it isn't a solid color so the range wasn't practical for identification. The ball in the sample video is much easier to track because it's a solid color.
I never really did much more than just experiment with this repo. I ended up going with another approach for the problem I was attempting to solve. Hopefully what I have here helps you out. If you need more info on OpenCV, check out https://www.pyimagesearch.com/.