Art Installation - Shape recognition

February 22, 2023, 22:38

kash00042

Hello @everyone, I'm new to programming, let say it first. This is my first big project, and it needs to be done for the end of June. So I still have lot of time. The idea : Have a big cloud at few feets high that react to people dancing under. This will trigger thunder, lighting, and rain. This is for a Burning Man installation (if you know it), so in the middle of a desert. How : Use the camera placed top down to recognize some shapes or even simple objects (umbrella, cloud, thunder) drawn by people underneath. Activate addressable LEDs, play some sound, and activate a water pump with a 4 way relay What I have : Rasp 3b Raspcam IR Raspberry DAC Volumio WS2811 LED 12V water pump 4 Way delay, 12V So at this point, I'm not sure how to handle the recognition part. I was thinking of openCV and some shapes recognition, but having people, shadows and so this will probably not work. So maybe training some GAN, but I can't find enough picture to create a proper dataset. Maybe there is a better solution that I'm not aware. If anyone has an idea on how to do ? Thank you

kash00042

There is the project so far, i used OpenCv and the contour comparaison function. But I have no results so far. I'll continue digging. https://github.com/KashCorp/Nuage/blob/main/Nuage3.py

ebr1965

not what you need but does have motion tracking and some contour detection/counting. some extra math could get it to detect shapes

ebr1965

the pre recording dosent work btw. idk y. some formatting issue i think

sherpapsu

Not a perfect answer, but creating awareness for you. I've followed this guide to create some object detection. https://medium.com/@madhawavidanapathirana/real-time-human-detection-in-computer-vision-part-2-c7eda27115c6 There are pre-trained models for common objects that you could leverage (I believe its called COCO...common object...something something) so that you don't have to train your own models. I'm a little skeptical that a Pi could do real-time object recognition (often times you engage a GPU to help recognition speed and accuracy), but I'm not expert here. So wishing you the best!

kash00042

Thank you. I've moved to more simple algorithm. I use detection for object in movement. Way more simple to handle.

kash00042

But I'm facing a question. I tried to slow the frame rate of the Rapsberry Pi Camera V2.1 to like 12 frames using this function : while True: # Récupération de l'image ret, frame = cap.read() # Réduction de la fréquence d'image if cap.get(cv2.CAP_PROP_POS_FRAMES) % 12 != 0: continue

kash00042

But my program get stuck at this point. How can i reduce frame rate on the Camera in order to reduce GPU usage ?

kash00042

Could this be a solution ? https://gist.github.com/CarlosGS/b8462a8a1cb69f55d8356cbb0f3a4d63 I don't know how to implement it tho.