Simulating lens tilt on image

13 次查看(过去 30 天)
David H
David H 2020-6-9
I am currently trying to simulate the effect of lens tilt on a flat image (i.e., one that does not contain multiple depths of field). The lens would be tilted in both RX and RY, so in a direction not aligned with the plane of the photo.
Is there currently anything within the image processing tool box that does this? If not, is there a known algorithm to produce the effect of the tilted plane of focus?
  5 个评论
Bjorn Gustavsson
Bjorn Gustavsson 2020-6-12
David, for your well-behaved psf I have a computationally fairly OK solution. It is based on converting the 2D-smoothing-operations into a pair of 1-D sparse matrix operations. The sparse matrices takes some time to build up, but the actual smoothing is very rapid. Since you have Gaussian kernels repeated smoothing with a narrow Gaussian results in a smoothing with a wider Gaussia you might be able to get away with less of the start-up-times.
Bjorn Gustavsson
Bjorn Gustavsson 2020-6-17
Did the suggestions from Image Analyst and me help? The two suggestions should take care of both perspective effects and PSF-variations.

请先登录,再进行评论。

回答(2 个)

Bjorn Gustavsson
Bjorn Gustavsson 2020-6-10
OK, here's a two thirds (some reasonable-fraction) solution that computationally is not too shabby. In its current version it allows for a combination of horizontal smoothing that varies in the vertical image-direction and a vertical smoothing that varies in the horizontal direction. It builds separate sparse smoothing-matrices for each separate direction, this takes a bit of time, the actual smoothing is then only a pair of vector-sparse-matrix ultiplications and rather efficient. I think this is approximately what you need - your Gaussian PSFs are trivially separable (10 s of Gauss-aweing) so that should be fine, the function should be expanded to allow for smoothings that varies at least as Kxx, Kxy, Kyy, and Kyx. It might be possible to be very clever and come up with a decomposition of more general PSF - similar to what is used in convolve2, but that is TBD.
HTH

Image Analyst
Image Analyst 2020-6-12

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

产品


版本

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by