11

I have a small 12 volt board camera that is placed inside a bee hive. It is lit with infrared LEDs (bees can't see infrared). It sends a simple NTSC signal along a wire to a little TV monitor I have. This allows me to see the inside of the hive, without disturbing the bees.

The queen has a dot on her back such that it is very obvious when she's in the frame.

I would like to have something processing the signal such that it registers when the queen is in the frame. This doesn't have to be a very accurate count. Instead of processing the video, it would be just as fine to take an image every 10 seconds and see if there is a certain amount of brightness (indicating that the queen is in frame).

This is useful since it helps bee keepers know if the queen is alive (if she didn't appear for a number of days it could mean something is wrong).

I would love to hear suggestions for inexpensive ways of processing this video, especially with low power consumption. Raspberry pi? Arduino?

Camera example: here

Sample video (no queen in frame): here

avasal
  • 14,350
  • 4
  • 31
  • 47
Matt H
  • 327
  • 1
  • 4
  • 13
  • 1
    [edit] your question to include a still picture and/or short video fragment with the queen. It would allow to test the code (it could as small as several lines in Python e.g., [How can I improve my paw detection?](http://stackoverflow.com/q/4087919/4279) – jfs Nov 26 '12 at 07:47

2 Answers2

5

First off, great project. I wish I was working on something this fun.

The obvious solution here is OpenCV, which will run on both Raspberry Pi (Linux) and the Android platform but not on an Arduino as far as I know. (Of the two, I'd go with Raspberry Pi to start with, since it will be less particular in how you do the programming.)

As you describe it, you may be able to get away with less robust image processing tools, but these problems are rarely as easy as they seem at first. For example, it seems to me that the brightest spot in the video is (what I guess to be) the illuminating diode reflecting off the glass. But if it's not this it will be something else, so don't start the project with your hands tied behind your back. And if this can't done with OpenCV, it probably can't be done at all.

Raspberry Pi computers are about $50, OpenCV is free, so I doubt you'll get much cheaper than this.

In case you haven't done something like this before, I'd recommend not programming OpenCV directly in C++ for something that's exploratory like this, and not very demanding either. Instead, use, for example, the Python bindings so you can explore the images interactively.

You also asked about Arduino, and I don't think this is such a good choice for this type of project. First, you'd need extra hardware, like a video shield (e.g., http://nootropicdesign.com/ve/), adding to the expense. Second, there aren't good image processing libraries for the Arduino, so you'd be doing everything from scratch. Third, generally speaking, debugging a microcontroller program is more difficult.

tom10
  • 67,082
  • 10
  • 127
  • 137
3

I don't have a good answer about image processing, but I know how to make it much easier. When you mark the queen, throw some retro-reflecting beads on the paint to get a much higher light return.

I think you can simply mix the beads in with your paint -- use 1 part beads to 3 parts paint by volume. That said, I think you'll get better results if you pour beads onto the surface of the wet paint when marking the queen. I'd pour a lot of beads on to ensure some stick (you can do it over a bowl or bag to catch all the extra beads.

I suggest doing some tests before marking the queen -- I've never applied beads before, but I've worked with retroreflective tape and paint, and it will give you a significantly higher light return. How much higher strongly depends (i.e. I don't have a number) but I'm guessing at least 2-5 times more light -- enough that your camera will saturate when it sees the queen with current exposure settings. If you set a trigger on saturation of some threshold number of pixels (making sure few pixels saturate normally) this should give you a very good signal to noise ratio that will vastly simplify image processing.to

[EDIT] I did a little more digging, and there are some important parameters to consider. First, at an index of 1.5 (the beads I'd linked before) the beads won't focus light on the back surface and retro-reflect, they'll just act like lenses. They'll probably sparkle and reflect a bit, but you might be better off just adding glitter to the paint.

You can get VERY highly reflective tape that has the right kind of beads AND has a reflective coating on the back of the beads to reflect vastly more light! You'll have to figure out how to glue a bit of tape to a queen to use it, but it might be the best reflection you can get. http://www.amazon.com/3M-198-Scotch-Reflective-Silver/dp/B00004Z49Q

You can also try the beads I recommended earlier with an index of refraction of 1.5. I'd be sure to test it on paper against glitter to make sure you're not wasting your time. http://www.colesafety.com/Reflective-Powder-Glass-Beads-GSB10Powder.htm

I'm having trouble finding a source for 1lb or less glass beads with 1.9+ refractive index. I'll do more searching and I'll let you know if I find a decent source of small quantities.

Ken M
  • 31
  • 2
  • 1
    Another idea -- if you CAN increase brightness of the queen (best done with the retroreflective tape or fabric, and I've seen some people mark queens by gluing on numbered dots) then you might be able to trigger video capture or image capture with a simple photodetector. Test the response of an IR-filtered photodiode under normal conditions, then see what increase you get with the queen. This could possibly allow you to trigger capture with a cheap Arduino, which would avoid the complication and power cost of a linux board processing images. – Ken M Nov 26 '12 at 17:14
  • This has a lot of appeal, and is much more fool-proof. Also, I can embedd the photodiodes around the hive and track where she goes. I have a number of photodiodes and will test this out. – Matt H Nov 26 '12 at 18:16
  • I'd really like to keep in touch on your work. I'm loosely working with a few guys on arduino and linux based monitoring of bee hives, and the ability to watch for a queen would be great to add to other types of data (weight, temperature, entrance activity). I don't see a good way to send you a message or email on Stack Overflow, so either get in touch with me on hackerbee.com or through my Stack Overflow email (assuming it's visible to you) if you're interested. If nothing else, I subscribed to your youtube channel and I'll be watching for more videos showing what goes on in a hive! – Ken M Nov 26 '12 at 19:09
  • There are a lot of people who track insects and they all use regular paint, afaik, so although these ideas sound good, they may be hard to implement. Eg, there seems to be some confusion here between reflectivity and dispersion. Glitter isn't particularly reflective and would be a poor choice: it's only that at certain angles you get a spike in reflectivity. The advantage of beads is that the reflected light goes approx back to the source, so if all the angles are small, this may work, but you're really breaking new ground, whereas the paint and image processing steps are standard. – tom10 Dec 07 '12 at 18:58