PDA

View Full Version : LiveCapturePause problem



Freddy
October 20, 2006, 11:37:43
Hello,

I was using LivePause to save memory space when capturing images, but the problem was that i couldn't see live image anymore.

Therefore, i tried replacing it by LiveCapturePause, but it doesn't seem to be working correctly.
When i capture and set LiveCapturePause to true, i can still see video image coming from the camera, but when i finish the capture and want to view the captured AVI file i'm having a problem. During the time that i have been pausing the capture, i have a flickering image of the same duration. I don't have, as i did with LivePause, obtain a unique sequence of cutted video images.
What i'm saying is that i want to have one single AVI file with images from sequences captured during Pause set to false. It did work with LivePause, but is not working with LiveCapturePause.

What can i do to solve the problem?

Thank you in advance for your help

Freddy

Sascha Schmidt
October 24, 2006, 14:30:59
Hello,

I feel sorry, because I can't reproduce your problem.
Please look at the "Capturing an AVI File" Sample.
Also, this Sample uses 'LiveCapturePause' to pause capturing, but it works fine.

The Sample is documented on:
http://www.imagingcontrol.com/ic/docs/html/dotnet/CaptureAVI.htm

Best regards
Sascha

odissey1
November 7, 2006, 16:18:13
Hi Freedy,

Please find below a Delphi example which should work OK. It captures images on timer event by manipulating LiveCapturePause property.

Regards,
odissey1

procedure TForm1.FormCreate(Sender: TObject);
begin
ICImagingControl1.DoubleBuffered:=True;
ICImagingControl1.LiveDisplay := False;
ICImagingControl1.LiveCaptureLastImage := False;
ICImagingControl1.LiveCaptureContinuous := True;
ICImagingControl1.DeviceFrameFilters.Clear;//remove all filters if any
end;


procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
StopImaging;
end;


procedure TForm1.StartImaging;
var FInfo: IFrameFilterInfo;
begin
counter:=0;

ICImagingControl1.LiveDisplayDefault := True;//must put else Err division by zero
ICImagingControl1.LiveDisplayDefault := False;

ICImagingControl1.LiveCapturePause:=True; //stop acquiring images (if any)

ICImagingControl1.LiveStart; //takes ~100ms


Timer1.Enabled:=True;
starttime:=GetTickCount;
end;

procedure TForm1.StopImaging;
begin
Timer1.Enabled:=False;

if ICImagingControl1.DeviceValid then begin //normal stop
ICImagingControl1.LiveCapturePause:=True; //stop acquiring images
ICImagingControl1.LiveStop;
end;

end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
ICImagingControl1.LiveCapturePause:=False; //start acquiring images
end;


procedure TForm1.ICImagingControl1ImageAvailable(ASender: TObject; BufferIndex: Integer);
var CurrentBuffer: ImageBuffer;
begin
ICImagingControl1.LiveCapturePause:=True; //stop acquiring images (until next timer event)

CurrentBuffer := ICImagingControl1.ImageBuffers[BufferIndex];
ICImagingControl1.DisplayImageBuffer(CurrentBuffer );

FName:=Format( 'Img%5.5d.jpg', [counter]);
CurrentBuffer.SaveAsJpeg(SavePath+'\'+FName, Quality);
end;


procedure TForm1.TBXItemStartClick(Sender: TObject);
begin
StartImaging;//button Start clicked
end;

procedure TForm1.TBXItemStopClick(Sender: TObject);
begin
StopImaging;//button Stop clicked
end;