I am starting development using the API and the approach I am using is to perform an action using the Browser UI and seeing if I can replicate the results using the API. As I peel back the onion, I am finding questions that I have not found directly in the documentation.
The first question is in regard to Camera Settings.
In the Browser UI, there are 2 sliders for the Exposure and Gain
Exposure range is 0 to 1000, Gain range is 0 to 1000
Using the API, there are settings for the AnalogGain, DigitalGain and Exposure. The documentation implies the following ranges:
AnalogGain 256-1024, DigitalGain 256-65535, Exposure 9000-90000
If I use the Browser UI with settings of both the Gain and Exposure being 500, what would the equivalent settings be using the API for the AnalogGain, DigitalGain and Exposure?
Thank you,
Rob
Hi Rob,
They are proportionally mapped. The API gives raw values that come from the hardware driver on the camera itself, which we decided wasn't a friendly scale, so we mapped them to more resonable values.
For exposure
exposureAPI = exposureSlider * 100
For gain
analogGainAPI = Math.round(analogGainSlider * 0.768) + 256;
If I may offer another point here, the exposure values in the API are not quantized lik they are in the front end. They are stepped to values of 90 (90, 180, 270 ... 990). This is because there is a harmonic interference between the frequency of the cameras and the frequency of the projector that cancels itself out at those values. If you play around with different values and you will see banding occur.
steps of 90 offer (in most cases) enough control over the exposure. If you need a value between quantized steps, then I suggest you use the lower exposure, and adjust with the gain setting.
Hope this helps
Thanks Drew! Very helpful.
One followup.
Should digitalGain be a constant default value if using analogGain or should it mirror the analogGain settings?
@Rob M, they are separate and you can leave Digital gain at it's minimal value. Analog Gain will give better results over Digital gain if needed.
Happy New Year.
I have been slowly moving along with the API and I have a question about Descriptors/Settings/Camera
I have implemented SetCameras and I have been able to independently set AnalogGain, DigitalGain and Exposure for each camera.
I am using Tasks/ListSettings at the start of the program to fetch the scanner state and initialize my UI. However Descriptors/Settings/Camera does not pass back the independent camera settings for AnalogGain, DigitalGain and Exposure but instead passes back 1 value only.
Is this by design or is the implementation of Descriptors/Settings/Camera incomplete?
Thanks!
Rob
Hey Rob,
This is a bug... sorta.... Good catch. The scanner performs better if the cameras are set to the same values and so originally, getting/setting the cameras was kept the same for both cameras. This later got opened up to allow for different settings but obiouslt the getter never got updated.
Good catch.
I'll add this to the bug list.
Sounds good, I was most interested in testing the Three to verify independent control, but as of right now I don't have a pressing reason to implement it. I will just set both cameras the same, especially if the system works best that way.
I do have a question on SetProjector. After power up, the IP address pattern is sticky and if I go straight to StartVideo before opening a project and running a task which changes the pattern, the pattern still exists. I am thinking I have to send a new image to the projector. Is there a suggested image to send to the projector (all black or white?) and are their suggested settings for Projector Image settings like width and height. Thanks!
I did solve my issue with the the IP address image using SetProjector. I was neglecting to send an information in the 'color' field. Once I did so, I was able to have a solid projector. So it appears that sending the 'color' information without any pattern or image information will clear any patterns or images. Thanks!