How to display/plot an RGB image on an irregular or rotated grid?

2 ビュー (過去 30 日間)
MrP
MrP 2015 年 5 月 21 日
回答済み: Henrique Barbosa 2017 年 10 月 30 日
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!

回答 (1 件)

Henrique Barbosa
Henrique Barbosa 2017 年 10 月 30 日
Did you find an answer? I have had this same problem in many different situations with Matlab and never found a way.

カテゴリ

Help Center および File ExchangeLighting, Transparency, and Shading についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by