1

I encounter a problem with my code, and for me to solve it, I need to understand how the function maketform() works, and more specific the 'custom' option.

As i mentioned, i used the 'custom' option that ask for INVERSE_FCN (at least), and i dont know how i need to define this function?, what it should contain?, what it should look like?

I will appreciate if someone can give me a real example or direct me to one.

(In general, my code get a .glt file (for mapping purposes), and it need to convert it into a transformation - T)

Thanks in advance, Gal :)

GalaG
  • 23
  • 5
  • Check gnovice's answer to [this](http://stackoverflow.com/questions/2589851/how-can-i-implement-a-fisheye-lens-effect-barrel-transformation-in-matlab) question; that's a nice example how how to implement it. – Benoit_11 Jul 09 '15 at 16:50
  • 1
    thanks! I will take a look – GalaG Jul 10 '15 at 08:46
  • I have read the answer. It make most things very clear, so thanks. Still i've some question about that. In the example the function get X and T. two question: 1. from where it get X and T?. 2. If i get it right and X is the image it got from the 'imtransform', why X arrange is 2 coloums and vot in 3D matrix (i think that is because in the function it say: X(:,1))? Thanks in advance :) – GalaG Jul 11 '15 at 19:50

1 Answers1

0

I read (a lot) since I asked this question, and some things became clear. I wanted to share my insight on this subject.

  1. What is X and from where we get it? - X is the spatial coordinates of the image, meaning X contains 2 columns, that compose a grid of coordinates for the image. for example, for 3x3 images X will look like:

x(:,1)

ans =

 1
 2
 3
 1
 2
 3
 1
 2
 3

x(:,2)

ans =

 1
 1
 1
 2
 2
 2
 3
 3
 3
  1. What is T and from where we get it? T is the transformation we create when we call the function 'maketform', and when we use the 'custom' option, the transform is a function that we define is the 'maketform'. For example:

invrse_fnc = @(x,~) doSomething(x);

T = maketform('custom', 2, 2, [],invrse_fnc, []);

From this I understand that the function that should be defined when using 'custom', can do anything u want, but notice, the input is 2 columns of the spatial coordinates of your image.

I hope it will help you understand this subject, and any comments will be much welcome.

Good night and good programming to all!

GalaG
  • 23
  • 5