-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add interpolation schemes #30
Comments
This is the interrogation grid interpolation? |
The bilinear interpolation is for interpolating the vector grid into the image grid. The Whittaker-Shannon interpolation is used for interpolating the new image grid into one or both of the images (first or second order image deformation). |
For clarity:
The Whittaker-Shannon interpolation: could you describe that in more detail? |
On Whittaker-Shannon interpolation, it is superior, but slower that a third order b-spline interpolation. In fact, the only interpolation routine that has similar accuracy is a gaussian interpolation kernel (at least from my synthetic tests). See http://dx.doi.org/10.1007/s00348-004-0902-3 for an idea on the performance of a sinc kernel. On interpolation as a whole, first, the old coordinates and velocity components are interpolated onto a new grid, usually with a window size half of the old grid's window size. Then, the velocity component is interpolated onto the image grid. Say the image size is 1300x1600px and new grid size is 40x50 vectors. The velocity field is interpolated to the pixel level of the image so that we can use it to map the locations of the new pixels. Once we get the dense predictor (aka deformation field), we can use a Whittaker-Shannon interpolation scheme to deform the image based on the dense predictor field. In OpenPIV-Python, scipy 's map_coordinates (spline interpolation) is used for the window deformation. Two examples of a complete window deformation algorithm can be seen in OpenPIV-Python's |
I'll do a quick multi-pass example to see how feasible it is with the current grid generator. |
I have a basic interpolation function setup, however the x, y, u, v components are std::vector<double> for simplicity. Core::gf_image could also be used as well as a dedicated structure with components to be interpolated. |
Interpolation routines (X, Y, U, Xq, Yq):
Mapping routines (U, Xq, Yq):
NOTICE: |
FWI, I decided to make a matrix and vector class for the convolutional kernels and vector fields. The matrix class would be useful for holding a 2D representation of the vector field for interpolation purposes. I also plan on either implementing a linear algebra library (for fun) or use eigen for the decompositions since I am also working on a sparse volume class for tomographic PIV and multiple camera calibration. Basically, I would like this library to be an all round PIV software equivalent to commercial software in both abilities and processing efficiency while being as portable as possible so that python bindings could be made on as many platforms and python versions as possible for interoperability with OpenPIV-Python. Luckily, in-progress enhancements from the OpenPIV-Python project ports neatly into c++ (albeit, with a lack of OOP if that is a problem) as long as nonlinear algebra is avoided. |
Add interpolation schemes for future window deformation. An example can be seen here
https://github.com/ErichZimmer/OpenPIV-Python-cxx/tree/eb_fix/src/interpolation/_2D
The text was updated successfully, but these errors were encountered: