Home > Mathematica > Counting


There is a tree that deposits its fruit on my lawn. I christened it ‘The Phantom Menace’.  I cleaned (incompletely) its deposits and decided to do a little exercise in observation.  I took a picture of the offending tree and area and then another shot over 24 hours later from roughly the same point (I used a landmark).  I accept there are different lighting and camera conditions and the ideal would be a birds-eye view (though some of the tree canopy would obscure its deposits). My guess  (having spent a lot of time gathering the fruit to be either hit or almost hit by another deposit), that the frequency was 1 to 2 drops every 5 to 10 minutes (i.e. between 0.1 /minute and 0.4/minute).

Baseline and repeat pictures

I used Mathematica’s image processing capabilities to automate the counting (ChanVeseBinarize, Dilation, DeleteSmallComponents, ComponentsMeasurement, MaxDetect, DistanceTransform).  I defined a region of interest using ImageTake and expoited the white coloring. The attempt (though not perfect) was reasonable and I present it as follows:


Of course I still have to pick up the fruit but it was an interesting exercise.

(The Phantom Menace exercise the dark side of the Force as with all the image processing Mathematica hung up, the file got corrupted and it is back to square one…but I learned a lot and had fun).

Categories: Mathematica
  1. February 7, 2012 at 2:46 am

    I’m glad I’m not the only one that spends time on the obscure for no obvious purpose!! Love it!!

    You could of course continue onto looking at the distribution pattern of the said drops AND then then still have to pick the fruit of the Menace up! I don’t know where that might lead but maybe a mathematical solution to pruning so the clearing takes less time!

    Keeping the learning alive….


  1. February 6, 2012 at 9:32 pm
  2. February 22, 2012 at 10:02 pm
  3. December 8, 2013 at 9:47 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: