lenscorrection | Python batch lens distortion correction | Computer Vision library
kandi X-RAY | lenscorrection Summary
kandi X-RAY | lenscorrection Summary
Python batch lens distortion correction
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Processes a list of photos
- Takes in exif data and returns the correct image
- Multiple processes
- List all files in a directory
lenscorrection Key Features
lenscorrection Examples and Code Snippets
Community Discussions
Trending Discussions on lenscorrection
QUESTION
I have four cameras each feeding me a different portion of a basketball court. Due to the slight offset of the cameras physical locations and lens distortion around the edges of the camera, I cannot simply stitch the videos together without some kind of correction.
I've looked into ffmpeg's perspective
filter, as well as the lenscorrection
filter. In the former case it was only able to create a trapezoid, not the curved image I want. In the latter case using negative values to k1
and k2
seemed to be heading in the right direction, but it either disorted the top and bottom of the image to the point of being nonsensical noise, or it zoomed in to the image so much that I lost important details.
For the sample picture below, ultimately I want the midcourt line (the blue vertical line on the right side) to be vertical, and I want the mess of wires on the white desk at the bottom to remain visible and identifiable.
Given a video which looks like the following: I wish to produce something like the following:This image was made using the "Curve Bend" filter in GIMP, but I just eye-balled it - so it's not perfect. Ideally once I get the exact parameters the midcourt line will be perfectly vertical
When using thelenscorrection
filter, no values for k1
and k2
seemed to get the effect I want:
Negative k1
, negative k2
:
Negative k1
, positive k2
:
Positive k1
, negative k2
:
Positive k1
, positive k2
:
In general:
- negative / negative distorted the image beyond recognition
- negative / positive looked alright, but the midcourt line was off the screen and it wasn't clear if any distortion had been applied
- positive / negative looked the best, but while the top and bottom curved in the middle of the left and right actually bulged out, leaving the midcourt line distorted
- positive / positive was the opposite of the desired effect
ANSWER
Answered 2019-Nov-25 at 15:34Short answer: No. FFMPEG does not have a curve bend function. That said, curve bend is not the proper solution, anyway. A lens correction is necessary, the parameters supplied were just way off.
Ultimately I just wrote a script to dump thousands of images using lensfun
with different lenses, then skimmed them for one that looked good
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install lenscorrection
You can use lenscorrection like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page