Hello everynyan!
Im new to programming, I am working on my finals schoolproject and I met a specific issue that im trying to solve.
My question is in the title. I read the vilib documentation and vilib apparently only is capable of detecting one color at a time. But it was trained on 6 colors? I wonder if its possible to somehow make vilib recognise both for example Blue and Red in one picture.
For my specific usecase it would already suffice if it was possible to detect a colour without defining which colour to detect first.
I thought of a potential solution to this but idk if this would work:
Goal: while driving, the Pi Car X is supposed to recognise color A or B or C.
Restriction: Vilib only detects one color at a time (only A, B or C)
Potential solution:
Make vilib rotate through a Cycle of A,B or C detection really fast:
(heres the idea in noobish fictious programming language)
Pi Car X drives
while true:
vilib.color_detect(color=”A”)
if color A is detected, do X
else vilib.color_detect(color=”B”)
if color B is detected, do Y
else vilib.color_detect(color=”C”)
if color C is detected, do Z
loop
If this cycle would be able to happen really fast while the picar is driving rather slow, would this work? Im consciously ignoring aspects like the pi car recognising the wrong colours or environmental issues to this, i want to know if this would theoretically work.
Have a nice day :3