We are working on a problem that requires adjustment of the camera capture parameters. For example, we may adjust exposure and/or gain before capturing an image. I am using the Python API. We plan to port the code to C++ at a later stage.
Currently, when I change a capture parameter, I thereafter call the capture command twice:
The first capture updates the camera settings with the new value/s.
The second capture acquires the image with the new settings.
Is there a better way to do this i.e. call capture only once? We are concerned about the performance implications when working with many FlexView images.
You shouldn’t have to call capture twice. My guess is that there is some automatic adjustment of the exposure/gain parameter involved? Can you post the Python code you are using, or at least the relevant parts responsible for capturing?
I am not quite sure if your provided code example is complete, because it does not show that you are initializing the API nor opening any camera. You probably spared that out?
I also assume, that you only have one camera connected to your computer, since you are applying the parameters to the first item of the camera list, but further down you are using a specific serial number in the Capture command. This would be problematic in case you have several cameras connected and the first camera in the list isn’t the one matching the specific serial.
Could you record a log file for us for further debugging? In order to do so, you can insert the following code snippets after initializing the API to open a TCP port and after all commands are done.
api.initialize()
api.open_tcp_port(port_number=25000)
input("Press Enter to continue after logging has been started ...")
# Your code ...
# Compute the point map from the disparity map
point_map = NxLibCommand(CMD_COMPUTE_POINT_MAP)
point_map.execute()
input("Press Enter to continue after logging has been stopped ...")
After the port has been opened, the script waits for an input. While it is waiting, you can start recording a log as described in our guide here. In short: Open NxTreeEdit, select the instance with port “25000” and in the upcoming NxTreeEdit window open the debug tab, select level “Trace” and hit “Start”. Now the log is recording and you can provide an input to the waiting Python script. After your commands are run, the script waits again and you can hit “Stop” in NxTreeEdit. The log file has now been written to the given folder.
You can post the log file here If it does not contain any sensitive data, otherwise you can send me as a personal message.