High Resolution to Super resolution using girddata

1 vue (au cours des 30 derniers jours)
Aqsa Sultana
Aqsa Sultana le 2 Mai 2021
Commenté : Image Analyst le 2 Mai 2021
you want to perform nonuniform interpolation using griddata.m to form a uniformly sampled HR image that can be displayed and processed further. However to do so, we must prepare arrays specifying all of the X and Y coordinates of all the LR pixels in the input array data relative to a common HR grid. Note that the coordinates of the pixels in the first (reference frame) can be specified as follows [X,Y] = meshgrid( [1:size(data,2)], [1:size(data,1)] ); The X,Y coordinates of pixels from subsequent frames must be adjusted by the estimated shifts. For example, for Frame 3 we have X3 = X + S(3,1); Y3 = Y + S(3,2);. To use griddata you need to concatenate all of these X and Y coordinates from all the frames as well as concatenate all of the LR frames which make up the Z values. For example Xall = [ X1;X2;X3; ... X16]; Yall = [ Y1;Y2;Y3; ... Y16]; and Zall = [data(:,:,1); data(:,:,2); ... data(:,:,16)];. Now you can define the XI,YI values of the uniform HR grid where you wish to estimate values. I’ll let you figure that out. Now you are ready for griddata.m (use Xall,Yall,Zall as the input and XI,YI as the desired interpolation coordinates). When you run griddata, use the ‘cubic’ interpolation option. Familiarize yourself with the function griddata using small arrays and then apply it here. Inspect the resulting output image and verify that it looks better than a single frame.
The resulting image will appear to be sampled at 3× the original sampling rate of the LR images.
How do I write this piece of code

Réponses (1)

Image Analyst
Image Analyst le 2 Mai 2021
Do what it tells you to do. Here's a start (just copied and pasted code from your assignment):
[X,Y] = meshgrid( [1:size(data,2)], [1:size(data,1)] )
X3 = X + S(3,1);
Y3 = Y + S(3,2);
Xall = [ X1;X2;X3; ... X16];
Yall = [ Y1;Y2;Y3; ... Y16];
Zall = [data(:,:,1); data(:,:,2); ... data(:,:,16)];
[XI, YI] = griddata(Xall, Yall, Zall);
etc. I think they want you (not me) to do the rest.
  2 commentaires
Aqsa Sultana
Aqsa Sultana le 2 Mai 2021
Thank you for the response. I have done all that part. The part where I am stuck - 'Now you can define the XI,YI values of the uniform HR grid where you wish to estimate values. I’ll let you figure that out. Now you are ready for griddata.m' . Basically I am suppose to use meshgrid for that increase the resolution 3 times the original image. The dimension of the original images are 160x160x16 (16 images) .
[XI,YI] = meshgrid( [1:3*size(data,2)], [1:3*size(data,1)] ).
This is how I did it. I got 480x480 which is right but it displays NaN after 160 pixels
Please help me
Image Analyst
Image Analyst le 2 Mai 2021
See my scatteredInterpolant demo. You can replace scatteredInterpolant with griddedInterpolant.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by