0

I have the following image. It contains unwrapped phase angles. As you can see from the image below, they increase left to right.

However, the size of the image I have below is only 700 x 700 pixels (approx). I would like to have the values outside of this 700x700 window size i.e. what are the values at (-10,-10) of (1800, 1800)?

The reason why I have got the following representation is: I took a photograph of a sine grating and computed the phase at every pixel. I can't use an infinitely sized sine grating, and the camera only has a limited spatial resolution. I need to know the phase angles outside of this 700 x 700 pixel range.You may notice that my camera was not vertically straight and therefore the phase angles aren't either! (they slope slightly). The second image, is the same image, but the phase angles are not 'unwrapped' - I show this, in case someone has a clever way to doing what I need with a periodic pattern instead of an ever increasing one.

Unwrapped Phase Figure

Wrapped Phase Figure

keyserSoze
  • 137
  • 1
  • 9
  • 1
    Is this what you need? https://stackoverflow.com/questions/35064904/matlab-interp2-extrapolation?rq=1 – Ander Biguri Jun 21 '18 at 11:48
  • This does look exactly like what I need.I have not used this function before and I am reading about it now. Do you know how to use that function? -> if so, could you please show me how? – keyserSoze Jun 21 '18 at 11:55
  • MATLABs documentation is way better than what any of us can say, and its already there accessible to you. Please always read the manual. – Ander Biguri Jun 21 '18 at 12:01
  • I've just tried using it for extrapolation, and I can't get it to work - requires a function for extrapolation. So, I don't think this is appropriate after all. – keyserSoze Jun 21 '18 at 12:02
  • That is an incorrect statement. Show the code that failed. – Ander Biguri Jun 21 '18 at 12:02
  • Vq = interp2(V,1000,1000); Where, V is my image - will result in NaN. If I give it a x,y position that I know of, it will give me the value I already have. – keyserSoze Jun 21 '18 at 12:04
  • To be clearer: Vq = interp2(V,700,700,'Cubic',0) Where V is my image, the last parameter is the extrapolation function, where here I've used zero so that any value out side of the boundary is now zero instead of NaN. This is not what I need. – keyserSoze Jun 21 '18 at 12:12
  • 1
    Ah, you just need to read the link I shared, and that would solve your problems! When I wrote: always read the manual, what I meant is to please, please, always read the manual, because it contains the correct information. I close this question as a duplicate. If you **properly** test the options there and they still do not work (you have not tested them as suggested or explained in the manual/docs) and still it does not what you need, please feel free to open a new question describing why it does not work and what have you tried – Ander Biguri Jun 21 '18 at 12:15

0 Answers0