PDA

View Full Version : Occasional "misaligned" frame when calling MemorySnapImage after LivePause=false



AndrewCentice
May 14, 2008, 21:03:01
Environment:
* Imaging Source Camera DBx 21AF04
* Imaging Control 3.0.6

I am using IC Imaging Control .NET in an application. I have some code that looks like this:

private void buttonSnap_Click(object sender, System.EventArgs e)
{
try
{
SetLighting();

if (checkLivePause.Checked)
{
icImagingControl1.LivePause = false;
}

icImagingControl1.MemorySnapImage();
TIS.Imaging.ImageBuffer ib = icImagingControl1.ImageActiveBuffer;

pictureboxSnapped.Image = ib.Bitmap;
}
finally
{
if (checkLivePause.Checked)
{
icImagingControl1.LivePause = true;
}
}
}

My questions:

[1] Occasionally, when I unpause immediately before doing a MemorySnapImage(), I see a "misaligned" or "overlapped" frame, where the first 30 lines or so of the image appear to be from one frame, and the remaining lines appear to be from a subsequent frame. Is this to be expected? how can I avoid this?

[2] The only reason I'm pausing until immediately before my MemorySnapImage() call is because my code sets lighting, and then wants to grab an image based off that lighting. I have found that if I am "live" prior to setting lighting, the image I get back from MemorySnapImage() has an exposure that was apparently started before my lighting was set. I have set sleeps in my code, but I am not very comfortable doing this. The lighting should be active by the time I return from 'SetLighting()', but I'm finding sleeps of 60+ms may be necessary to get an image with an exposure that was not started before the lighting got set.

Is there a better way for me to guarantee that the exposure for the image I get back from MemorySnapImage() started after a specific point in time?

---

I'm an image acquisition/processing newbie, so your patience is appreciated :)

Thanks,
Andrew Brown

Stefan Geissler
May 15, 2008, 09:50:00
Andrew


[1] Occasionally, when I unpause immediately before doing a MemorySnapImage(), I see a "misaligned" or "overlapped" frame, where the first 30 lines or so of the image appear to be from one frame, and the remaining lines appear to be from a subsequent frame. Is this to be expected? how can I avoid this?

This is not to be expected, but can be avoided by calling MemorySnapImage() twice.


[2] The only reason I'm pausing until immediately before my MemorySnapImage() call is because my code sets lighting, and then wants to grab an image based off that lighting. I have found that if I am "live" prior to setting lighting, the image I get back from MemorySnapImage() has an exposure that was apparently started before my lighting was set. I have set sleeps in my code, but I am not very comfortable doing this. The lighting should be active by the time I return from 'SetLighting()', but I'm finding sleeps of 60+ms may be necessary to get an image with an exposure that was not started before the lighting got set.

Is there a better way for me to guarantee that the exposure for the image I get back from MemorySnapImage() started after a specific point in time?

Not with the AF camera, because it has no trigger. But I guess calling calling MemorySnapImage() twice can avoid this problem too.