New feature idea: perspective transform

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

New feature idea: perspective transform

dxli
The math:

1, there's a projection matrix to map a convex quadrilateral to another;
2, this type of projection turns a conic section into another conic section.

The basic description of the feature:

1, select entities to transform;
2, select 4 source points (to form a convex quadrilateral);
3, select 4 target points (also convex).

A transform is created to transform the source points to the targets, and the transform is applied to the selected entities.

Clearly, this new feature contains:

Move,
Rotate,
Scale,
Shear,
Stretch,
And perspective.
Reply | Threaded
Open this post in threaded view
|

Re: New feature idea: perspective transform

sand1024
Well, I suppose there could be a good addition there - a support of isometric projections (as predefined defaults for the transformation matrix, of course - so the it will not be necessary for the user to define the matrix).  

From the implementation point of view, however, it's hard to say whether it is practical to add separate matrix transform method for entities or to combine existing ones and add full support all individual methods you've mentioned, like shear, stretch and perspective.
Reply | Threaded
Open this post in threaded view
|

Re: New feature idea: perspective transform

sand1024
In reply to this post by dxli
Just realized that there might be another specific application of this - correction of distortions of the image.

If the image is used as a background for creation of entities on top of it, it's important to remove such distortions (and ensure that angles and distances that are picked form the image are correct).  

For this one, something like https://doc.qt.io/qt-6/qtransform.html#quadToQuad should work...
Reply | Threaded
Open this post in threaded view
|

Re: New feature idea: perspective transform

dxli
Yes, that's the initial inspiration of using the Microsoft Phone app: "Lens" (not the google lens).

It's limited to perspective correction, but our framework may want to support stretching/shearing as well.

The missing part: hyperbola.

Other than hyperbolas, we have all tools to support other conic sections.

Spline/splinepoints can be supported by mapping the control points.


sand1024 wrote
Just realized that there might be another specific application of this - correction of distortions of the image.

If the image is used as a background for creation of entities on top of it, it's important to remove such distortions (and ensure that angles and distances that are picked form the image are correct).  

For this one, something like https://doc.qt.io/qt-6/qtransform.html#quadToQuad should work...