Project

General

Profile

Acquiring images from MityCam CIS1910 with exposures grater than 1 sec

Added by Anton Bakulev almost 8 years ago

I'm trying to acquire images from MityCam CIS1910 by using clcamiface API or by using MityViewer and I don't see a difference in images with exposures greater than 1 sec while using API and greater than 3 sec while using MityViwer. It seems that maximum exposure is 1 sec while using API and 3 sec while using MityViwer. Could you explain me what I'm doing wrong? Is it possible to acquire images with long exposures from MityCam CIS1910? I'm interested in exposures about 10 sec or even greater .
Could you provide me an example of API command sequences for acquiring images with exposure 10 sec?
My sequence is the following:
CameraHandle = CLOpenENetCamera(strIpAddress, 19200);
if (CameraHandle >= 0) {
int RowStart = 0, ColStart = 0, NRows = 0, NCols = 0;
CLGetCCDArea(CameraHandle, ref RowStart, ref ColStart, ref NRows, ref NCols);
CLCISSetShutterMode(CameraHandle, teCISShutterMode.eeRollingShutter);
CLCISSelectChannel(CameraHandle, teCISChannelConfig.eeCombined);
CLCISClearCalibration(CameraHandle);
CLOverrideImageTimout(CameraHandle, -1);
CLSetExposure(CameraHandle, (long)(10.0 * 1000.0F));
CLClearCCD(CameraHandle, 1, 0);
CLWaitCompletion(CameraHandle, (int)(10.0 * 1000.0F + 10000.0F));
CLReadCCDArea(CameraHandle, buffer, 1, 1);
CLWaitCompletion(CameraHandle, (int)(10.0 * 1000.0F + 10000.0F));
// reads a content fo a buffer and shows an image from it.
}


Replies (10)

RE: Acquiring images from MityCam CIS1910 with exposures grater than 1 sec - Added by Jeffrey Myers almost 8 years ago

When using the clcamiface API or MityViewer, you need to set the frame interval to something greater than the desired exposure time. If the frame interval is shorter than the requested exposure time, the camera will reduce exposure to fit in that frame interval time. The maximum frame interval time for the default clock is ~3.2 seconds.


The CIS1910 with the default clock has a maximum exposure of ~3.2 seconds.

Depending on your camera's firmware version, you can set the clock to 40MHz for longer exposures:

tsCisParamSCLKRate sr;
sr.mnSCLK_MHz = 40;
CLSetParameter(mnCamHandle, CISPARAM_SCLK_RATE, &sr, sizeof(sr)); // Sets the sensor clock speed to 40MHz

With a 40MHz clock, the camera will support up to ~16 seconds of exposure/frame interval.

RE: Acquiring images from MityCam CIS1910 with exposures grater than 1 sec - Added by Anton Bakulev almost 8 years ago

Thank you for an explanation and a part of code.
Could you write also is it possible to change clock speed by MityViewer app?

RE: Acquiring images from MityCam CIS1910 with exposures grater than 1 sec - Added by Anton Bakulev almost 8 years ago

Also could you write a full structure definition tsCisParamSCLKRate ?
I could not find it in https://support.criticallink.com/rm_embedded/mityccd/clcamiface/clcamiface_8h.html documentation.
Or I should search it in some other place?

RE: Acquiring images from MityCam CIS1910 with exposures grater than 1 sec - Added by Jeffrey Myers almost 8 years ago

Anton Bakulev wrote:

Could you write also is it possible to change clock speed by MityViewer app?

Unfortunately, there is currently no GUI interface for changing the clock speed.

Also could you write a full structure definition tsCisParamSCLKRate ?
I could not find it in https://support.criticallink.com/rm_embedded/mityccd/clcamiface/clcamiface_8h.html documentation.
Or I should search it in some other place?

This is a fairly recent addition and it looks like the header hasn't been included in the installer package for MityViewer yet. I've attached it here.

RE: Acquiring images from MityCam CIS1910 with exposures grater than 1 sec - Added by Anton Bakulev almost 8 years ago

I've tried to set clock rate to 40MHz but images acquired after that is zero valued. Did you tried this approach on your site?
Also I've found that defailt clock rate is 283Mhz. Such a value was received after hard reboot of MityCam.
And I see that not all clock rate values can be set. For example, when I've tried to set 50MHz the result of CLGetParameter was 0MHz.
What values of clock rate is valid list?

RE: Acquiring images from MityCam CIS1910 with exposures grater than 1 sec - Added by Jeffrey Myers almost 8 years ago

Anton Bakulev wrote:

I've tried to set clock rate to 40MHz but images acquired after that is zero valued. Did you tried this approach on your site?

The MityViewer uses this approach to adjust the clock when changing between rolling and global shutter (it explicitly sets the clock to 200MHz for rolling shutter and 80MHz for global shutter). What is the serial number camera you are using? What version firmware do you have on the camera? Do you have fully enclosed cameras or just a board stack? Is the sensor a scientific or standard package sensor?

Is this the same camera that was re-flashed several months ago in this post? https://support.criticallink.com/redmine/boards/21/topics/4794

It looks like your firmware is older and needs to be updated: https://support.criticallink.com/redmine/projects/mityvision/wiki/MityCAM-B1910_Firmware

Also I've found that defailt clock rate is 283Mhz. Such a value was received after hard reboot of MityCam.

Depending on the type of camera setup you have (full camera vs. just boards), this may be correct. There is also a known issue regarding the reported clock frequency (see the firmware page above).

The clock is incorrectly reported as 283 in the case of a fully enclosed camera. Fully enclosed cameras are capped at 200MHz while the board set can be clocked up to 283MHz.

And I see that not all clock rate values can be set. For example, when I've tried to set 50MHz the result of CLGetParameter was 0MHz.
What values of clock rate is valid list?

With the latest firmware, the clock can be set arbitrarily and the firmware will round up to the nearest appropriate clock. Assuming you have a fully enclosed camera, here are the valid clocks:
  • 200
  • 108
  • 80
  • 54
  • 40
  • 30

RE: Acquiring images from MityCam CIS1910 with exposures grater than 1 sec - Added by Anton Bakulev almost 8 years ago

Thank you.
Yes, it's fully enclosed camera that was re-flashed several months ago in this post? [[https://support.criticallink.com/redmine/boards/21/topics/4794]]
Ok. I'll update a firmware.

RE: Acquiring images from MityCam CIS1910 with exposures grater than 1 sec - Added by Anton Bakulev almost 8 years ago

Jeffrey,

Thank you for your reply. I've upgraded a firmware successfully. Now it reports the following:

Build Info    jenkins-MityCAM-B1910_Release-41 - 41 40-000065-4-RC4
Camera Part Number    80-000719
Sensor Part Type    CIS1910_GRAYSCALE
Sensor Board Revision    80-000723RC-1
SoC IO Board Revision    80-000623RC-3
IO Board Revision    80-000624RC-2
Serial Number    1
FPGA version    QSYSID/DATE = 0x00010003 / Wed Aug 10 15:10:42 UTC 2016
ARM APP MD5SUM    0aa607a4f67787c58a56a589b964d11b
Linux    Linux mitysom-5csx 3.12.0 #1 SMP Wed Aug 10 11:53:54 EDT 2016 armv7l GNU/Linux

But the camera still reports a 283MHz clock after cold reboot. And returns zero valued images after resetiing clock to 40MHz.
Could you write how I could diagnose and fix the issue?

RE: Acquiring images from MityCam CIS1910 with exposures grater than 1 sec - Added by Anton Bakulev almost 8 years ago

Update. It return non zero images only for exposures bigger than 6 sec.
With exposures in interval 6.01 - 6.1 sec images are partially zero (lower part of image). More exposure - less zero valued part.
The same issue on 80MHz also.

RE: Acquiring images from MityCam CIS1910 with exposures grater than 1 sec - Added by Jeffrey Myers almost 8 years ago

Anton,

The dark calibration would have been cleared when you reflashed the SD card. For best performance, you should set the clock to your desired rate, then run the calibration command with the sensor darkened. The calibration values will persist between reboots (so it only needs to be done once for your chosen clock setting).

You can force the camera to calibrate by calling "CLCISCalibrate()." The light on the back will blink a couple times. When it goes back to solid green (and stays solid green for at least 2 seconds), the calibration is finished.

    (1-10/10)
    Go to top
    Add picture from clipboard (Maximum size: 1 GB)