MultiExposureFactor fails to turn off under certain conditions

General Information

  • Product: C57-6-M, C57-8-L
  • Serial Number: 245046, 258860
  • Ensenso SDK Version: 4.2.1821
  • Operating System: Windows 11

Problem / Question

We are having trouble disabling the MultiExposureFactor in a specific sequence.

In our application, we set the capture parameters using the setJson method when connecting to the camera. However, we have noticed that under a certain procedure, the MultiExposureFactor might not be set correctly.

The procedure is as follows:

  1. Enable MultiExposureFactor (set to 2 or higher) in NxView and capture images.
  2. Close NxView.
  3. Start our application and set MultiExposureFactor to off (= 1) via setJson.
  4. Run Capture in our application, then execute SaveFileCamera.
  5. When we inspect the pattern images inside the FileCamera, the pattern brightness alternates between frames. we suspect that the process to disable MultiExposureFactor was not correctly applied.

To reproduce the issue more easily, we have created a small sample program:

{
	std::cout << "Open:" << serial << std::endl;
	NxLibCommand open(cmdOpen);
	open.parameters()[itmCameras] = serial;
	open.execute();

	std::cout << "Set Parameters" << std::endl;
	camera[itmParameters][itmCapture][itmFlexView] = 16;
	camera[itmParameters][itmCapture][itmMultiExposureFactor] = 25;

	std::cout << "Capture" << std::endl;
	NxLibCommand(cmdCapture).execute();
	NxLibCommand(cmdRectifyImages).execute();

	std::cout << "Close:" << serial << std::endl;
	NxLibCommand close(cmdClose);
	close.parameters()[itmCameras] = serial;
	close.execute();
}
{
	std::cout << "Open:" << serial << std::endl;
	NxLibCommand open(cmdOpen);
	open.parameters()[itmCameras] = serial;
	open.execute();

	std::cout << "Set Parameters" << std::endl;
	const std::string jsonParameter = R"({"Parameters": {"Capture": {"FlexView": 8, "MultiExposureFactor": 1}}})";
	camera.setJson(jsonParameter);

	std::cout << "Capture" << std::endl;
	NxLibCommand(cmdCapture).execute();
	NxLibCommand(cmdRectifyImages).execute();

	std::cout << "Save FileCamera" << std::endl;
    // NOTE:
    // FlexView 8 images are saved correctly, but they do not reflect the
    // setting where MultiExposureFactor is turned off (= 1). 
    // The saved images show alternating brightness levels between frames. 
    // Interestingly, setting the value directly via:
    // `camera[itmParameters][itmCapture][itmMultiExposureFactor] = 1;` 
    // works as expected.
	NxLibCommand saveFileCamera(cmdSaveFileCamera);
	saveFileCamera.parameters()[itmCameras] = serial;
	saveFileCamera.parameters()[itmPath] = "filecamera.zip";
	saveFileCamera.parameters()[itmSource] = "Raw";
	saveFileCamera.execute();

	std::cout << "Close:" << serial << std::endl;
	NxLibCommand close(cmdClose);
	close.parameters()[itmCameras] = serial;
	close.execute();
}

We would appreciate it if you could share your opinion or any advice regarding this issue.

Hi @yanofumiya,

thanks to your sample program I was able to quickly reproduce your finding and locate the bug that causes it:

  • When a GigEVision camera is closed, it remembers its current parameters, so MultiExposureFactor remains 25 on the device.
  • When the camera is opened again, our internal value for MultiExposureFactor is set to 1, but it is never set on the camera (this is the bug), which still has it set to 25 from before.
  • When you try to set it to 1 with setJson, we see that this already is the current value and skip setting it on the camera to save on network communication.

I will fix this and flag it so it gets included in case we do another bugfix release.

If this is bug presents an actual problem for you, you can work around it in your application by setting the MultiExposureFactor to something other than 1 in before the setJson to ensure that the correct value will have be set at the end, or by restarting the camera whenever you experimented with the MultiExposureFactor.

Thank you for your report. If there is anything else I can help you with, please let me know.

Regards,
Raphael

Hi @RSC

Thank you for your prompt investigation and for providing such a clear explanation of the bug. I understand why this is happening.

We will implement the workaround of setting the MultiExposureFactor to a value other than 1 before calling setJson to ensure the parameter is correctly applied.

Is this bug specific to MultiExposureFactor, or does it affect other parameters as well?

When I fixed this I did a quick audit of the other parameters and did not find another one that was affected. If you happen to find one, though, please let me know regardless.

This issue will be identified in the changelog as #6306.

1 Like