Modifying diddyRedFollowBall to follow flashlight
Forums:
Hello! I am making some, ahem, "extensive" ( ;-) ) modifications to my brand new Diddyborg Red!
I have installed a night vision (no IR filter) Pi camera. I'm trying to modify the diddyRedFollowBall.py program to follow a flashlight instead of a red ball (since red balls don't exactly look red, especially at night with the night vision activated).
I can't quite tune the colors on this line properly:
image = cv2.medianBlur(image, 5) image = cv2.cvtColor(image, cv2.COLOR_RGB2HSV) # Swaps the red and blue channels! #red = cv2.inRange(image, numpy.array((115, 127, 64)), numpy.array((125, 255, 255))) bright = cv2.inRange(image, numpy.array((115, 127, 64)), numpy.array((125, 255, 255)))
Any thoughts? Attached is a sample image taken from the web GUI when shining the flashlight at the Pi night vision camera. Also attached is what an infrared remote control LED looks like to the Pi night vision camera (which would be cool to get working instead of a visible light flashlight).
piborg
Sat, 10/01/2016 - 11:05
Permalink
Colour ranges
In order to change the test it helps to understand what the numbers actualy are:
In order to match the lights you have shown:
Both lights: 0 to 180
Visible light: 0 to 32
IR light: 0 to 160, maybe larger
Both lights: 220 to 255
Hopefully these will get you going.
Since the IR test includes everything from the visible test it would probably work for both lights :)
pdub
Mon, 10/03/2016 - 18:16
Permalink
Nice! Everything now (almost
Nice! Everything now (almost) works! :-D
Thanks for clarifying what the function arguments represented!