Needle In Haystack Search
In my previous article “Jigsaw Search In Image”, the naming I used still sort of confusing. Lets use the famous phrase of searching for a needle in the haystack.
In the previous version, searching for a needle in the haystack took almost 11 seconds for a small 360x360 image, it will be worse if I tried to search for a thumbnail in a bigger resolution image.
I managed to enhance it to search for four corners of the needle in the haystack and later verify the results pixels by pixels. By doing this, the time taken to search for the needle reduced drastically.
To make comparison fair, I’ll be reusing the same images I used from the previous article.
The new v2 takes less than 1 seconds to find the needle as compared to the old v1 took more than 7 seconds.
As for searching for the needle that is not found in the haystack, the reduction of time required is huge as it no longer uses the dumb, brute force search.