Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Motion detection in a video feed

Author
Message
NST
AGK Bronze Backer
15
Years of Service
User Offline
Joined: 21st Jun 2009
Location: UK
Posted: 3rd Jun 2010 09:59
Is it possible in DBPro? Is there a library? Trying to detect the existance of a vehicle in a CCTV camera feed.

Any ideas?

Many thanks
nitrohaze
21
Years of Service
User Offline
Joined: 21st Apr 2003
Location:
Posted: 3rd Jun 2010 15:51
Hi NST

Have you managed to get to the point where you can acquire an image?

I did something very similar a few years ago using a third party piece of software which generated a jpg every 30 seconds.

I then had a DBPro app that loaded this in and compared to the previous image. I worked out the change as a % and then sent and alert where this was greater than the desired amount.

The main problem I encountered was that most cameras are fairly low quality anyway, so you get a lot of varience (graining) between even "static" images.


Would take a lot of power to be able to detect anything as specific as a car (or any other object).

However, I remember simply googling an app to do this for me in the end.
NST
AGK Bronze Backer
15
Years of Service
User Offline
Joined: 21st Jun 2009
Location: UK
Posted: 3rd Jun 2010 16:01
Hi NH

Thanks for the response.

No, I haven't got anywhere, really. I know how to capture an image (thanks to Daniel F, I believe), but I need to be able to compare it to the previous frame, etc.

The car will be about 50% of the image.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 3rd Jun 2010 17:19
Quote: "The main problem I encountered was that most cameras are fairly low quality anyway, so you get a lot of varience (graining) between even "static" images."


You could probably get around that by grabbing a number of 4x4 sections of the screen as images and then averaging the 16 pixel colours of each section - rather than comparing individual pixel colours.

If the average colour of the before and after sections is different for more than just a couple of sections, then you should be able to say with some degree of confidence that something new has appeared on the screen.

TDK

NST
AGK Bronze Backer
15
Years of Service
User Offline
Joined: 21st Jun 2009
Location: UK
Posted: 3rd Jun 2010 17:43
Thanks for that. Any idea how in DBP?
nitrohaze
21
Years of Service
User Offline
Joined: 21st Apr 2003
Location:
Posted: 3rd Jun 2010 20:04
Theres a couple of routes you could go down depending how accurately (and therefore quickly) you need check each picture.

Check out the Make Memblock From Image command, you could the loop through this and compare 2 images (current, and last image). Work out a % difference and use this as a trigger (although it wouldnt just check cars!)

A simpler method could be to use the Point command and extract the rgb values at key points on the picture.

The best starting place would be to ignore the camera bit for now and do a test using a photo or other image. Make 2 copies of the image and alter one slightly in PAINT so that its a bit different. You could then expriment with the two methods above until you can accurately tell they are different.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 7th Jun 2010 17:29
It's been done in DarkGDK...

http://www.youtube.com/watch?v=caGn6mYddaI

Login to post a reply

Server time is: 2024-11-24 15:25:18
Your offset time is: 2024-11-24 15:25:18