Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reconstructing a 2D shape from its projection in 1D

I have a convex closed shape in 2 D space (on the x-y plane). I do not know what it looks like. I rotate this shape about approximately the center of its bounding box 64 times by 5.625 degrees (360/64). For each rotation I have the x-coordinates of the extreme points of the shape. In other words I know the left and right x extents of the shape for each rotation (assuming an orthographic projection). How do I obtain 64 points on the shape that do not contradict the x projections. Note that the 2D shape is rotating, but the coordinate axes are not rotating along with it. So if your object is a line, the x projection of each end if plotted will essentially be a sin/cos wave depending on its original orientation.

The higher the number of rotations, if I have the solution - the closer I will get to my actual shape.

In reality I do not know the exact point I am rotating the shape about, however any solution assuming I do know will still be helpful, as I don't mind the reconstruction being imperfect.

like image 472
gc234 Avatar asked Oct 20 '22 08:10

gc234


1 Answers

We used the straight-forward method to reconstruct.

Projection is a shade of the object.

You start with a bounding 2D box. For each projection you cut away from the 2D shape left and right parts that fall outside of the projection. So, the main function calculates intersection of two convex 2D shapes. You calculate these intersections for each projection.

We have several purple projections P1, P2, P3, P4 of the original green object:

enter image description here

Knowing position of a purple projection build two red rays coming from the end points of a projection and intersect them with the reconstructed object:

enter image description here

The red object was reconstructed using 4 projections. When compared to original green you can see that they are not the same. The more projections you have the less error you'll get in the final result.

enter image description here

like image 97
Vladimir Baranov Avatar answered Nov 02 '22 23:11

Vladimir Baranov