Simulating lens tilt on image

조회 수: 10 (최근 30일)
David H
David H 2020년 6월 9일
댓글: Bjorn Gustavsson 2020년 6월 17일
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일

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by