Borrar filtros
Borrar filtros

Crop and change perspective of image

22 visualizaciones (últimos 30 días)
HaMo
HaMo el 8 de Dic. de 2022
Editada: HaMo el 8 de Dic. de 2022
Let's say I have a photograph of a rectangular painting. When the photograph was taken, the camera was tilted about the yaw, pitch and roll axes relative an axes that projects in a perpendicular direction out from the painting. Also, in the photograph the painting is framed by the wall behind the painting. I want to crop the image and change the perspective so that it appears that the painting was right in front of the camera, and without the wall behind it. Nevermind the distortions to the image.
In python, it can be done with a single command. The input is the coordinates of the painting's four corners in the photograph's coordinate system, and the output is the coordinates of all four corners of a rectangle (in an arbitrary cartesian coordinate system).
Is there a similar simple way to achieve this in Matlab ?

Respuesta aceptada

DGM
DGM el 8 de Dic. de 2022
Editada: DGM el 8 de Dic. de 2022
You can use fitgeotrans() and imwarp(). It's a little more generalized, so it's not exactly a one-liner.
Here is one example correcting the perspective of a photo of a whiteboard.

Más respuestas (0)

Categorías

Más información sobre Geometric Transformation and Image Registration en Help Center y File Exchange.

Productos


Versión

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by