Projection of a image from inside a cylinder to a

2019-04-13 15:39发布

问题:

With a camera inside a cylinder I capture a image. I want to transform that image into a plane 2d. The image inside the cylinder have a lot of dots which forms a grid.

What I tried to do was estimating the transformation. With blob analysis I can detect the center of each point and obtain the coordinates in pixels. I save this in matrix called ImCilynder. After that i create a matrix with coordinates of that points in the plane with the name Im2d.

I calculate the transformation (H) solving the equation:

Imcilynder * H= Im2d;

H= matrix [9x1]

H=pinv(Imcilynder) * Im2d

But, when i'm doing the test with the same points, the result is completely random, so i'm doing something wrong.

Is there a better way to solve this? Can you help me?

Explaining better,

I'm trying to find the transformation which transforms the image above to this image:

So, to clarify, I want the projection of the points which i see in the first image to a plane. Basically i want o unwrap the cylinder.

After the calculation of the transformation matrix. I'm expecting to multiply the first image with the transformation matrix and obtain the points in the plane. Or to multiply the coordinates of the center of the black dots and obtain the coordinates of that dots in the plane. Is this possibly?

Thank you very much,

Afonso

回答1:

Well, what do yo wish to have in a plane? the circles forming a grid? Because if this is the case you need to remove the radial distortion, these kind of models are represented by some parameters, are non-linear by the way. May be if you can find a very good algorithm, you are going to obtain something like this:

If this is not your idea, you need to apply an elastic transformation and this kind of transformation needs to use a kind of grid that is the model of the transformation and you need to propose your model of grid. If you want to do this automatically you need to resort to elastic registration algorithms and you can use a model like this one:

Any ways, this is not a trivial task, there are a lot of research about complex transformations of course if you want to automatically obtain the transformation. Otherwise you can use photoshop ;).