Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
fix distorted round
#13
(10-26-2020, 10:24 AM)Ofnuts Wrote:
(10-26-2020, 07:02 AM)Ottia Tuota Wrote: So, for example if you choose some four points A,B,C,D from the circumference of your clock face, and corresponding four points P,Q,R,S from a circle, the created transformation should be the one needed.

The problem is that its difficult to figure out the 4 points that should correspond to 4 known points on the final correct circle. It is however possible to indicate 4 points on the distorted circle, but nothing more. So the question is, given 4 points, is there a way to compute the Projective transform (is this transform unique? additional constraints are possible to make it unique, such as keeping the distance between two points identical, or keepin the orientation between two given points, or both)) than puts them on a circle? If I have this transform, I can figure out a way to use it with gimp_item_transform_perspective().

I have now a sort of an answer to your question.

A general fact: Let A,B,C,D be four points of which no three are collinear, and let P,Q,R,S be other four points of which no three are collinear. Then there is a unique projective transformation sending A->P, B->Q, C->R, D->S. (In fact, this holds true in the projective plane which means the plane extended by one line at infinity. So, some of the points may be at infinity.)

Now to your question. Assume that A,B,C,D are four distinct points. Let us assume, as you did, that they lie on a distorted circle (thus, no three are collinear). Draw a circle through A,B,C; let us call the circle Y. Then choose P,Q,R,S as follows: Let P=A, Q=B, R=C, and let S be any point on Y, distinct from A,B,C. Apply the above general fact to this situation. It follows that there is a unique projective transformation which keeps A,B,C fixed and sends D to S. So, A,B,C,D are sent to the circle. To get the construction unique, we can agree that S is defined to be that point on Y which is closest to D, or we can use some other restriction.

This may seem like a dubious trick but I think this is all right. After this, writing a plugin for this job is simple, if you are willing to use my plugin: It requires just writing and solving some equations (to find S) and then letting the plugin call my plugin with proper inputs (points A,B,C,D and P,Q,R,S). (Though in practice it probably is not quite so simple. If infinities come into play they may cause my plugin to fail, and this depends on how S is chosen.)
Reply


Messages In This Thread
fix distorted round - by denzjos - 10-23-2020, 08:47 AM
RE: fix distorted round - by rich2005 - 10-24-2020, 08:44 AM
RE: fix distorted round - by denzjos - 10-24-2020, 11:06 AM
RE: fix distorted round - by Ofnuts - 10-24-2020, 02:38 PM
RE: fix distorted round - by denzjos - 10-24-2020, 05:31 PM
RE: fix distorted round - by Ofnuts - 10-25-2020, 05:37 PM
RE: fix distorted round - by denzjos - 10-25-2020, 06:29 PM
RE: fix distorted round - by Ottia Tuota - 10-26-2020, 07:02 AM
RE: fix distorted round - by Ofnuts - 10-26-2020, 10:24 AM
RE: fix distorted round - by Ottia Tuota - 10-26-2020, 05:09 PM
RE: fix distorted round - by Ottia Tuota - 10-30-2020, 07:26 AM
RE: fix distorted round - by denzjos - 10-26-2020, 08:01 AM
RE: fix distorted round - by Ottia Tuota - 10-28-2020, 05:14 PM

Forum Jump: