sunyinhui / jopensurf

Automatically exported from code.google.com/p/jopensurf
Other
0 stars 0 forks source link

Extremum is a Maximum #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The isExtremum(...) function in FastHessian only considers positive values. 
However, responses could be negative and minimum are also interest points.

Suggest to modify isExtremum(...) as follows:

    ...

    final double candidate = m.getResponse(r, c, t);
    if (Math.abs(candidate) < mThreshold) {
        return false;
    }

    // System.out.println("r = " + r + ", c = " + c);
    // See if the response in 3x3x3 is greater or lower, then it isn't a local extrema
    for (int rr = -1; rr <= 1; rr++) {
        for (int cc = -1; cc <= 1; cc++) {
            if (candidate > 0) {
                if (t.getResponse(r + rr, c + cc) >= candidate
                        || (rr != 0 || cc != 0)
                        && m.getResponse(r + rr, c + cc, t) >= candidate
                        || b.getResponse(r + rr, c + cc, t) >= candidate) {
                    return false;
                }
            } else {
                if (t.getResponse(r + rr, c + cc) <= candidate
                        || (rr != 0 || cc != 0)
                        && m.getResponse(r + rr, c + cc, t) <= candidate
                        || b.getResponse(r + rr, c + cc, t) <= candidate) {
                    return false;
                }
            }
        }
    }
    return true;

Regards

Original issue reported on code.google.com by yves.cui...@gmail.com on 6 Feb 2012 at 10:27

GoogleCodeExporter commented 9 years ago
Two years late is better than never, the change got included in the code and 
latest jar file.

Original comment by andrew.s...@gmail.com on 17 Feb 2014 at 8:36

GoogleCodeExporter commented 9 years ago

Original comment by andrew.s...@gmail.com on 17 Feb 2014 at 8:37