Folding a sheet of paper (Computer Vision)

I am working on a task trying to convert a 2D sketch with folding folds into a full 3D view. Red lines are valleys and blue mountains / peaks . I would like to compute the transformed / mapped coordinates {P1 '... P8'}. I did not find a good software that could do this automatically, but it would be useful advice.

Folding pattern

  • a - bending angle
  • P - coordinate
  • E - element
  • blue line - folded mountain
  • red line - folded valley

Folded a1 = a2 = a3 = 90 deg (pi / 2 rad) (folded angle) and arrows as the normals of the servast

I use Matlab, but I am looking for general algorithms to solve this problem.

Assuming that the point P0 is fixed in origo, and the element E1 does not change its coordinates, what is the best way to describe the transformation? Should I use heterogeneous or homogeneous coordinates, polar coordinates?

For example, the point P8 depends on other coordinates, which depend on the angles.

I suggest that I could use some kind of adjacency matrix for the points (nodes) and / or matrices that connect each element to its nodes. For example: [E1 P0 P4 P5 P1; E2 P1 P5 P6 P2; ​​...]

The transformation for each coordinate is a transformation + rotation, and the transformation depends on the coordinate / element. But it gets complicated with a few related elements ...

How can I gently convert two-dimensional pleated paper into 3D coordinates?

+6
source share
3 answers

you can iterate through all of the folds and calculate the conversion of all pixels located on one side of the fold.

You can use the transformation matrix to calculate the coordinates of the stacked points. see the wikipedia article describing the transformation matrix .

first translate all the points so that the bend is aligned with the axis, and then rotate all the points on one side of the fold in accordance with the direction of the fold. you can then cancel the first translation so that the figure returns to its original position. repeat the process with the next fold until you completely roll the figure.

using matlab, matrix computation is pretty easy to transform.

+1
source

Perhaps you can use the methods used to describe robots with multiple rotational joints; than your problem can be described as a forward kinematics problem. Another interesting indication might be this .

+1
source

You just want to apply a linear transformation to each point on one side of the line.

A transformation is a rotation around an axis whose transformation matrix is given

enter image description here

Since the axis is not centered around the origin, you need to first apply the translation to the origin, then rotate and then translate back.

0
source

Source: https://habr.com/ru/post/917477/


All Articles