I'm chasing 2 answers to help with a script I'm currently working on + any other additions, revisions or simpler ways you can see on what I've done already.
I've currently got an OpenCV head tracking script that identifies a rectangle one head height below the actual head and its averaging the color into a RGB format.
This output is too complex for what I need so I need a way to simplify the numbers down into the ones below, in addition to this once simplified I need the number in brackets to be assigned to a 'cref' integer for later use.
Red - 255, 0, 0 (1)
Green - 0, 255, 0 (2)
Blue - 0, 0, 255 (3)
Yellow - 0, 255, 255 (4)
Black - 0, 0, 0 (5)
White - 255, 255, 255 (6)
I envision a huge < & > else if statement but wanted to see if anyone had other thoughts on how to make it more streamlined.
The second question: I want this all this like a slideshow, by that I mean. Until someone walks into the frame I want the head tracking to continuously scan. But once it identifies someone's head I don't want it to refresh, I want it to display the simplified color for 20seconds then go back to searching for another head.
I've seen many different ways to do this but I cant have the program using a wait function or anything like that as I need some other functions run during this process.
I'm chasing 2 answers to help with a script I'm currently working on + any other additions, revisions or simpler ways you can see on what I've done already.
I've currently got an OpenCV head tracking script that identifies a rectangle one head height below the actual head and its averaging the color into a RGB format.
This output is too complex for what I need so I need a way to simplify the numbers down into the ones below, in addition to this once simplified I need the number in brackets to be assigned to a 'cref' integer for later use.
Red - 255, 0, 0 (1)
Green - 0, 255, 0 (2)
Blue - 0, 0, 255 (3)
Yellow - 0, 255, 255 (4)
Black - 0, 0, 0 (5)
White - 255, 255, 255 (6)
I envision a huge < & > else if statement but wanted to see if anyone had other thoughts on how to make it more streamlined.
The second question: I want this all this like a slideshow, by that I mean. Until someone walks into the frame I want the head tracking to continuously scan. But once it identifies someone's head I don't want it to refresh, I want it to display the simplified color for 20seconds then go back to searching for another head.
I've seen many different ways to do this but I cant have the program using a wait function or anything like that as I need some other functions run during this process.