Skip to content
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 image undistortion and image rectification #89

Open
Shrediquette opened this issue Mar 29, 2023 · 3 comments
Open

Add image undistortion and image rectification #89

Shrediquette opened this issue Mar 29, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed highprio High priority feature

Comments

@Shrediquette
Copy link
Owner

Here is an answer to my question in Matlab answers:
https://de.mathworks.com/matlabcentral/answers/1919160-image-undistortion-with-fixed-camera-position-and-single-calibration-image?s_tid=srchtitle#answer_1181145

Maybe use the existing lens distortion GUI in the iamge acquisition toolbox. Use the parameters in PIVlab. Also provide a way to do image rectification.

But the big question is: where do we undistort? Do we do this before the analysis? So is it smart to interpolate/undistort the input images? Or should the images be processed with PIV as they are and then the results (vector coordinates and displacements) are corrected for image distortion? I think that the latter would not work properly, as the cross-correlation would be performed on distorted sub-images. This can't be optimal. But undistorting/interpolating an image before analysis will also alter pixel information and maybe change the shape of some particle images. This is also not really good...

@Shrediquette Shrediquette added enhancement New feature or request help wanted Extra attention is needed highprio High priority feature labels Mar 29, 2023
@Shrediquette Shrediquette self-assigned this Mar 29, 2023
@ErichZimmer
Copy link

ErichZimmer commented May 26, 2023

@Shrediquette
You can implement the marker detection like this (updated). I designed it to use the same correlation algorithms that is used in PIV to limit the the use of third party software so I can transcribe it into c++17 or rust 2021. Please note that the marker detection function is still being refactored.

For camera calibration, I recommend a pinhole camera model. To calibrate it, first put a calibration plate directly in front of the camera so that lens distortion can be estimated. Then, the camera parameters can be estimated using Zang's method and moving the calibration plate throughout the volume (for 3D calibration). The RMS error is usually around 0.25 pixels without applying self calibration based on Wieneke's methods.

@ErichZimmer
Copy link

ErichZimmer commented May 27, 2023

I think this article can help you make better decisions for where the image rectification occurs.
Distortion correction of two-component - two-dimensional PIV using a large imaging sensor with application to measurements of a turbulent boundary layer flow at Re = 2386

From experience, it is best to interpolate the image if only performing a single pass else add the undistortion matrix to the window deformation matrix and then deform the images. The latter avoids smoothing from performing multiple interpolations when performing multi-pass window deformation analysis.

@ErichZimmer
Copy link

If you want some additional references, I created a curated list of PIV papers earlier today/last night that includes a few papers covering calibration techniques. Later this week I plan on adding more papers along with creating drop-down summaries to help aid readers in locating some research papers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed highprio High priority feature
Projects
None yet
Development

No branches or pull requests

2 participants