I have written a program to perform subpixel image registration using mathematica and doing some of the more computationally complex parts of the code in CUDA for a nice speedboost. I have this all working fine and i can compute the misalignment between images to arbitrary fractions of pixels.
The next step for me is to take the misaligned picture and generate a new image from it which is perfectly aligned with my reference image. To do this i need to generate new values for each pixel using some sort of interpolation as they are effectively inbetween the pixels of the actual image. Sorry is this is worded badly…
It is my understanding that I should be able to do this pretty efficiently using the texture memory to hold the image as it can perform bilinear interpolation when i try to read values from floating point coordinates that are inbetween the actual pixels??
Assuming this is correct im just not sure how to do it. I get the feeling it should be pretty easy. As I am working from mathematica I can only load things into the global memory and im not sure where to proceed from here, do I make a kernel where I pass in the array of floating point values, then copy it to texture, then read back from the texture into a new array of floating point values? I am also unsure as to what will happen at the boundary conditions. I could probably just scrap the outermost pixel on every edge easily enough because I am working with pretty large images here.
Sorry if none of this makes any sense…