I'm working with image recognition (marker detection) and was looking into image downsampling pre-recognition to boost performance. Reasoning is I'll downsample the image, run the detection algorithm on that and then interpolate the marker coordinates using the downsampling factor. I thought that downsampling cost would be trivial since it's being done all the time by our gpu .
So I tried using opencv to downsample and saw that not only did I not get any improvements, it actually took even longer. I then figured it was because I was making the cpu do it, so I looked into downsampling using opengl mipmaps or even shaders but from what I've read it still remains a costly task, taking tens or even hundreds of milliseconds to halve common image resolutions.
My question is, if downsampling is being continuously done with apparent ease (think resizing an image on any image viewer or any texture in a videogame) why is it so slow using the most common methods? Is there some secret technique or am I just not understanding something?