Saturday, December 17, 2011

Nearest Neghbor


In Defense of Nearest-Neighbor Based Image Classification:


My first Nearest Neighbor image classifier is working now... I can't say I'm particularly impressed with the results of my first attempt. I'm just converting to a standard image patch doing a normalized correlation. 

        for( int x=0;x<patch1.length;x++) {
            correlation += (double)patch1[x] * (double)patch2[x];
            norm1 += (double)patch1[x] * (double)patch1[x];
            norm2 += (double)patch2[x] * (double)patch2[x];
        }

        return( (((correlation / Math.sqrt(norm1*norm2)) + 1.0) / 2.0) );


So I'm going to give this paper a try...

0 Comments:

Post a Comment

<< Home