From owner-freebsd-multimedia Sat Dec 8 13:41: 2 2001 Delivered-To: freebsd-multimedia@freebsd.org Received: from skoda.sockpuppet.org (skoda.sockpuppet.org [192.148.252.55]) by hub.freebsd.org (Postfix) with SMTP id 18B2037B419 for ; Sat, 8 Dec 2001 13:40:59 -0800 (PST) Received: (qmail 5121 invoked by uid 113); 8 Dec 2001 21:38:24 -0000 Date: 8 Dec 2001 21:38:24 -0000 Message-Id: Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Content-Disposition: inline From: danny@ishiboo.com (Danny Dulai) To: multimedia@FreeBSD.ORG Subject: Re: Motion detection software? X-Mailer: Liam [version 0.7] In-Reply-To: <200112080918.fB89INr58887@freebsd.dk> Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On 12/08/01, S=F8ren Schmidt said: >It seems Tim Pozar wrote: >> I am looking for motion detection software. I want to only capture >> video frames that have changes such as someone walking into the >> frame. It would be nice if it talked to the bktr device but if it >> is something I could just pass jpg, pbm, etc. frames to and get a >> result back I would be happy. >>=20 >> Anything out there? > > >Well, I've done several intrusion systems that use very simple >methods to detect motion/changes in pictures, it essentially >just does this: > > for (i=3D0; i sum +=3D square(pic1[i] - pic2[i]); > if (sum > TRIGGER) > return MOTION; > else > return 0; > >The two pictures are raw 320x240 8bit/pixel B/W in this case. >The TRIGGER value can in this case be around 200000, it has to be >low enough to see the changes, and big enough that bitnoise >doesn't trigger it wrongly. Adjusting it is pretty easy, and it >even allows you to not trigger motion on small objects like >brids etc, but do trigger when something bigger happens. You can avoid noise by doing gradient based edge detection first and then subtracting.. that's exactly what I did in my program for video4linux. http://www.ishiboo.com/cvsweb.cgi/mot/mot.c?rev=3D1.4 The trigger in there is only 20 and it works like a charm. --=20 _________________ danny@ishiboo.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message