Delphi Tips Trick

For Newbie

Iklan Responsive Atas

Responsive Ads Here

Saturday, 24 September 2011

Motion Detection with Delphi through Video Grabber (Share Ware Version)

Motion Detection with Delphi through Video Grabber (Share Ware Version)
Motion detection is application that is used as observer system or protection system in a certain room, for example coffer room of a organization, such as bank, in a certain time this room has to be empty without anyone inside, as protection application can be developed using sms delivery facility to those that is related when detected a movement. This application can also be developed by automatic facility video recorder if detecting a movement in video preview that is capture in camera as protection input system.

The following is the steps in making Motion detection application with Delphi through Video grabber
Insert the component on the table bellow to the design form :

No Component Name Properties Value
1 Label1 Caption Start Preview
2 Button1 Caption Start Motion Detection
3 Button2 Caption Start Preview
4 Combobox1 Text -
5 Memo1 Text -
6 Memo1 Text -
7 Shape1 Brush-Color clBlack
8 Videograbber1 - -

Arrange the component like the picture bellow:

Then type this following source code

Component Event Source Code
1 Form1 OnCreate VideoGrabber1.
Display_AutoSize := false;   
// the control will not resize automatically
AutoRefreshPreview := true;
// the preview will restart automatically when changing device properties
(e.g. video size, analog video standard, etc...)
2 Button1 OnClick   videograbber1.
memo1.Text := VideoGrabber1.
3 Button2 OnClick videograbber1.StartPreview;
4 Videograbber1 OnMotionDetected   var MaxMotionXLocation,
MaxMotionYLocation: LongInt;
MotionDetector_CompareRed ;
if VideoGrabber1.
MotionDetector_GetCellLocation (MaxMotionCellX, MaxMotionCellY,
MaxMotionYLocation) then
begin   memo2.Text := VideoGrabber1.
5 Videograbber1 OnNot
Shape1.Brush.Color := clBlack;
Memo2.Text := VideoGrabber1.

This is the picture of Motion Detection with Delphi through Video Grabber (Share Ware Version) application:

Start previewing the camera

Motion detection  Delphi 1

Motion detection  Delphi 2

The video grabber component that is used in this application is shareware version so that it could not work properly (maximal), in limited random time, application will stopped working, besides that application will appear overlay text nagscreen the address of the website is

I hope this article can give benefit to the visitors, readers, developer and me. Thanks for visiting and availability for sharing this article by pressing 
Share this on Facebook
or just press like button under this posting