How can I automate/create a light/levels regulation system for this program?

Hello fellow TouchDesigners, recently I’ve made a program that uses a Kinect1 to capture iterators images through the RGB camera and their movements through the Kinect CHOP skeletal data and displays their images as a Point Cloud image effect. Iterators movements affects the Particles Physics. However, I’ve stumbled upon a problem, I’ve installed this work already in two places and the ambient lighting changes through the course of the day. This caused the final result image to change. Sometimes there is not much light to see clearly and the final result gets compromised negatively, also, as it is, it depends of my presence during exhibitions to regulate the values of the program and it requires me to stop the experience to make adjustments . My program has several “Level” TOPs operators to regulate image exposure of the camera and the of the final filter brightness.

My question is: Is it possible, analyzing this program that I’ve shared here, to create a self regulatory lighting system? Is there an specific operator that can sense if the RGB camera image is too dark, too bright and how could I automate my program to regulate the levels and thresholds, so the Ambient Light regulates the final result Image levels?

I’ve asked CHAT GTP and it gave me the idea to Integrate an Arduino Board with TouchDesigner. I do have an Arduino and LDR sensors, if that’s the way, how could I make this communication between platforms? I would Connect the LDR (Light Dependent Resistors) to the Arduino Board, program the Arduino with some code in the Arduino IDE and Connect it to TouchDesigner via Firmata? Is there some other way/ technique of doing what I’m looking for using only TouchDesigner? Help! Thanks in advance community!

The Program :
kinect point cloud estudo if statement.4.toe (488.0 KB)

Hi @l3v1at4,

a very simplistic approach could be to convert your camera image to an HSV colorspace (RGB to HSV TOP) which now gives you hue,. saturation and value information instead of individual r g b color channels.
With this we can use an Analyze TOP to get the average of the value channel. This information can be converted into a CHOP channel using the TOP to CHOP and now used to create a factor when compared with the target value.
Use this factor in a HSV Adjust TOP to control the Value Multiplier and your image will always have an average value as you specified.

Have a look at included component and see if it works - it’s really simplistic but might just be enough…

cheers
Markus
base_autoBrightness.tox (1.0 KB)

1 Like

Thanks a lot for the insight @snaut! This seems like an elegant and simple solution. I’ll try this approach and also thanks a lot for sharing this example! I’ll study this and later come back with some updates.