0

all though only the 2D data is available, the best way to think of this problem is a piece of paper pinned at one corner to a wall, but the paper is sitting at an angle to the wall, see illustration below, this generates a second set of vanishing points v2a and v2b. Given only this 2D data, I want to rotate the "paper" so it is parallel to the wall, which is easy enough to rotate, but point a1 stretches out to a new length d1-a2, this does not stretch proportionately with the length of v2b going to v1b, because it is in perspective (from a 3D world), it is instead some log proportion.

so this is the question, what is the calculation that is used to find the new length d1-a2? after a rotation as shown, given a known length d1-a1 (in a 2dimensional set up as shown).

I am not very good at reading scientific notation, so if the answer could also be expressed in "C" or objective-C code, (or even sudo code) that would be great.

enter image description here

enter image description here

Ali Caglayan
  • 5,726
hokkuk
  • 51

2 Answers2

0

If I'm not mistaken, this question is resemblant to:

There are few good answers at that place. If I'm not mistaken ..
Han de Bruijn
  • 17,070
  • that question/answer is on the right track, but I believe the question and answer depend on the knowledge that you know both the four source points, and also the four destination points, and you are then just using a matrix to map the start image, to the final image. In my question, I really don't know the four destination points ahead of time, that is what I am trying to find, (but then I would use a similar approach after finding these points.) – hokkuk Aug 22 '14 at 13:16
  • @hokkuk: If you specify exactly what is known and what is unknown, that would help. – Han de Bruijn Aug 22 '14 at 17:49
  • what is known is the length d1-a1, what I would like to find is the length d1-a2. – hokkuk Aug 23 '14 at 14:02
  • @hokkuk: Okay, but how about c1,c2,b1,b2 ? – Han de Bruijn Aug 23 '14 at 14:44
  • if the length d1-a2 can be found, all the rest can be found in a similar manner as to what ever the method that was used to find d1-a2. – hokkuk Aug 24 '14 at 05:09
0

it appears that the answer lies in the intersection i1,

so that a good approximation of the length that i seek:

(d1-i1) * ((cos(a1) pow n) = d1-a2

where "n" is a ratio of ((v1a - v1b) / (v2b - v1a))

I'm still looking to improve this approximation.

the line (d1-i1) lies on the line (d1-v1b)

Update: i've found several situations now where this doesn't work as an approximation, so I am still looking for a better solution.

enter image description here

hokkuk
  • 51