src/main/java/com/xceptance/neodymium/visual/ai/corner/Fast9.java
/***
     * For more specified corner detection ("strong corners") where only the FeaturePoints with the highest score of all
     * surrounding pixels, in reflection of identified pixels.
     * 
     * @param width
     *            Image width
     * @param height
     *            Image height
     * @param features
     *            List of found corners with detect method.
     * @return nonMaxFeatures ArrayList of FeaturePoint, all found corners are saved as {@link FeaturePoint}
     */
For more specified corner detection ("strong corners") where only the FeaturePoints with the highest score of all
surrounding pixels, in reflection of identified pixels.

@param width
Image width
@param height
Image height
@param features
List of found corners with detect method.
For more specified corner detection ( " strong corners " ) where only the FeaturePoints with the highest score of all surrounding pixels in reflection of identified pixels . @param width Image width @param height Image height @param features List of found corners with detect method .
private static List<FeaturePoint> nonMaxSuppression(int width, int height, List<FeaturePoint> features)
    {
        int[][] pixels = new int[height][width];
        ArrayList<FeaturePoint> nonMaxFeatures = new ArrayList<FeaturePoint>();
        for (int i = 0; i < features.size(); ++i)
        {
            FeaturePoint fp = features.get(i);
            pixels[fp.x][fp.y] = fp.score;
        }
        for (int i = 0; i < features.size(); ++i)
        {
            FeaturePoint fp = features.get(i);
            int x = fp.x;
            int y = fp.y;
            int score = fp.score;
            if (score >= pixels[x - 1][y + 1] && score >= pixels[x - 1][y] &&
                score >= pixels[x - 1][y - 1] && score >= pixels[x][y + 1] &&
                score >= pixels[x][y - 1] && score >= pixels[x + 1][y + 1] &&
                score >= pixels[x + 1][y] && score >= pixels[x + 1][y - 1])
            {
                nonMaxFeatures.add(fp);
            }
        }
        return nonMaxFeatures;
    }
private static List < FeaturePoint > nonMaxSuppression ( int width , int height , List < FeaturePoint > features ) { int [ ] [ ] pixels = new int [ height ] [ width ] ; ArrayList < FeaturePoint > nonMaxFeatures = new ArrayList < FeaturePoint > ( ) ; for ( int i = 0 ; i < features . size ( ) ; ++ i ) { FeaturePoint fp = features . get ( i ) ; pixels [ fp . x ] [ fp . y ] = fp . score ; } for ( int i = 0 ; i < features . size ( ) ; ++ i ) { FeaturePoint fp = features . get ( i ) ; int x = fp . x ; int y = fp . y ; int score = fp . score ; if ( score >= pixels [ x - 1 ] [ y + 1 ] && score >= pixels [ x - 1 ] [ y ] && score >= pixels [ x - 1 ] [ y - 1 ] && score >= pixels [ x ] [ y + 1 ] && score >= pixels [ x ] [ y - 1 ] && score >= pixels [ x + 1 ] [ y + 1 ] && score >= pixels [ x + 1 ] [ y ] && score >= pixels [ x + 1 ] [ y - 1 ] ) { nonMaxFeatures . add ( fp ) ; } } return nonMaxFeatures ; }
For more specified corner detection ("strong corners") where only the FeaturePoints with the highest score of all
 surrounding pixels, in reflection of identified pixels.
For more specified corner detection ( " strong corners " ) where only the FeaturePoints with the highest score of all surrounding pixels in reflection of identified pixels .