Showing posts with label SimpleCV. Show all posts
Showing posts with label SimpleCV. Show all posts

Monday, August 11, 2025

deconstructing counting board debris

beekeeping,bee,SimpleCV,Python,chatbot,iPhone,varroa,
Green contours surround 2 varroa mites

 
My beekeeping journal
I have several notebooks to journal my hobbies. There is one for the backyard chickens and one for the worm farm - you get the idea, I’m a mess! What’s going on in these journals? Usually, it's just my pencil or ink block letter writings, but when I get excited about a topic, out comes the straight edge and I draw with a mechanical pencil, colored pencil, and highlighter.
The big picture
I usually capture photographs of my counting board and hive inspections for ease of use when I later write in my beekeeping journal or need to capture time and date for my blog. Here, I’m focusing on my counting board debris for a small spring swarm trap capture and using a chatbot interface (for example, ChatGPT). In the spring, the debris begins as beautiful, clear wax mirrors; over time, I see grainy lumps of pollen; then darker wax cappings appear.

In the summer, I find small hive beetles and female varroa mites in my debris observations. For spotting tiny varroa mites, I use a magnifying glass and methodically raster scan (line by line style) the counting board. The mites are approximately 2mm in width (left-to-right) and are nearly all found resting on their feet (back facing upwards). If you look closely you can see their feet sticking out on the mouth side of the insect. I asked the chatbot 1) what is the size of the varroa mite, and 2) is a varroa mite an insect? The chatbot supported this observation as a female mite and goes on to say that a male mite is much smaller and rarely seen outside the brood cell. Here’s a table that chatbot produced. The table values look reasonable, but if you type “add sources” to the chatbot reply, you might be more confident with the results.

TraitInsectsArachnids (like Varroa mites)
Body segments3 (head, thorax, abdomen)2 (cephalothorax, abdomen)
Legs68
AntennaeYesNo

Taking the iPhone photo
Here are my steps to photograph the debris board.

  • Place the debris board in bright indirect sunlight
  • Touch the iPhone screen to focus
  • Adjust the brightness slider (icon looks like the sun) until the debris-free region matches the expected white color
I took an additional up-close photo that captured a small portion of the counting board containing varroa mites. Why? This is necessary if you want to see the varroa mite legs with the pixel resolution of my iPhone
Computer vision prototyping
I typed “how to get started with OpenCV and Python” into the chatbot prompt and followed the numbered steps. I made incremental progress by replying to the chatbot with write code using OpenCV and Python to: 1) read my JPG file, 2) define the mite color by clicking on the image, 3) calculate a mask using color distance, 4) dilate the mask, 5) threshold the mask, 6) find external and internal contours, 7) filter contours with area limits, 8) filter contours with approximate convexity limits, 9) filter contours with approximate circularity limits, 10) draw the filtered contours on the my JPG using a heavy green line, and 11) write this result to an image file. This seems like lots of work, but it's a factor of 10 easier than writing my own code from scratch. Sometimes the chatbot would suggest that I upload the file to execute all the steps for me. FYI, there is a “+” icon near the prompt area to browse your computer and upload your JPG file.The mites are reddish-brown and have a shiny spot when their backs are facing the iPhone. In photography, the shiny spot is often referred to as a "specular highlight", and this requires infilling with the processing step #4, dilation.
Computer Vision Conclusion
To detect all the mites I had to trial-and-error adjust my program filters. The computer vision project was interesting, but I quickly reached the pixel limit of my iPhone and my hobby lighting skills. The best news, the filtered contours drew my attention to a few mites that I missed without the program.


Monday, September 7, 2020

enhancing propolis envelope

beekeeping,bee,propolis,bee health,propolis envelope,plant resin,darwinian beekeeping,SimpleCV,
beekeeping,bee,propolis,bee health,propolis envelope,plant resin,darwinian beekeeping,SimpleCV,
beekeeping,bee,propolis,bee health,propolis envelope,plant resin,darwinian beekeeping,SimpleCV,

I described the honey bee health benefits of a propolis envelope in an earlier post

  • lowered immune response expression
  • less bacterial growth in brood food
  • lower number of chalk brood mummies
  • reduced severity of American Foulbrood

In March of this year, I added a box where I created side-by-side patches of shallow grooves with a dremel tool and router bit. After honey harvesting, I removed this box and analyzed the interior wall for propolis.  I cropped the photo so exactly 11 grooves in each patch are included in the comparison of: 

  • 1/4 inch (6.4 mm) wide shallow grooves (on the left)
  • no grooves (seen between two patches)
  • 1/8 inch (3.2 mm) wide shallow grooves (on the right)

In the first photo, propolis appears as a red film which is distributed everywhere, but groove edges have a thicker red film. In the second photo, I used SimpleCV to mask out areas of thin propolis film.   In the third photo, I used SimpleCV to draw regions of thick propolis and compared 3 regions:

  • 61.5% of thick propolis area was associated with 1/4 inch (6.4 mm) wide shallow grooves (on the left)
  • 0.5% of thick propolis area was associated with no grooves (seen between two patches) - look at the bottom of the photos for thick propolis in the no groove region
  • 38.0% of thick propolis area was associated with 1/8 inch (3.2 mm) wide shallow grooves (on the right)
I'm not suggesting 1/4 inch wide shallow grooves is the best option.  More narrow 1/8 inch grooves pack into the same length of box wall than wider 1/4 inch grooves.   There's no significant propolis advantage of either groove width except to say grooves outperform doing nothing with regards to enhancing a propolis envelope. 

Sunday, December 11, 2016

Honey Comb Cell Size & Machine Vision

bee, beekeeping, honey comb, natural cell size, SimpleCV,

bee, beekeeping, honey comb, natural cell size, SimpleCV,
Here are my final results using natural comb, back lighting and the programming language SimpleCV.  The cropped image is from a frame which does not have foundation.  Presumably, this light colored wax was used to store honey.

If you see the hexagonal boundaries, then you know that the image is rotated - the bottom of the frame is found to your left.  In the book The Buzz about BeesJürgen Tautz describes how bees convert tube-like wax cells which resemble the shape of the bee body into a hexagonal wax form.  In the image, circular-ish tube-like cells are surrounded by hexagonals.

I colored coded the SimpleCV identified circular-ish cells - green are larger and blue are smaller. Part of the image is over exposed, so a few cells are not detected.  As you can see, like sized cells are found next to one another.  Also, cell size varies with the most likely between 5.1 and 5.2 mm.


Tuesday, November 22, 2016

Natural Cell Size & Machine Vision

I'm in the process of measuring natural cell size using a simplified version of machine vision OpenCV software - it's called SimpleCV.    Still, the SimpleCV learning curve is steep and I would not recommend SimpleCV to the non-programmer - it's not simple to create a robust workflow to measure natural cell size.    Don't attempt this programming journey without the book - Practical Computer Vision with SimpleCV -The Simple Way to Make Technology See.
 
Michael Bush has written on the subject of natural cell size and focused on measuring brood comb. I'm going to start my measurements with cells used for honey storage. Honey comb is not darkened. So, I'm able to light the cells from either the camera side or from behind the cells - I've decided to start with placing my light source behind the cells.  This honey comb was drawn without foundation. I'm using Medium Foundationless Frames from Kelly Beekeeping - select frame style F.

Here are a few photos of my setup and SimpleCV results so far.
bee, beekeeping, foundationless. walter t kelly, honey comb, natural cell size, SimpleCV,
bee, beekeeping, foundationless. walter t kelly, honey comb, natural cell size, SimpleCV,