How to display/plot an RGB image on an irregular or rotated grid?
2 views (last 30 days)
Show older comments
I have an aerial image that has undergone some form of rotation, in an attempt to map it correctly to ground co-ordinates. The result of the rotation is irregularly spaced X and Y grids, along with the original Z (RGB) data.
Is there any way I can plot this new image in its rotated form, while maintaining the full RGB colour profile?
So far, I have only found a way to plot a grayscale version, using pcolor.
Some excerpts of the code are below:
X = [1410.99 1409.16 1407.33;1410.17 1408.35 1406.52;1409.36 1407.53 1405.71];
Y = [562.93 562.12 561.31; 563.88 563.06 562.25; 564.82 564.01 563.19];
Z(3,3,3)=0;
Z(:,:,1)=repmat(0,3,3);
Z(:,:,2)=repmat(0,3,3);
Z(:,:,3)=repmat(255,3,3);
Zgray = rgb2gray(Z);
figure
pcolor(X,Y,Zgray)
shading('interp')
This gives me a rotated plot, and when my full image has been converted to grayscale, it gives me some form of image overlaid onto the rotated grid.
What I wish to do is overlay the original RGB image onto this grid, does anyone know what plot function I can use?
I have tried most of the 'image' type functions, and am now thinking I may have to interpolate all the data onto a square, regular grid, is this correct?
Any help greatly appreciated!
0 Comments
Answers (1)
Henrique Barbosa
on 30 Oct 2017
Did you find an answer? I have had this same problem in many different situations with Matlab and never found a way.
0 Comments
See Also
Categories
Find more on Lighting, Transparency, and Shading in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!