I think if you can get some more assumptions, there might be a way to infer the distortion by the perspective, and hence the lens structure.
If the below assumptions hold, then an edge detection filter (like a Sobel operator) will give you lots of what should be straight, parallel lines in the Real World but what are imaged as slightly curved lines in the image. That curvature then will likely come from the lens and the midpoint is the central axis.
- All objects must be of roughly the same height so that the perspective distortion is mostly due to the lens and not due to the distance from the lens.
- There are parallel lines in the edges of the objects (like the gap between the nuts)
- You can mark or detect the areas where perpendicular edges become visible (like the right borders of the nuts)
I'm not sure how much of these rules is easy/enforceable. If this is for images yet to be taken, maybe you can add a grid to the background behind the subjects. If this is for images already taken, maybe you can find the lens characteristics somewhere. For example panorama stitchers solve a similar problem, deconvoluting images back into rectangular shape.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.