PDA

View Full Version : the timeout passed to snapImages



elia
July 28, 2006, 11:52:35
Hi,
I want capture 100 images (jpeg) to two cam.
It's my vb6 code:
----------
On Error GoTo cmdSaveBitmap_Click For i = 1 To 100

ICImagingControl1.MemorySnapImage
CurrentBuffer = ICImagingControl1.ImageBuffers.CurrentIndex
ICImagingControl1.ImageBuffers.Item(CurrentBuffer) .SaveAsJpeg Percorso & "img_" & Format(i, "000") & "_1.jpg", 55

ICImagingControl2.MemorySnapImage
CurrentBuffer2 = ICImagingControl2.ImageBuffers.CurrentIndex
ICImagingControl2.ImageBuffers.Item(CurrentBuffer2 ).SaveAsJpeg Percorso & "img_" & Format(i, "000") & "index_buffer" & CurrentBuffer & "_2.jpg", 55

Next
Exit Sub

cmdSaveBitmap_Click:
If Err <> cdlCancel Then
MsgBox Err.Description
End If

----------
but sometime get the error msg:
"the timeout passed to snapImages(...) did elapse before all immage culd be snaped" !!
Why?

can u help me
thanks

Johannes Vogel
July 28, 2006, 17:03:07
Hello,
a few questions:
1) Which cameras are you using?
2) At which frame rate are the cameras operated?
3) Are the cameras operated in trigger mode?

elia
July 31, 2006, 09:32:55
1) Which cameras are you using? - the cameras are: DFK 31BF03;
2) At which frame rate are the cameras operated?the frame rate is 30 frame/sec;
3) Are the cameras operated in trigger mode? No

Thanks

Johannes Vogel
July 31, 2006, 15:56:08
The timeout may occur because you are constantly starting and quitting the image stream. If you used 2 FireWire busses, you could have video streams running from 2 devices at the time and access a buffer in a defined time interval for writing it to a JPEG file.

If you need to have both cameras connected to the same bus, you should try again to do a "snapimage" for the same camera if the error occurs.

elia
August 4, 2006, 09:20:34
Hi,
I want capture 100 images (jpeg) to 3 cameras (DFK 31BF03).
Every camera is connected to a single FireWire bus and the frame rate selected is 30 frame/sec (no trigger mode).
For complite the acquisition the time is 25 sec.
It's possible reduce this time?
It's my vb6 code:
----------
On Error GoTo cmdSaveBitmap_Click
For i = 1 To 100

ICImagingControl1.MemorySnapImage
CurrentBuffer = ICImagingControl1.ImageBuffers.CurrentIndex
ICImagingControl1.ImageBuffers.Item(CurrentBuffer) .SaveAsJpeg Percorso & "img_" & Format(i, "000") & "_1.jpg", 55

ICImagingControl2.MemorySnapImage
CurrentBuffer2 = ICImagingControl2.ImageBuffers.CurrentIndex
ICImagingControl2.ImageBuffers.Item(CurrentBuffer2 ).SaveAsJpeg Percorso & "img_" & Format(i, "000") & "_2.jpg", 55

ICImagingControl3.MemorySnapImage
CurrentBuffer3 = ICImagingControl2.ImageBuffers.CurrentIndex
ICImagingControl3.ImageBuffers.Item(CurrentBuffer3 ).SaveAsJpeg Percorso & "img_" & Format(i, "000") & "_3.jpg", 55

Next
Exit Sub

cmdSaveBitmap_Click:
If Err <> cdlCancel Then

End If
----------------
thanks

Johannes Vogel
August 4, 2006, 09:54:05
Hi,
You should reduce the frame rate to 15 fps. At the beginning of your program, disable the live display of IC, disale continous copying to the ring buffer and start the image stream. Do this for all 3 IC objects:

ICImagingControl1.ShowDeviceSettingsDialog
ICImagingControl1.LiveDisplay = False
ICImagingControl1.LiveCaptureContinuous = False
ICImagingControl1.LiveStart

The rest of your code may stay the same. This should speed up the program siginificantly. This is because the video streams are not initialized and destroyed for every grab operation.