Scale-Space Selection

Wei Liu



This project basically follow the procedures mentioned on the project requirement, i.e. the image is iteratively filtered by a Laplacian of Gaussian (LoG) kernel at different scale. However there are a few highlighted points:


Method to create scale space: I used standard method to create scale space - filtring the original image with LoG filter with various scale parameter $ t = \sigma^2$ . To get normalized LoG filter, I multiply the LoG kernel with scale $ \sigma^2$ .

The selection of scales are also standard: $ \sigma = e^t$ , with $ t = [1:0.1:4]$ . To have a $ t$ up to 4 is because the first image have a large scale circle.

Laplacian filtering: Laplacian filter is usually used to detect edges, as it is able to detect the 'zero-crossing' of second derivative of the signal, which is also the extrema of the first derivative. And that extrema happens at the edges. But because it is very sensitive to noise, good practice is to filter image with a Gaussian filter before Laplacian. Because the convolution is associative, we can convolute the two filter first, then use this LoG filter to convolve with original image. This can save computation. We first define the 2D Gaussian as

$\displaystyle G(x, y) = \frac{1}{\sqrt{2\pi \sigma^2}} \exp \{-\frac{x^2+y^2}{2\sigma^2}\}$ (1)

If we denoise image by a Gaussian filter then use Laplacian, we have

$\displaystyle \triangle \{ G(x,y) * f(x,y)\} = \triangle\{G(x,y)\}*f(x,y) = LoG * f(x,y)$ (2)

So we can compute the Laplacian of Gaussian function first. For 2nd derivative of $ x$ , we have

$\displaystyle \frac{\partial^2}{\partial^2 x} G(x,y) = \frac{1}{2\pi\sigma^2}\frac{x^2 - \sigma^2}{\sigma^4}\exp\{-\frac{x^+y^2}{2\sigma^2}\}$ (3)

Compute the 2nd derivative of $ y$ in same way, and we get LoG as

$\displaystyle LoG$ $\displaystyle = \frac{\partial^2}{\partial x^2} G(x,y) + \frac{\partial^2}{\partial y^2} G(x,y)$ (4)
  $\displaystyle = -\frac{1}{\pi\sigma^4}\left ( 1 - \frac{x^2+y^2}{2\sigma^2}\right )\exp\{-\frac{x^2+y^2}{2\sigma^2}\}$ (5)

Practically, we need to truncate the function and get a 2D window with size $ M$ . To approximate the LoG by $ 3\sigma$ principle, I choose the filter window size as $ M = 6\sigma$ . We also need mormalize the kernel after truncating so all elements in kernel sum up to one. This generate a truncated normalized kernel which has slightly different value with (5) (due to normalization). For $ \sigma = 1$ as an example, the LoG kernel I uses is:
    0.0239    0.0460    0.0499    0.0460    0.0239
    0.0460    0.0061   -0.0923    0.0061    0.0460
    0.0499   -0.0923   -0.3182   -0.0923    0.0499
    0.0460    0.0061   -0.0923    0.0061    0.0460
    0.0239    0.0460    0.0499    0.0460    0.0239

Maximum detection strategy: After filtering with LoG at all scales, I have a 3D response $ R$ , which the third dim as the scale form $ 1$ to $ 4$ . To detect the local maximum as candidate of circle center, I search all pixels in all scales. For each pixel, if its response intensity value $ R(x,y, t)$ is greater than all its neighbors I'll pick it out as an candidate.

Remove fake candidates that close to each other: Because the candidate circle center may not be at exactly same location with true center, there may be multiple fake responses to same circle. A simple method to detect if two candidate $ \{x_1, y_1, r_1\}$ and $ \{x_2, y_2, r_2\}$ is same blob can be

$\displaystyle \sqrt{(x_1-x_2)^2 + (y_1 - y_2)^2} > max\{r_1, r_2\}$ (6)

That is, if the distance between two blobs centers are smaller than the larger circle center (which can be obtained by $ r = 1.5 \sigma$ ), I'll have to remove one of them that has less response at circle center. by this method, I can remove circles with one half overlapped.

Remove fake candidates by blob volume: I also defined a criteria to remove the blob that are not significant enough. Lindeberg (1993) links the blob in different scales and compare the significance of all blobs by looking at the contrast, spatial extent and lifetime. Here we simplified his method and only look at the mean volume of a blob over all scales.

We informally define the volume of a blob (or a circle in 2D) as the volume of the 3D shape if we regard the response value after filtering as the third dimension. We'll see this is the combination of contrast and spatial extent from the formal definition below

$\displaystyle V_{\cC_i} = \frac{1}{N}\sum_{t = t_1}^{t_N}\sum_{\{x, y\} \in \cC_i}^{} R(x, y, t)$ (7)

where $ R(x,y, t)$ is the response at $ (x, y)$ and scale $ t$ , N is all the number of scales. The above formula compute the volume of a blob at a scale, and average it over all scales. Because we know the radius from scale, we know the supporting 'base area' of the blob, i.e. the $ \cC_i$ . A illustration can be found in fig. 1. This criteria is definitely better than just thresholding peak response at blob center. Because the peak response is the 'contrast' of the region, and the average volume includes also take the spatial extent into account. It is worthy noting that this criteria favors big blob, as they have big support area, and can easily have big volume.

Figure 1: a blob in 3d space (x, y, R). R is the response value after LoG filtering. We can see the peak at the blob center looks like the top of a 'hill' Lindeberg (1993)
\includegraphics[width = 0.4\textwidth]{onecircle_blob_vol.eps}

Experiment Results and Analysis

In this section, we test the algorithm on the four given images, and also one image I find myself.

We first do test on a simple 'onecircle' image and have the results in 2. The filter works well for this simple image. I also plot the reponse of the circle center over all scales, just to get a glimpse how it looks like. The dynamic filtering at all scales can be found at this GIF image:

Figure 2: Left plot is the filtering response at the best scale $ t = 2.4$ , and $ r = 1.5\sigma = 16$ . Because we look for dark circle, we can see the Laplacian filter have positive response at inner side of the circle's edge, which is what we expected. The middle plot is the response at circle center over all scales. This indicates for ideal circle, the response should be like a convex shape, with a peak value at best scale. The right plot is the results, along with the circle raidus computed from scale.
\includegraphics[width = 0.33\textwidth]{onecircle_bestscale.eps} \includegraphics[width = 0.33\textwidth]{onecircle.png_resp.eps} \includegraphics[width = 0.33\textwidth]{onecircle.png.eps}

We then move to the multiple circle in the second image. In multiple circle detection results (fig. 3), we notice: Two blob close to each other have interference in higher scale, because they tend to merge and give inaccurate circle center. We can see a blue color circle close to the right plot's center-left region, and the algorithm did not detect the center accurately. I did not deal with this issue in this project, but am aware of one solution Lindeberg (1994) that consider the 'split' or 'merge' of two blobs in adjacent scales.

The dynamic scale-space filtering results can be found at

Figure 3: The left figure is the detection results, and right plot is the response of all circle center over all scales. The red color in both plot is the last detected circle and its response trend over scales.
\includegraphics[width = 0.4\textwidth]{scalespaceTest.png_resp.eps} \includegraphics[width = 0.4\textwidth]{scalespaceTest.png.eps}

For 'sunflower2' image, the results is fig. 4. For this real-world image, the algorithm detected some local maxima as circle center, while these are actually not real circle (from human vision). By using the threshold of (7), I only choose those candidate circle center with big average blob volume as final results. The threshold of the average blob volume is set to $ 5000$ , which is rather ad-hoc procedure.

From the results of fig. 4 we see the false positive mostly come from locations much like real circle. Some triangle, and square shaped region, are detected as circles. To further improve the algorithm, I think we can look at not only the peak (and volume) of the blob, but also the shape of the blob. Since we know the shape of a circle blob after Laplacian filtering, we can compare the candidate blob's shape with ideal shape, and hopefully will remove fake circles originated from other shapes (triangle, square, etc.)

Figure 4: Sunflower image detection results. Besides remove the overlapped candidate blobs by (6), I also compute the average blob volume by (7), and threshold it by 5000. The thresholding is a trade off between false positive and false negative.
\includegraphics[width = 0.4\textwidth]{sunflower2.png_resp.eps} \includegraphics[width = 0.4\textwidth]{sunflower2.png.eps}

The forth image have detection results in fig. 5. We can see because around the arm and chest of the baby, there is a shape that has almost closed boundary and looks very much like a circle. The algorithm ends up detecting it as a circle, hence a false positive. But the false positive circles around the baby's head is not what I expected.

Figure 5: Sunflower3 image detection results. The threshold for averaged volume criteria is also same to previous plot. We can see there are one or two false negative, and 5 or 6 false positive. By setting a larger threshold we definitely can eliminate most of the false positive, but this ad-hoc method does not make much sense, so we just keep a fixed threshold.
\includegraphics[width = 0.4\textwidth]{sunflower3.png_resp.eps} \includegraphics[width = 0.4\textwidth]{sunflower3.png.eps}


The scale-space circle detection is able to detect object at different scale. The tricky part is after finding local maxima as candidate circle's center, how to tell apart the real circle from other shapes with closed boundary like triangle or square. This is not much related to scale-space, but to different response of circles, triangle, squares to Laplacian filtering.


Below is some tests on images of myself. See fig. 6 and 7.

Figure 6: Two planet images I used to detect circles.
\includegraphics[width = 0.4\textwidth]{planet_my.png.eps} \includegraphics[width = 0.4\textwidth]{planet2.jpg.eps}

Figure 7: Two 'penny' images with gray level flipped. This is used to detect circles with opposite gray level.
\includegraphics[width = 0.4\textwidth]{penny-round-mix.jpg.eps} \includegraphics[width = 0.4\textwidth]{penny2.jpg.eps}


T. Lindeberg.
Detecting salient blob-like image structures and their scales with a scale-space primal sketch: a method for focus-of-attention.
International Journal of Computer Vision, 11 (3): 283–318, 1993.

T. Lindeberg.
Scale-space theory in computer vision.
Springer, 1994.

Wei Liu 2010-02-11