Project 1: Blob Detection Using Scale Space

Manasi Datar


1. Overview

In this project we explore the application of scale-space analysis. The objective is to implement a method that localizes circular patches (aka blobs) in a given image. As discussed in class, the Laplacian filter is used to detect step-like patterns across the scale-space, and the final blob location is reported based on local maxima detected in the Laplacian filter response across scale-space.

The following sections present details of the steps discussed above, and also provide information about implementation choices made. Section 2 describes the scale-space generation using iterative Gaussian blurring. Section 3 elaborates the use of Laplacian filtering to detect step-like features across scale-space. Section 4 goes into detail about local maxima detection of the Laplacian response across scale-space. The next two sections (5 & 6) provide results on the given test images and discuss some of the issues that arise from my implementation. The report concludes with a brief discussion of the implementation and goals for the rest of the semester.


2. Scale-Space Representation

Iterative Gaussian blurring is used to generate a scale-space representation of the input image. Such a representation allows us to examine the given image using increasing aperture sizes, thereby facilitating the detection and processing of coarse to fine features under the same framework. However, looking at an image from arbitrary apertures of the same order of magnitude is often unproductive. Hence, we step along the scale axis in a logarithmic fashion, and also work within given lower and upper bounds for the scale parameter. Thus, for a given scale (t), the corresponding Gaussian kernel wil be of the form:

σ = et

The easiest way to implement such a filtering scheme is to generate a unique Gaussian kernel for each level of the scale-space. However, such a brute force approach is slow and wasteful in terms of resources. A slight modification allows us to successively convolve images at various scales with a constant Gaussian kernel. This approach, though slightly faster is euqally bad in terms of resource utilization.

The associative nature of the Gaussian kernel provides us with an elegant way to implement the scale-space representation. Taking advantage of the fact that convolving two Gaussians results in a Gaussian with sigma equal to the square root of the sum of squares of the input sigmas, we can compute the sigma-step required to compute the next logarithmic-level of the scale-space in a single convolution operation. We make use of the following relationship:

σstep2 = σi+12 - σi2

where σstep is the quantity we need to determine using the relationship between sigmas at level i and (i+1). This is the approach implemented in this project.
The following figure shows successive scale-space representations of the image with a single blob.

original

t = 0.0

t = 0.5

t = 1.0

t = 1.5

t = 2.0


3. Laplacian Filter

As Canny suggested, and subsequent discussions in class showed, the Laplacian operator proves to be an efficient detector of step-like features (aka blobs we attempt to find). Given the complete scale-space from the previous step, it is logical to convolve each of the images in the generated scale-space with a Laplacian filter of the form:

  1   1
-8  1
  1  1
This approach is better than explicitly computing the Laplacian of each successive Gaussian kernel used to generate the scale-space representation.

It is important to scale the output of the Laplacian filter proportional to the scale at which we are operating. This is due to the fact that Gaussian blurring dampens the signal proportional to σ2. Thus, we use the same multiplicative factor to scale the response of the Laplacian filter at each scale.


4. Using Local Maxima for Blob Detection

The center of the flat region of a step-like feature (in our 2D case, the blobs) should result in a local maxima in the filter response across scales. Detecting such a peak enables us to localize the center of the corresponding blob. This involves searching a 3D neighborhood around a pixel in the combined scale-space to ensure that it is indeed a local minima. The implementation is inspired from neighborhood operations in ITK using the 26-neighborhood around each pixel.

Once a local maxima is found, the size (radius) of the corresponding blob can be determined by looking at the expression for the Laplacian as the second derivative of the Gaussian kernel. We have a term of the form 2σ2. This is exactly the normalization factor that relates distances in the Laplacian filter output to the σ used to generate the image at the current scale. (edit: this was discussed again in class today !). The radius of the corresponding blob is given in terms of the scale as

r = 1.414*σ

Another heuristic to improve the speed of the implementation involves restricting the search for local maxima to very high intensity levels in the Laplacian response. This helps in discarding a large chunk of the response and speeds up the search for the local maxima.
Finally, the localized blob is depicted as a bright circle. Please note that the output images are re-scaled to better visualize the detected blob, and hence appear darker than the input images.

5. Results

The following table shows the results of my implementation on the various test images provided. Please click on the links in the first column to view the log files displaying the location and radii of blobs detected in each instance.

One Circle
Multiple Circles 1
Multiple Circles 2
Sunflower 1
Sunflower 2


6. Conclusion

This project demonstrates the power of simple filters (used constructively) to obtain algorithms that help us detect features at multiple scales. The scale-space representation is a powerful tool for segmentation and feature detection. However, the method is not without its share of problems. As we traverse the scale axis, we may come across a feature that is actually formed by a combination of features at smaller scales. This results in a false local maxima across scale-space and we end up "inserting" features in the given image. We can see instances of this occuring arouund the baby's image in the Sunflower-2 example.

Another problem is due to non-circular blobs. These produce responses at various scales that are just spurious ! Some examples can be seen again the the two sunflower examples.

However, these problems do not undermine the strength of the algorithm, which can be tuned further (based on the application) to generate better results.


7. Implementation Notes

This class provides a great opportunity to use and learn the VISPack library. I implemeted the above methods using C++ and the VISPack library for basic image processing operations. The code can be compiled using CMake on multiple compilers. As the course progresses, I hope to come up with a framework that includes the various algorithms we work on. Parallelization using GPU programming also seems imminent (only if time permits !).