Histogram data available from scripting

Discussions on extending SharpCap using the built in Python scripting functionality
Post Reply
Posts: 10
Joined: Sat Dec 26, 2020 7:11 pm

Histogram data available from scripting

Post by Droy »

We are writing an application to control remotely a few SharpCaps with a camera on each of them. The idea is to automatize the simultaneous capture from different cameras of the same object. You already helped me with the automation of the focus assistant in this forum:


What we face now is how to get histogram info from the script once the camera is active, to be able to send it to the remote controller to analyze it there and take decissions about camera controls (Gain, brightness, etc). So here my question:

Is there any way we can access to the histogram data from script for me to sent it to the remote controller where I can create the graph?

Initially we would like to do a manual remote control base on a "eventual histogram graphic" created with the data from each server, we want to avoid to do a manual VNC connection one by one to all the SharpCaps servers we plan to work with to do the same task. Now we are able to change all the camera controls remotely, but no idea how to get histogram data.

Maybe, in the future, we can try to do some automatization in the controls settings base in the histogram, but I must confess any algorithm seems to me quite difficult.

Any idea or help to get this info will be very appreciated.
User avatar
Site Admin
Posts: 6621
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK

Re: Histogram data available from scripting

Post by admin »


there is no direct way to access the histogram data that SharpCap shows using scripting. However, you can build a workaround by hooking the FrameCaptured event (see viewtopic.php?t=1141) and then accessing the raw frame data. Probably the easiest way to do this is to call .ToBytes() or .ToUshorts() on the frame (8 bit or 16 bit) to get back either an array of bytes or an array of unsigned 16-bit integers which you can then process.

Hope this helps, Robin
Post Reply