image distortion correction

Dear All, 
I am trying correct the distortion of the leed image given below. The reflections under the red line on the left image should follow the straight line but they are distorted. I used 

imageinterpolate/TRNS={radialPoly,1,30,0,0}/FUNC=bilinear resample graph31

and generated the right one. In the right image they fall under the red line but this image is distorted again in a different way.  May be I am doing it totally wrong and there is 

a better way to do this. Any help is appreciated.

image1

I'm not really the expert, but ImageInterpolate Warp might give you what you need if you can figure out the right before and after grids. Other folks may have better ideas.

It helps to have a clear definition of what you mean by "correct". John is right to suggest using ImageInterpolate with the Warp keyword.  I recommend that you check out File Menu->Example Experiments->Imagine->Image Warping Demo.  As you can see in that experiment, changes to the grid affect the warping of the image.  This method has been used for image correction that is different from the transformation that you tried to apply in your example.

The general approach for image correction of this type is to consider a pixel (xi,yi) in the output (corrected) image and write a mathematical expression that determines the source data that contributes to this pixel.  The expression could be a weighted sum or a simple single-pixel selection as in the case of image rotation.  With this formulation you can generate the output image using a simple double loop.

Depending on your application, you may want to display the data on the Ewald sphere.  In that case you would use the data to create a texture for a sphere in Gizmo.  You can find an example of that in File Menu->Example Experiments->Visualization->Advanced->GizmoEarth.

Thank you both for the helpful suggestions, by correction I want to have all the reflections straight in the leed image. They are curved
at the edges, pixel range (x:800,1200) and (2300,2800) . These distortions get corrected automatically if I take at higher energies.
For example the image attached below is without any post-processing and seems correct to me except slight rotation.

 

l.PNG

Can you use some of the diffraction peaks to construct a grid?

One possible correction is to realize that your LEED image must be radially symmetric about a central point that is not necessary the center of the image (as presumed by the warp flag). The second step is to realize the the distortion function may not be radially symmetric about that central point (as presumed by the equation in the warp function).

From what you have posted, I have to wonder whether you have a magnetic field distortion at low energy in your LEED system. If so, I suspect that you will be hard pressed to obtain an easy analytic function for the warping effect in a way to be valid at all electron energies and for all possible physical positions of the sample relative to the screen. You might try purchasing a set of small "kitchen" magnets and positioning them on the outside of your LEED chamber to see whether you can discover a simple way to correct the field. Investing in a magnetic degaussing wand and/or a set of Lorentz coils might help too.

Jeff,

Note that when you use warping with a grid you do not need any analytic expression -- just a grid.  It also gets around the issue of centering.

 

AG

Dear Igor,

Thanks for the suggestion. I need to understand how the warping works from the demo files.

Dear JJ,

did you draw the grid with drawing tools or generated the 1d waves like that to form a grid? 

Are you sure doing distortion correction here is scientifically sound/okay? From my limited experience doing LEED experiments 13 years ago, I have learned that you never do that.

You need to get the magnetic fields shielded and/or corrected. Then you can also get nice LEED images.

I should point out that the nice grid lines above are good for illustration purposes but they are not required.  All you need are the coordinates of the intersections of the grid lines.