SUSAN corner detector¶
| Fact | Value |
|---|---|
| Also called | SUSAN, Smallest univalue segment assimilating nucleus |
| Status | Implemented and tested |
| Family | Texture, corners, blobs and features |
| Engine | Science engine |
| Type | Nonlinear, spatial, USAN area minima |
| Output | Features |
| Operator shown as | algorithm (exact) |
| Support radius | 5 |
| Code | engine/src/pixelnexus_engine/filters/susan.py, susan_corner |
| Operator code | engine/src/pixelnexus_engine/filters/susan.py, susan_representation |
| Packages | NumPy, SciPy |
Overview¶
The SUSAN corner detector of Smith and Brady finds corners by counting. Around each pixel it places a small disk of 37 pixels and counts how many of them are about as bright as the center pixel. In a flat area all of them are. On a straight edge about half are. At a corner, fewer are. So a small count marks a corner. The detector takes no derivatives at all. The corners go to the Features panel and are drawn on the canvas as small crosses. The filter runs in the PixelNexus engine, in PixelNexus's own code.
How it works¶
- Take the luma in pixel levels.
- For each pixel, sum the similarity of the 37 pixels of the disk around it.
- Turn small sums into a corner response.
- Keep the pixels whose response is the largest in their 5 x 5 neighborhood.
Mathematical foundation¶
The formula shows the default parameter values.
where
- \(r_0\): The nucleus, the center pixel
- \(n\): The USAN area, from 0 to 37
- \(t\): The brightness threshold
- \(g\): The geometric threshold
Around each pixel, the nucleus r_0, a disk of 37 pixels is placed. Each pixel in it counts as similar to the nucleus by a smooth step. It is about 1 when their brightness differs by much less than t, and about 0 when it differs by much more. The sum n is the USAN area, the univalue segment assimilating nucleus. In a flat area all 37 pixels are similar. On a straight edge about half are. At a corner, fewer are, the fewer the sharper the corner. So the response R grows as n falls below the geometric threshold g. Corners are the pixels where R is above 0 and the largest in its 5 x 5 neighborhood.
USAN stands for univalue segment assimilating nucleus. The nucleus is the center pixel. Its USAN is the part of the disk with about the same brightness, and the USAN area n is its size. SUSAN, the smallest USAN, finds corners as the places where this area is smallest.
The similarity of a pixel to the nucleus is a smooth step, exp(-(d / t)^6), where d is their difference in brightness. It is close to 1 for differences well below t and drops fast to 0 above it. The power 6 makes the step sharp but smooth, so small changes of t do not flip pixels in and out. The geometric threshold g sets how small the area must be. Half of the 37 pixels, as in the paper, lies a little below the area of a straight edge. So edges give no response. Only places where less than half the disk is similar respond. The response R = g - n grows as the corner gets sharper.
The paper adds further tests on the shape of the USAN to remove false corners. PixelNexus leaves them out, so curved edges also give corners.
Kernel or operator¶
The Inspector asks the engine for the stages with the current settings. They are the mask, the USAN area with the brightness threshold, the response with the geometric threshold, and the non-maximum suppression.
Parameters¶
| Parameter | Default | Values | Meaning |
|---|---|---|---|
Brightness threshold brightness |
25 | 1 to 100 levels | How close in brightness a pixel must be to count as similar to the center, the t of the formula. |
Geometric threshold geometric |
0.5 | 0.1 to 0.75 | The share of the 37 mask pixels below which a USAN area counts as a corner. The paper uses half for corners. |
Border mode border |
Reflect 101 (default) | Reflect 101 (default), Reflect, Replicate, Constant (zero), Wrap | How pixels outside the image are filled when the window reaches past the edge. |
Implementation¶
susan_corner in engine/src/pixelnexus_engine/filters/susan.py pads the luma with the border mode and adds the similarity of each of the 37 shifted copies to the image. Then it keeps the pixels whose response is above 0 and the largest in their 5 x 5 neighborhood. The 5 x 5 window is PixelNexus's choice. Touching equal maxima give one corner, the first in reading order. The table has x and y, the response and the USAN area.
Worked example¶
| Brightness threshold | Rectangle | Siemens star | Disks |
|---|---|---|---|
| 10 | 4 | 344 | 112 |
| 25 | 4 | 316 | 100 |
| 40 | 4 | 276 | 120 |
The number of corners with the geometric threshold of 0.5 on the three images of the figure. The rectangle is 100 x 140 pixels at 200 on a ground of 40, so any threshold well below the step of 160 finds its four corners, at the corner pixels themselves, with the response 5.5 and a USAN area of 13 of 37. The other corners on the star and the disks lie along the spokes and the round edges.
Complexity¶
- Time: \(O(37 N)\)
- Memory: \(O(N)\)
N is the number of pixels.
Artifacts and limitations¶
Limitations
- The paper adds tests on the shape of the USAN to remove false corners. PixelNexus leaves them out.
- Curved edges look like weak corners. On the Disks image it finds 160 corners, almost all along the round edges.
- The 5 x 5 window of the suppression is PixelNexus's choice.
Artifacts
- Rows of corners along tight curves and at the ends of thin lines.
Tests¶
The mask must have 37 pixels within a radius of 3.4. The USAN area must equal a brute-force sum with three nested loops, to 1e-12. A flat area must have the full area of 37 and no corners. A rectangle must give exactly its four corner pixels for brightness thresholds of 10, 25 and 40. A straight edge must have about half the area. The engine API tests check the JSON and the stages.
References¶
- Smith, S. M., and Brady, J. M. SUSAN. A new approach to low level image processing. International Journal of Computer Vision 23(1), 45 to 78, 1997. DOI 10.1023/A:1007963824710.