Hello,
first of all, thank you for your reply :)
Upon testing it seems that the problem only occurs when there are a lot of vectors, specifically when the amount of duplicates reach a certain limit. To place this in context: I use the kdtree AKNN function to find nearest neighborhoods of a certain pixel in an image, I take all pixels from a 5x5 patch, create a vector of size 5x5x3 = 75 and then fill in the R, G, B values in order of every pixel in the vector, i do this for every 5x5 patch from that image, thus creating a matrix of vectors.
When testing this on a 32x32 image with only 4 quadrants (big squares) of single colors no problems were observed, only when doing this on a bigger image say 128x128 with a lot of similar 5x5 neighborhoods, thus generating a lot of equal vectors, this stackoverflow problem occurs.
So to answer your question accordingly, it happens in both situations (lots of duplicates of X, and lots of duplicates of X and Y and so on..) but only when the amount of duplicates of a certain vector reaches a certain unknown limit, so if there are a lot of vectors but only a few duplicates of some vectors no problems occur, only when there are a vast amount of duplicates present in the matrix the stackoverflow occurs.
Kind regards!
|