-
Notifications
You must be signed in to change notification settings - Fork 18
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
Chromatic aberrations fix example ? #17
Comments
Vignetting and chromatic aberration are different things. Vignetting corrections (via lensfun's For correcting chromatic aberrations you would have to use |
Thanks for reply,
|
Can you check at http://lensfun.sourceforge.net/lenslist/ whether your lens has a "yes" at the TCA column? If not, then that's the reason, and I guess this could be surfaced better with a useful error message. If yes, then it's a bug I think. |
You're right, TCA wasn't available for this lens. undist_coords seems correct with a valid TCA calibrated lens. It's kind of wierd, but with subpixel coords, cv2.remap (per channel) is going pretty crazy, rotating the green channel 90°. need a bit more investigation to get it working. # OpenCV is BGR order
r = im[..., 2]
g = im[..., 1]
b = im[..., 0]
r_undistorted = cv2.remap(r, undist_coords[..., 0], None, cv2.INTER_LANCZOS4)
g_undistorted = cv2.remap(g, undist_coords[..., 1], None, cv2.INTER_LANCZOS4)
b_undistorted = cv2.remap(b, undist_coords[..., 2], None, cv2.INTER_LANCZOS4)
im[..., 2] = r_undistorted
im[..., 1] = g_undistorted
im[..., 0] = b_undistorted
cv2.imwrite(undistorted_image_path, im) |
@paulparneix, I may have a (late) solution for you. It seems swapping the axes on the green channel solves the issue, although I don't know why.
|
Fixed in #44 and will be part of the next release. With that fix, it would be (note # OpenCV is BGR order
r = im[..., 2]
g = im[..., 1]
b = im[..., 0]
r_undistorted = cv2.remap(r, undist_coords[..., 0, :], None, cv2.INTER_LANCZOS4)
g_undistorted = cv2.remap(g, undist_coords[..., 1, :], None, cv2.INTER_LANCZOS4)
b_undistorted = cv2.remap(b, undist_coords[..., 2, :], None, cv2.INTER_LANCZOS4)
im[..., 2] = r_undistorted
im[..., 1] = g_undistorted
im[..., 0] = b_undistorted
cv2.imwrite(undistorted_image_path, im) |
Hello,
Those python bindings to lensfun look pretty cool!
What is the workflow for fixing chromatic aberration / vignetting? (I need to fix chromatic aberrations, but not large distortion). It's not really clear in the API docs.
Thanks.
Paul.
The text was updated successfully, but these errors were encountered: