BRISK¶
| Fact | Value |
|---|---|
| Also called | BRISK keypoints |
| Status | Implemented and tested |
| Family | Texture, corners, blobs and features |
| Engine | Science engine |
| Type | Nonlinear, spatial, AGAST corners in scale space |
| Output | Features |
| Operator shown as | algorithm (simplified) |
| Support radius | global |
| Code | engine/src/pixelnexus_engine/filters/keypoints.py, brisk |
| Operator code | engine/src/pixelnexus_engine/filters/keypoints.py, keypoint_representation |
| Packages | OpenCV |
Overview¶
BRISK finds corner keypoints with their scale and orientation. It looks for AGAST corners, an adaptive form of FAST, in a scale space of octaves and the intra-octaves between them. It keeps the corners that stand out in position and scale, refines them, and gives each an orientation. The keypoints go to the Features panel and are drawn on the canvas. Only the detector runs, not the binary descriptor. The filter runs in the PixelNexus engine, with OpenCV.
How it works¶
- Build octaves and intra-octaves.
- Find AGAST corners in each layer.
- Keep corners that beat their neighbors in position and scale, and refine them.
- Give each one the direction of the mean gradient of its pattern.
Mathematical foundation¶
The formula shows the default parameter values.
where
- \(s\): The FAST score of a corner
- \(t\): The threshold
- \(g_x, g_y\): Local gradients over the long-distance pairs of the pattern
- \(x, y\): The keypoint position, with the center of the top-left pixel at 0, 0
- \(\theta\): The orientation, counterclockwise from the x axis
BRISK builds a scale space of octaves, each half the size of the one before, with intra-octaves between them. The first intra-octave is the image shrunk by 1.5. In each layer it finds AGAST corners, an adaptive form of FAST, with score s above the threshold. A corner is kept when its score beats its neighbors in its own layer and the layers above and below. Its position and scale are refined by fitting quadratics. The orientation is the direction of the mean gradient over the long-distance pairs of the BRISK sampling pattern.
The scale space of BRISK has octaves, each half the size of the one before, and intra-octaves between them. The first intra-octave is the image shrunk by 1.5. In every layer, BRISK finds AGAST corners and their FAST score s, the largest threshold at which the point is still a corner.
A corner is kept when its score beats its 8 neighbors in its own layer and the scores in the layers above and below. Its position and scale are refined by fitting quadratics to the scores. The orientation comes from the BRISK sampling pattern, a set of points on rings around the keypoint. For the pairs of points that are far apart, the local gradient is the difference of their smoothed values over their distance. The mean of these gradients gives the orientation.
Kernel or operator¶
The Inspector asks the engine for the stages with the current settings. They start with the 8-bit luma and follow the detector step by step. They summarize what OpenCV does, so the label is Simplified.
Parameters¶
| Parameter | Default | Values | Meaning |
|---|---|---|---|
Threshold threshold |
30 | 1 to 200 | The AGAST corner threshold, in levels. OpenCV uses 30. |
Octaves octaves |
3 | 0 to 8 | The number of octaves. 0 finds corners at one scale only. OpenCV uses 3. |
Implementation¶
brisk in engine/src/pixelnexus_engine/filters/keypoints.py calls cv2.xfeatures2d.BRISK_create with the threshold and the number of octaves, and detect on the 8-bit luma. OpenCV 5 keeps BRISK in cv2.xfeatures2d. The table has x, y, the radius, the angle, the score and the octave.
OpenCV puts the center of the top-left pixel at 0, 0, as the feature tables do, so positions keep their fraction. OpenCV measures angles clockwise in image coordinates, where y points down. The table turns them to count counterclockwise from the x axis, as (360 - angle) mod 360. The rows are sorted by score. With a selection, the detector still looks at the whole image, and only the keypoints on selected pixels are kept.
Worked example¶
| Image | Keypoints | Radius (px) | Found after a quarter turn (%) |
|---|---|---|---|
| Siemens star | 396 | 5.2 to 36.0 | 24 |
| Disks | 125 | 4.5 to 36.0 | 14 |
BRISK with the defaults on the 512 x 512 test images. The last column is the share of keypoints found again after the image is turned a quarter counterclockwise: within 1 pixel of the turned place, with a radius within 10 percent, and with an angle 90 degrees larger, within 5 degrees. A quarter turn moves pixels exactly onto pixels, so any loss comes from the detector itself.
Complexity¶
- Time: \(O(N)\)
- Memory: \(O(N)\)
N is the number of pixels.
Artifacts and limitations¶
Limitations
- Finds corners only, not blobs.
- Turning the image a quarter in OpenCV's BRISK finds few keypoints again at the turned place with the turned angle. On the Siemens star it is 24 percent, against 67 to 87 percent for SIFT, ORB and AKAZE. The worked example shows it.
- Only the detector runs. The binary descriptors are not computed.
Artifacts
- A few keypoints share their place with another of a different size, 22 of the 396 on the Siemens star.
Tests¶
The table must hold what OpenCV's BRISK finds, with the angle turned to count counterclockwise, sorted by score. The detector must come from cv2.xfeatures2d. A flat image must give no keypoints, and runs must repeat exactly. The engine API tests check the JSON and the stages.
References¶
- Leutenegger, S., Chli, M., and Siegwart, R. Y. BRISK. Binary robust invariant scalable keypoints. IEEE International Conference on Computer Vision, 2548 to 2555, 2011. DOI 10.1109/ICCV.2011.6126542.
- OpenCV documentation, cv2.xfeatures2d.BRISK_create and detect.