I'm looking for the name of a transform that does the following (example images included) I'm in the usual situation that if I would know what the name of the thing was, then I could find the answer. Since I dont know the name, here is what I'm looking for:
Suppose I have the following "snake" of 10 quadrilaterals:

I now want to apply a transformation to each of these quadrilaterals such that the "snake" is straightened. To that end I calculated a perspective transformation according to what I read here. This also seems to work "somehow" as I end up with the following result:

As one can see, the line that was in the center of the "snake" is not in the center of the straightened object anymore.
What I need is a transformation which linearly scales all the content of the "warped" quadrilaterals into straight rectangles. If something was at the center of an edge in the snake, then it should also be at the center of the transformed edge. Apparently a perspective transform does not do this.
My question is: which transformation am I looking for that fulfills this property?

From the tag "linear algebra" I guess you are looking for a linear transformation.
Then it is impossible. Because, the inverse, which is again a linear transformation can only map a rectangle to a parallelogram and not to a 'snake'. 
