High Resolution to Super resolution using girddata
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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
0 commentaires
Réponses (1)
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
Image Analyst
le 2 Mai 2021
See my scatteredInterpolant demo. You can replace scatteredInterpolant with griddedInterpolant.
Voir également
Catégories
En savoir plus sur Matrix Indexing dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!