From: slacky
Elaborating a bit further: It has to compare the patch against the source image by sliding the patch one pixel at a time (left to right, top to bottom), and at each pixel the whole patch (sub image) has to be compared to each pixel insight based on the current patch position.
Example, imagine that each light-gray square is a pixel in the world map, and the green-ish square is the patch (aka snapshot of your minimap on RS):
[INDENT]
[/INDENT]
The dark-gray points which are left holds the value of the similarity at that corresponding point.
So given a patch that is 70x70, and a world map that is 1000x1000 we are left with about { 931*931 * 70*70 = } 4,250,000,000 pixel-comparisons if SPS accuracy is set to 1
I'm amazed that someone is still using or even looking at SPS, thanks guys!
Slacky I'm glad you spent time to understand how SPS works… almost ;)
Instead of going pixel-by-pixel, SPS first lowers the resolution of both minimap and the world map, so that each 4x4=16 pixels box turns into a big pixel. Kind of.
This works in a way that SPS_MakeColorBox() goes through individual pixels from an actual bitmap, and sums all red, green and blue values. It then gives you the totals in an integer array with length of 3.
So this TIntegerArray now represents a "SPS pixel", with tia[0]=red, tia[1]=green and tia[2]=blue.
Areas of these "SPS pixels" can be represented via 3-dimensional integer array, where the dimensions are as follows TIA[x][y][r/g/b].
After this "lowering of resolution" is done, the method depicted in the gif applies. Kudos to whoever made the gif, I could not explain the principle better myself.
This saves a good deal of iterations without actually lowering the accuracy of positioning. I doubt the actual method can get any more efficient in this use, only the used algorithms and code.
—
I still lurk around every now and then, by the way :) Pretty busy studying though, I just started doing stem cell research