2

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.

enter image description here

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: enter image description here

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

Afonso
  • 46
  • 8

1 Answers1

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:

enter image description here

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:

enter image description here

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 ;).

Alexander Leon VI
  • 499
  • 1
  • 4
  • 18
  • Thanks for the answer, it explained a lot. I have very low experience in projection/transformation algorithms, so i'm a little lost in this subject. How did you obtain the first image? Did you photoshop? I think if you could explain me how do you obtain the first image it solves my problem. However, the ideal solution was calculate the transformation using your second idea. Do you have any sites which you can provide me about the second idea with elastic transformations? Thanks, Afonso – Afonso Jul 22 '15 at 08:55
  • Well, I supposed the first image as I imagined how a radial transformation could impact on the original image. But if you are interested in the process of image registration you can start with [this](http://www.sciencedirect.com/science/article/pii/S0262885603001379), you could have a first idea of what is image registration and if it could be useful to your application. Despite the elastic registration is a little bit more complicated you can watch [this](http://www-sop.inria.fr/asclepios/Publications/Tommaso.Mansi/mansi10IJCV.pdf). – Alexander Leon VI Jul 22 '15 at 14:46
  • Hello again, I have been reading the links that you gave me, but i really noob in this subject and everything that i tried, failed, can you help me? I tried to implement this: http://www.mathworks.com/help/images/point-mapping.html – Afonso Jul 23 '15 at 10:09
  • Something that could be helpful is a graphical example of what you are expecting, in order to try to help you – Alexander Leon VI Jul 23 '15 at 14:45
  • You don't need to use an algorithm, what I really want to see is a draw with the result that you are expecting, you can do it in a piece of paper and upload a photography of it :) – Alexander Leon VI Jul 23 '15 at 15:18