java - Pseudo-Code non-maximum suppression -


i have find maximum in octave 3x3x3 neighborhood. means have 4 layers on top of each other , between layers have find maxima. illustration here image. not iam doing represent issue.

octave layer image http://docs.opencv.org/trunk/_images/sift_dog.jpg

now maximum surpression found thi paper: efficient non-maximum suppression. here fast way explained find maxima in image. 2d case shouldn't problem shift in 3d space. problem pseudo code understanding. have pseudo-code:

pseudo-code

the problem red marked part. there have loop have no idea how apply "-[i, i+n] x [j, j+n]" loop. moment solution:

//find local maxima after paper implementation not finished yet private  vector<integer>  findlocalmaximum(image image) {      vector<integer> list = new vector<integer>();        int n = 1;        int step = 2*n + 1;         for(int = n; < image.getwidth()-n; =step)            for(int j = n; j < image.getheight()-n; j =step)            {                int mi = i;                int mj = j;                 for(int i2 = i; i2 < + n; i2++  )                    for(int j2 = j; j2 < j + n; j2++  )                        if(image.getpixel(i2, j2) > image.getpixel(mi, mj))                        {                            mi = i2;                            mj = j2;                        }                boolean found = true;                failed:                for(int i2 = mi - n; i2 < mi + n; i2++  )                    for(int j2 = mj - n; j2 < mj + n; j2++  )                        if(image.getpixel(i2, j2) > image.getpixel(mi, mj))                        {                            found = false;                            break failed;                        }                if(found)               {                   int pos = mj * image.getwidth() + mi;                   list.add(pos);               }            }     return list; } 

so how surprise doesn't work. has idea have @ red marked part.

i'll give example in pseudocode:

lista = [1, 2, 3] listb = [a, b, c]  lista x listb = [(1, a), (1, b), (1, c), ...]  # excluded listae = [1, 3] listbe = [a, b]  listae x listbe = [(1, a), (1, b), ...]  # result lista x listb - listae x listbe = [(1, c), (2, a), (2, b), (2, c), (3, c)]  

now should iterate on result pairs.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -