AST is an acronym standing for Accelerated Segment Test. This test is a relaxed version of the SUSAN corner criterion. Instead of evaluating the circular disc only the pixels in a Bresenham circle of radius r around the candidate point are considered. If n contiguous pixels are all brighter than the nucleus by at least t or all darker than the nucleus by t, then the pixel under the nucleus is considered to be a feature. This test is reported to produce very stable features. The choice of the order in which the pixels are tested is a so called Twenty Questions problem. Building short decision trees for this problem results in the most computationally efficient feature detectors available.
The first corner detection algorithm based on the AST is FAST (Features from Accelerated Segment Test). Although r can in principle take any value, FAST uses only a value of 3 (corresponding to a circle of 16 pixels circumference), and tests show that the best results are achieved with n being 9. This value of n is the lowest one at which edges are not detected. The order in which pixels are tested is determined by the ID3 algorithm from a training set of images. Confusingly, the name of the detector is somewhat similar to the name of the paper describing Trajkovic and Hedley’s detector.
It is the RealBasic translation of the nonmaximal FAST-9 written by Edward Rosten
With this library you can find Corners very fast within a picture.
Again, the RealBasic engine has a simple interface so you can focus on the fun stuff!
dim FCD as new ABFastCornerDetector dim tmpXYTraining(-1) as ABXY dim i as integer dim j as integer dim pic as Picture dim tmpPic as Picture dim DownSample as integer dim build2Dim as Boolean = true Dim f as FolderItem dim ft1 as new filetype ft1.name = "picture" ft1.Extensions = ".png;.bmp;.jpg;.jpeg" dim dlg as OpenDialog dlg = new OpenDialog dlg.Title = "Pick picture" dlg.PromptText = "Pick a picture to compare" dlg.Filter=ft1 if dlg.InitialDirectory = nil then dlg.InitialDirectory = GetFolderItem("") end if f = dlg.ShowModal if f <> nil then if f.Exists then pic = f.OpenAsPicture else Return end if else Return end if ' these are then numbers you can play with FCD.threshold_detection = 20 FCD.threshold_scoring = 0 DownSample = 2 ' do the FAST detection tmpXYTraining = FCD.detectFASTCornerFeatures(pic,DownSample, build2Dim) tmpPic = NewPicture(pic.Width, pic.Height, 32) tmpPic.Graphics.DrawPicture pic,0,0 tmpPic.Graphics.ForeColor = &cFF0000 ' and draw them for i = 0 to UBound(tmpXYTraining) tmpPic.Graphics.DrawLine tmpXYTraining(i).x*DownSample - 3, tmpXYTraining(i).y*DownSample, tmpXYTraining(i).x*DownSample + 3, tmpXYTraining(i).y*DownSample tmpPic.Graphics.DrawLine tmpXYTraining(i).x*DownSample, tmpXYTraining(i).y*DownSample-3, tmpXYTraining(i).x*DownSample, tmpXYTraining(i).y*DownSample+3 next Canvas1.Graphics.FillRect 0,0, 640,480 Canvas1.Graphics.DrawPicture tmpPic,0,0
You can download the FAST engine from: http://www.gorgeousapps.com/ABFAST.zip
Until the next post!