Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Militarizing your backyard with Python, Arduino, and computer vision. (pyvideo.org)
355 points by kscottz on March 15, 2012 | hide | past | favorite | 72 comments


As the person who wrote the OpenCV Python bindings, this makes me inordinately happy.


Hey, thank you for that code! Your OpenCV bindings made more than one appearance at PyCon this year. I used it in my "Angry Birds playing robot". Thank you, thank you, thank you! http://pyvideo.org/video/683/building-a-robot-that-can-play-...


I don't say this enough to people like you, so THANK YOU SO MUCH!


As a person who used those bindings in a couple of projects (this includes tutoring the computer vision course at uni) I will use this opportunity to say thanks.


I imagine the team behind Kinect feels the same way when lightsaber-anything gets made.


Awesome, I have been using the your work a lot recently. I do have one question though, is SIFT available in the python bindings? I have not been able to find it.

Thanks for contributing your time, it has made my life much easier.


For SIFT computation, I recommend VLFeat[1], which there are some python bindings for[2] (although I haven't tried them myself).

[1] http://www.vlfeat.org/

[2] http://www.janeriksolem.net/2011/06/another-python-interface...


Jan Erik is an outstanding guy. He has helped me through a couple of rough spots. The OpenCV python bindings for SIFT don't seem to work (or exist). The ones for ORB work really well. Here is an example: https://github.com/ingenuitas/SimpleCV/blob/master/SimpleCV/...


A colleague of mine is developping a Cython (and OpenMP) based sift wrapper. It's available here: https://github.com/kif/imageAlignment

It's already used for alignment of X-ray images.


Thanks! You definitely made things much easier for me. I had also played around doing some raw ctypes work with OpenCV and now greatly appreciate your efforts.


I think a fair number of homeowners would be willing to pay a lot of money for a version of this system they didn't have to program themselves. And had more firepower, of course.


I think a fair number of nation-states would be willing to pay a lot of money for a version of this system they didn't have to program themselves. And had more firepower, of course.


A low number of false positives with a water pistol is an impressive engineering feat. A low number of false positives with an actual gun is a disaster. The technology is still a long way off.


Accurate sensing, the ability to accurately distinguish between combatants[1] and non-combatants, seems to be an almost impossible task. While there are robots in active service today they all have a human involved somewhere, especially if there's lethal force going to be used.

It's pretty scary to think that humans could be removed from that loop. I can't work out why I'm happy to see totally autonomous cars but I'm wary about autonomous weapons.

(http://rusi.org/downloads/assets/23sharkey.pdf)

(http://andrewgibsondefence.wordpress.com/2010/10/17/should-k...)

[1] And even if you can identify an enemy combatant you've got to then distinguish active combatants from those who have surrendered or are injured or are mentally ill.


It's not a problem for counter-sniping and no man's land.


No man's land control and anti-air defense is exactly what I saw such solutions marketed for, when browsing through drone tech last year.


I disagree. Accidentally shooting a couple of kids or pregnant women every few weeks can easily make you lose a war on the political front.


In a few priviledged parts of the world.


I think a number of terrorists are going to be willing to figure out how to hook such a system up to a gun on a $300 RC quadrocopter. I hope it's a small number. It's going to be interesting.


Are you serious? Do you honestly think a $300 RC quadrocopter can handle the kick of a gun?


Does it need to be able to fire more than once?


A properly designed muzzle brake will reduce the kick by 50%, potentially making the recoil small enough that your quadcopter could handle it.

http://en.wikipedia.org/wiki/Muzzle_brake


There are a number of very low-recoil guns in existence. There was even a video a few years back of a group of friends who mounted a paintball gun to a quadrocopter. So yes.


Having fired real guns and paintball guns, I can tell can you this proves absolutely nothing.


heh that's actually an interesting problem, it would depend on how many times the gun needs to fire, also how stable can the copter be as it fires? if it only needs to get one shot off then you're good(but then it'd be more practical to load the thing with explosives, ugh that idea gives me nightmares) maybe some sort of dual gyroscopic stabilizer like a camera coupled with opposing barrels as some one mentioned, but using blanks instead of live ammo?


How about some real world experiments: http://www.youtube.com/watch?v=59ttSwYNspw Disclaimer: I have nothing to do with this. Just found it one night strolling around on YouTube..


opposing barrels fired simultaneously might work, though it would be a bit wasteful.


This is a well understood problem: http://en.wikipedia.org/wiki/Recoilless_rifle


I don't think so... Where is all your extra energy going?


In roughly equal and opposite directions. You'd just need something between the two weapons to withstand the compressive force.


"In roughly equal and opposite directions" sounds like you think energy cancels other energy like opposing forces do. The energy needs to go somewhere; it can't bump into MORE energy and disappear. What would this "something" that absorbs all of it be?


I'll bet it can handle a 22 short.


A terrorist with a bomb is a threat. Terrorists with rickety flying .22s... That would just be fun to watch!


Stampedes due to a gun being fired in the middle of a crowd are not fun to watch. Terrorists aren't out to do such things though; surprisingly, they have other goals than causing random terror. Psychopaths on the other hand...


Exactly. Terrorists trying to fight a war with flying .22s would be pathetic. They would never get even 1 shot in before the thing is taken down. I think a few people downvoting me and/or posting about the threat these things might cause don't really understand the state of this technology and/or basic physics.

We weren't talking about psychopaths. Everything is a threat in the hands of a psychopath. Give a psychopath a spoon and I'd still be worried.


The definition of terrorist seems to have shifted. It used to refer to someone intent on fomenting terror in a population, but you seem to be using it to talk about soldiers in a combat situation.


You answer your own question with "It used to refer to...". But even so, I still don't think a flying .22 will cause "terror". Planes crashing into buildings in big cities and killing 3000 people causes "terror".


I actually believe there is a growing market for something like low frills drones. Somewhat a T34/Kalashnikov of all drones, that is short ranged, maybe with FPV, something that anyone, who can use who is able to understand a joystick and three buttons is able to command. There should be a decent market for this stuff with all kinds of crazy 3rd world militias thinking they need to drone-up, plus these things should be relatively easy to export.


Guns have recoil. Grenades don't.

Also the targeting issues are vastly simplified and they're very effective in swarms.



I'm not sure. I've thought about building this kind of system from time to time, but I've never gotten around to it. I'd pay up to $75 for a simple version that keeps pigeons from my balcony. Nothing fancy required: it could fire at anything that moved. I would switch if off if I wanted to use the balcony myself. I wonder whether $75 would be enough to make this a viable product.


I think you're on the right track here. This is bringing a laser pistol to a gun fight. You can keep a lot of pests away with a plastic owl attached to your roof acting as a scarecrow or with always on "dumb" ultrasonic devices. Both much cheaper and with far less moving parts.


A real python would probably take care of the squirrels even better.


I'm impressed that he can get low false positives with such simple methods. That's great to know.

If he tried using line detection, vectorize it, then train the algorithm with the tagged shapes of squirrels. Would that be too slow to do in real time? Or could it work to reduce false positives?


Adding complementary features such as edges (I'm guessing this is what you mean by lines) tends to improve the accuracy. It would also be possible to do this in real time.

I don't have time to watch the full video so I don't know what features he is currently using, but in object detection nowadays most people are using some variant of the SIFT descriptor. These are built not upon edges but on the image gradient per-pixel. The current 'hot' feature in terms of frequency of use is probably Histograms of Oriented Gradients (HOG) which do exactly what they say on the tin: Take a region of the image and count how many times a particular gradient direction occurs and the total magnitudes. Slightly more difficult to run in real-time but libraries exist.


I didn't show the false positive video. :P There were some additional features thrown in, but for presentational simplicity I went with some strong, easy ones to explain. I think one thing helped keep FPs low was some frame-based signal thresholding. So, I required a significant squirrel signal (over multiple frames) before it went hot. That prevented any small FP blip to trigger the gun.


I attended the talk. It was pretty cool, especially the OpenCV part. Frankly I think he needs to upgrade the armaments. Hook that bad boy up to the hose with a nozzle.

Frankly, if you wanted to, you could hook such a system up to an automated sprinkler control system and just turn on the water for whatever area the squirrels happen to be in at the moment. It would only have to be on for a few moments. Soon they'd think your yard is some sort of special hell, where water follows them wherever they go.


I was there too :) It was such a fun talk, especially the part where in the end of the demo video, the squirrel stopped caring about the water cannon anymore, and decided to steal food while getting sprayed on. I wonder if there is a better way to deter them instead of bigger water cannons?


Well the arms race can begin... more potent water pistol. Then nerf dart gun... then golf balls gun... then gotcha gun... (at this point gets dangerous)


You'd have to keep the sprinkler system constantly pressurized, though. I've never seen one that can do that - they all take x seconds to really get going.


Reminded me a bit of this old project from someone trying to stop non-cats or their cat carrying a dead animal from entering a cat door:

http://www.quantumpicture.com/Flo_Control/Flo_Control_1/flo_...


One of the spectators in that video talks about http://info.ee.surrey.ac.uk/Personal/Z.Kalal/tld.html which was discussed on HN before and a nice demo of what computer vision can do...


Awesome talk, but I can't resist: Leave it to a software engineer to find a $250 solution to a $10 problem :) (http://www.wbcboulder.com/pole_mounted_baffles_sub.html)


I can tell you right now that those don't work at all. We've got a few on our feeders with NOTHING else around them and the squirrels still get on them. They only work if you have a single feeder/pole within about 10 feet of each other. Those little fsckers pull some ninja-esque moves jumping from metal pole to metal pole to get around them. It's entertaining to watch but it can get expensive since when they get up there they eat their fill which can sometimes be 1/6th to 1/5th of the feeder at a time.


they eat their fill

That's when you apply the $5 solution: a slingshot.


Well sure, but its not really about that, its about the process, figuring out how to do this stuff and then doing it is extremely enjoyable and really cool, as is doing a talk for others who think the same thing.


Innovation in technology comes from using technology in ways it wasn't intended, not necessarily what is the most efficient.


He has trees from which the squirrels can leap to the feeder


What about airsoft? You could mount a cheap, automatic, battery-powered unit and seriously sting those squirrels! I thought of using a similar system to protect the chickens I've got from the feral/neighborhood cats (I do have a fence... but that doesn't feel "complete").


We have chickens too, around 25 free range + a pony + a few ducks, and had issues with dogs and wild coyotes. I think harming the animal is a bit inhumane but I totally understand where you are coming from. Remember you are a guest in their space.

Here are some suggestions that have worked for our farm:

1. Pee around the coop. Enough said.

2. Get a puppy and train him. We have an aussie that does a great job, but there are other breeds that make even better farm dogs.

3. Train the chickens to go back into the barn when the sun goes down. This isn't very hard and most of the time they will do it themselves.

4. Motion sensor and/or electric fence on a timer.

5. Be aware; this is by far the hardest thing.

Our first year we lost 10 chickens. If that's not motivation enough to do something, I don't know what is but I would never hurt another animal for doing what they do naturally.


Our chickens aren't exactly free-range, but they have a large fenced-in area. The fence is electric, and the chickens do go in at night. But when a cat walks by and scares them, they have a tendency to get outside the fence and not know how. And outside the fence... some of the cats would be interested in getting them. And since a big siamese-like cat comes around that will hunt ground hogs, a chicken isn't such an intimidating target.

While I understand that cats are born predators, I can't afford to lose chickens. I wouldn't kill them because they do keep pests down and may belong to someone, but I do want to scare them away from the coop.


Oh yeah, I understand that. We all face different challenges when raising animals. I was just spitballing at 'cha.


I thought about going that direction, but was concerned the birds might eat the pellets.


Yeah, my sister pointed that out to me. It's a fairly serious concern. (Coincidentally, that's probably where the term "bird brained" came from...)


15:50 for the cannon in action.


Relevant XKCD: http://xkcd.com/382/


I wonder if something like the Blender Defender (http://www.plasma2002.com/blenderdefender) would be more effective than the water. A strobe light and/or a rattle to frighten it off. Ultrasonic would be good as well if there was decent evidence it worked.


Seems like you'd be better off cutting off the approaches to the feeder. But the project is super cool. For more power, I'd use a power washer. :)


Squirrels are notoriously ingenious at raiding feeders. They are really good at defeating feeders that are specifically designed to be "anti-squirrel" too.


My bro has a problem with a mole digging all the backyard, any idea for that problem? maybe a flying drone that drops bombs on its head ? :)


The presenter's personal site: http://kurtgrandis.com/blog/


neat and awesome talk




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: