From owner-freebsd-multimedia Sun Dec 9 2: 2: 7 2001 Delivered-To: freebsd-multimedia@freebsd.org Received: from freebsd.dk (fw-rl0.freebsd.dk [212.242.86.114]) by hub.freebsd.org (Postfix) with ESMTP id 1C8D537B419 for ; Sun, 9 Dec 2001 02:02:03 -0800 (PST) Received: (from sos@localhost) by freebsd.dk (8.11.6/8.11.6) id fB9A1wF25036; Sun, 9 Dec 2001 11:01:58 +0100 (CET) (envelope-from sos) From: Søren Schmidt Message-Id: <200112091001.fB9A1wF25036@freebsd.dk> Subject: Re: Motion detection software? In-Reply-To: To: Danny Dulai Date: Sun, 9 Dec 2001 11:01:57 +0100 (CET) Cc: multimedia@FreeBSD.ORG Reply-To: sos@freebsd.dk X-Mailer: ELM [version 2.4ME+ PL94b (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=ISO-8859-1 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 It seems Danny Dulai wrote: > >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=0; i > sum += 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. Sure, but it all consumes CPU, the simple solution I depicted above runs on old 486/33 machines with B/W parallel quickcams and has CPU to spare for other things as well. -Søren To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message