We can get the line by using the cross product of 2 points
We can show the results as follows. Each example will include the evaluate angles before and after affine rectification, and a row of visualizations: {input annotated parallel lines | affine-rectified image | input test lines | affined-rectified test lines},
Example1: consines of test lines before affine-rectification: 0.9868 and 0.9987; after affine-rectification: 0.9999 and 0.9999.
Example2: consines of test lines before affine-rectification: 0.7842 and 0.9999; after affine-rectification: 0.9999 and 0.9999.
Example3: consines of test lines before affine-rectification: 0.8964 and 0.9574; after affine-rectification: 0.9999 and 0.9999.
Example4: consines of test lines before affine-rectification: 0.9997 and 0.9911; after affine-rectification: 0.9999 and 0.9999.
Example5: consines of test lines before affine-rectification: and ; after affine-rectification: and .
Using the affine rectification matrix from Q1, we can get the affine rectified images. And from it, we can get the metric rectification simply by using two pairs of perpendicular lines. Suppose for these two pairs of lines, each line pair can be annotated as
We can show the results as follows. Each example will include the evaluate angles before and after metric rectification, and a row of visualizations: {input annotated perpendicular lines | affine-rectified image | metric-rectified image | input test lines | affined-rectified test lines | metric-rectified test lines},
Example1: consines of test lines before metric-rectification: -0.1677 and -0.0349; after metric-rectification: 0.0081 and 0.0293.
Example2: consines of test lines before metric-rectification: 0.1919 and -0.1065; after metric-rectification: -0.0461 and 0.0107.
Example3: consines of test lines before metric-rectification: 0.2527 and 0.0882; after metric-rectification: -0.0018 and 0.0082.
Example4: consines of test lines before metric-rectification: -0.3019 and -0.1722; after metric-rectification: -0.0347 and -0.0404.
Example5: consines of test lines before metric-rectification: 0.9184 and 0.9073; after metric-rectification: 0.0876 and 0.0213.
We want to find the
We can show the results as follows. Each example will include a row of visualizations: {normal Image | perspecticve image | output image}.
Example1:
Example2:
Now we do not have the affine rectified images, but we have 5 pairs of perpendicular lines. Similar as Q2, each line pair can be annotated as
We can show the results as follows. Each example will include the 3 evaluate angles before and after metric rectification, and a row of visualizations: {input annotated perpendicular lines | metric-rectified image}
Example1: consines of test lines before metric-rectification: -0.1476, -0.1761 and 0.1482; after metric-rectification: 0.0063, 0.0155, and 0.0515.
Example2: consines of test lines before metric-rectification: -0.1579, -0.2694 and -0.3019; after metric-rectification: -0.0129, -0.0118, and -0.0221.
Using the same approach from Q3, we can overlay 3 normal images on top of an image with perspective effect by applying Q3 three times. The result is as follows:
input images:
Output image: