Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Folding a sheet of paper (Computer Vision)

I'm working on a task trying to transform a 2D sketch with folding creases to a full 3D representation. Red lines will be valleys and Blue mountains/tops. I would like to calculate the transformed/Mapped coordinates {P1'...P8'}. I Haven't found any good software that could do this automaticly but would appreciate tips.

Folding Pattern

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

Folded With a1 = a2 = a3 = 90 deg (pi/2 rad) (folded angle) and arrows as surfare normals

I'm using Matlab but I'm looking for general algorithms for solving this problem.

Assuming point P0 is fixed in origo and element E1 won't change its coordinates, how should I best describe the transformation? Should I use inhomogeneous or homogeneous coordinates, polar coordinates?

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

I suppose I could use some kind of adjacency matrix for the Points(Nodes) and/or a matrix that pair every element with its Nodes. E.g: [E1 P0 P4 P5 P1 ; E2 P1 P5 P6 P2 ; ...]

The transformation for every coordinate is transformation+rotation and the transformation depend on the coordinate/element. But it gets tricky with several element connected...

How can I neatly tranform a 2D "paper" with folding patterns to 3D coordinates?

like image 375
Pontus Hultkrantz Avatar asked Jun 06 '12 18:06

Pontus Hultkrantz


2 Answers

you can iterate through every folding creases, and compute the transformation of all pixels lying on one side of the crease.

you can use a tranformation matrix to compute the coordinates of the folded points. have a look at the wikipedia article describing transformation matrix.

first, translate all points so that the crease is aligned with an axis, then rotate all the points on one side of the crease according to the direction of the crease. you can then reverse the first translation so that the figure comes back to its original position. repeat with the process with the next crease, until you have completely folded the figure.

using matlab, matrix computation are pretty easy to preform.

like image 138
Adrien Plisson Avatar answered Oct 18 '22 18:10

Adrien Plisson


You could maybe use techniques used to describe robots with multiple rotational joints; than your problem could be described as a forward kinematics problem. Another interesting reading could be this.

like image 20
WebMonster Avatar answered Oct 18 '22 16:10

WebMonster