i make things!!

« Washing-up detector notes and code BBC Click on worldservices »

The Great OpenCV Washing-up Detector

2012
14
January

 

Our hackspace sometimes has a problem with people leaving things in the sink for washing and then getting distracted on uber-awesome project. Obviously being a technical place a technical solution to (a social) problem was needed.

Cue the Great OpenCV Washing-Up Detector!

 

I've been mucking about with shape recognition in OpenCV for a while and recently managed to get the HoughCircles feature to work with the Python bindings. The HoughCircles function takes a binary (black and white) image and attempts to find circular shapes in it. Well, what shape are most things that are left in the sink? Yup, circular.

I'd managed to repurpose an opencv testing script to look for circular shapes in an image and look for a plug-hole positioned and sized circles to exclude, anything left over is a plate, cup or bowl. This increments a counter and at preset levels will trigger an annoyance to get people to clean up.

So the software worked well enough with testing images, time to mount this permanently and get some real data going. First step was to mount the camera above the sink

This gives us a nice view of the sink. Good! Theres already "training data" in it

Next step was to mount the beaglebone on something so that it doesnt short out on the Altoids tin. Some junk perspex and M3 bolts saw to that

LOL I LIKEZ CASE MODDINGS, I HAZ DREMEL

Mark and I pulled some more network cable over the ceiling so I can monitor software remotely

This is what the camera sees, its taking a snapshot and feeding it into OpenCV. Its then Canny thresholded and blurred before being run through the circle detector. Notice here its missed the glass, it doesnt show up on the edge detection images.

Theres a little bit of faffing to set some parameters for the edge detection but given that there is only artificial lighting around it they shouldnt need adjusting. I have added a feature to shut the alarms up when the lights are off though, thats just averaging the brightness levels from an HSV copy of the image though.

So what alarms are installed? Well I started by triggering the Hackspace traffic lights (formerly the IRC Rage-meter).

and here we go, after 5 minutes of their being crap in the sink the green light comes on, prompting loads of "wtf is that?" messages which are followed up by one of us saying "go do the f**king washing up"

I've also added a mode where it shouts on our IRC channel, next I'll be adding some air horns or something to really wake people up!

 

I'll post the code if enough people are interested.


to The Great OpenCV Washing-up Detector

Feed for this Entry

  • [...] Nothing stinks up the house like a sink full of dirty dish. Well, a full trash can will do it to a greater extent, but that’s a project for another day. In what must be an overreaction to a perpetually full sink of dishes at his London Hackerspace, [Tom] built a web-connected dirty dish detector. [...]
  • [...] Nothing stinks up the house like a sink full of dirty dish. Well, a full trash can will do it to a greater extent, but that’s a project for another day. In what must be an overreaction to a perpetually full sink of dishes at his London Hackerspace, [Tom] built a web-connected dirty dish detector. [...]
  • [...] Nothing stinks up the house like a sink full of dirty dish. Well, a full trash can will do it to a greater extent, but that’s a project for another day. In what must be an overreaction to a perpetually full sink of dishes at his London Hackerspace, [Tom] built a web-connected dirty dish detector. [...]
  • [...] Nothing stinks up the house like a sink full of dirty dish. Well, a full trash can will do it to a greater extent, but that’s a project for another day. In what must be an overreaction to a perpetually full sink of dishes at his London Hackerspace, [Tom] built a web-connected dirty dish detector. [...]
  • [...] pile up quickly, I’m sure. Not one to let things get out of hand, London Hackspace member Tom created a solution to combat the problem. True to hackerspace form, he combined different open source technologies to alert the members in [...]
  • [...] to pile up quickly, I’m sure. Not one to let things get out of hand, London Hackspace member Tom created a solution to combat the problem. True to hackerspace form, he combined different open source technologies to alert the members in [...]
  • [...] to pile up quickly, I’m sure. Not one to let things get out of hand, London Hackspace member Tom created a solution to combat the problem. True to hackerspace form, he combined different open source technologies to alert the members in [...]
  • [...] to pile up quickly, I’m sure. Not one to let things get out of hand, London Hackspace member Tom created a solution to combat the problem. True to hackerspace form, he combined different open source technologies to alert the members in [...]
  • [...] pile up quickly, I’m sure. Not one to let things get out of hand, London Hackspace member Tom created a solution to combat the problem. True to hackerspace form, he combined different open source technologies to alert the members in [...]
  • [...] [?ród?o] [...]
  • [...] IMakeThin.gs » Blog Archive » The Great OpenCV Washing-up Detector Our hackspace sometimes has a problem with people leaving things in the sink for washing and then getting distracted on uber-awesome project. Obviously being a technical place a technical solution to … [...]

19 Comments

  • hahaha this is awsum MAKE MORE THINGZ

    #80 | Comment by on Jan 15, 2012 02:28am
  • Yup, definitely interested in code. We have a similar problem here at work and this would be a great way to get the lazy wasters to wash up their own stuff!

    Have played with OpenCV in terms of facial recognition, and found it to be very powerful, if only a little confusing in places.

    #82 | Comment by on Jan 16, 2012 09:08am
  • I would love to see the code!

    #83 | Comment by on Jan 16, 2012 10:48am
  • Now that you have some experience with OpenCV, you could have it recognize and say rude things to persistent offenders. I saw a couple of people talking smack about 'what a waste' of time and tech this is. The spam filters would eliminate what I really want to say to them, so I'll leave it alone and just tell you I think it is a marvelous project. Please do post code. Especially anything you had to do to get the webcam to work- this is the sort of problem that ends up choking a lot of projects, and whatever you found would be appreciated by the hardcore hackers out here.

    #84 | Comment by on Jan 16, 2012 11:07am
  • super work dude.... interested in seeing the code.....

    #87 | Comment by on Jan 16, 2012 12:12pm
  • GIMME DAT CODE

    #88 | Comment by on Jan 16, 2012 01:51pm
  • I see that you've found a cool application for the traffic signal : ).

    Every time a dremel disc shatters to pieces while cutting, I pray it doesn't hit anything fragile, like an LCD screen.

    #89 | Comment by on Jan 16, 2012 02:41pm
  • I would like to see the code it can be a fun trick at my home :), i also worked with openCv before but i would like to see how its implemented, especially the irc, traffic lights...

    cool idea

    #91 | Comment by on Jan 17, 2012 01:32am
  • or my eyes.....

    #92 | Comment by on Jan 17, 2012 04:10am
  • well one if my other CV projects I'm playing with is facial recognition, it might be interesting to mash the two projects together and start identifying offenders :)

    I'll document the Beaglebone image build as well, having seen how bad some of the documentation is it can only be a good thing!

    #93 | Comment by on Jan 17, 2012 04:12am
  • I'll post the code for the CV stuff later when I get home from work (or more likely: to the hackspace tonight!).

    The traffic lights are a couple of solid-state relays connected to an arduino that we use for an LED board, I've taken a couple of pins from it to drive the lights. The arduino listens for text strings from our server and if it sees something like "$light0" it sets the lights based on the number (from 0-3, 0 being off and 3 being Red).
    That arduino is hooked into our server which has a daemon running on it to take text from a TCPIP port and send it to the arduino, all my code does is just forward a "$light0" to the server based on how many times its detected things in the sink in the last 5 minutes :)

    We have a similar daemon running for forwarding text from our server to IRC, its a similar setup to the traffic lights. Basically I have a python class called "Annoyances" which has 3 different annoyance levels and one to turn everything off. In this case the methods do the IRC/traffic light things but it'd be trivial to drive a servo and set off an air horn instead.

    At some point I'm hooking it up to our GladOS themed door-entry system so GladOS herself can start yelling at people to wash up!

    #94 | Comment by on Jan 17, 2012 04:17am
  • code is up! Its on my github account and linked to in the next post :)

    #95 | Comment by on Jan 20, 2012 03:43am
  • Awesome work!

    #102 | Comment by on Jan 22, 2012 06:17pm
  • This is fantastic. I need this. XDDDD

    #104 | Comment by on Jan 28, 2012 09:24am
  • Nice work! Would love to see the code, somewhat interested in a build like this myself. :)

    #105 | Comment by on Jan 28, 2012 10:30am
  • different type website ...nice work..

    #107 | Comment by on Jan 28, 2012 12:35pm
  • Great project! I am just starting out using the beagle bone. I'd love to see a tutorial on how you got the web cam and openCV installed on beagle bone. Also, what distribution are you running on your bone?

    #108 | Comment by on Feb 2, 2012 12:01pm
  • I'm running Debian at the moment, the Angstrom image that came with the bone refused to work with the ps3 camera. I gave up with it for a while as I've been banned from the forum twice (without even posting anything!) and couldnt get any help with it. I've tried to build about 3 different images for it but none worked!!

    The debian netinstall image works a treat though, even opencv/ps3 camera worked straight off!

    #109 | Comment by on Feb 2, 2012 02:17pm
  • This is a ridiculously good build. Loving it :) Do you have a mail address I can catch you on? I have a few questiona.

    Thanks

    Ryan

    #111 | Comment by on Feb 9, 2012 09:39am

About You

Email address is not published

Add to the Discussion

Subscribe to Feed

Navigation

Asides