Lecture 39: Image Processing III (A method for counting circles)

Microfluidic application: Imaging fluorescing droplets

A high speed camera will capture thousands of images like the one shown above in a single second. How can we leverage this knowledge to generate an algorithm that will quickly count the glowing droplets in the imaging data produced?

Below is a list of heuristic axioms that we may use to our advantage (this list is not exhaustive)

Assuming the above, we can preprocess an image as we've done in the previous class (example images):

Because we've established all circles to be similar in size, we can use one sample image to test the average circles area.  We can take the sum of the
binary test image, which represents the area of the image (in pixels) with an assigned value of (logical) 1. In other words, we can roughly find the  combined area of all the circles, and then divide that number by the known amount of circles to find the area of an average circle:

Now, given a new picture with an unknown number of circles of the same size, we should be able to deduce how many circles are present by dividing the sum of the image (after prepocessing) by the average value found by the previous test:

Because we recognize that slight differences in size are inevitable, we can use a function to round our output value to the nearest integer: "ceil" & "floor". Ceil rounds up, and floor rounds down (both round to the nearest integer value).


ceil(2.15423) = 3
ceil(2.5) = 3
ceil(2.899) = 3

floor(2.15423) = 2
floor(2.5) = 2
floor(2.899) = 2

~1 drops are in the subject image (right)

** Because the circles aren't exactly the same size, comparing the size of 1 test circle to many subject circles can lead to significant error accumulation.**

~13 drops were found in this image (actual = 13)

~22 drops were found in this image (actual = 20)

All the images used above can be downloaded from here.
Fill in all blanks and answer the critical thinking question

The image 'fludrop.jpeg' can be found here

*note the question
included in task 1*

Answer the above question as a comment in your script

(e.g.  % Write your answer like this... )

The image 'fludrop_7.jpeg' can be found here

The image 'fludrop_10.jpeg' can be found here

The image 'fludrop_13.jpeg' can be found here

  Complete the above script to output the number of glowing droplets using fprintf.

  Please remember to answer the question in bold as a comment in your script.

  Submit your .m file via email by April 18th (next Wednesday).