Help using coordinates to overlay an image on a plot
6 ビュー (過去 30 日間)
古いコメントを表示
I have a plot of experimental points and am trying to add an aerial image, sort of a map, overlain on the plot. But the image is an awkward shape, so using imagesc didn't work well. I have reference points within the picture that line up to the grid my plot is on. Is there a way I can use those to line up the picture with the plot? The plot is 2D.
0 件のコメント
回答 (2 件)
Mike Garrity
2015 年 7 月 24 日
The Image object (which is created by the image & imagesc commands) has a pair of properties named XData and YData. Normally, when you create an Image object using one of these commands, the XData is set to [1 N], where N is the number of columns in the image. In the same way, the YData is set to [1 M], where M is the number of rows.
But you can set these to different values. For example, this will give you an image which goes from 1 to 2 in X, and 2 to 3 in Y:
img = imread('ngc6543a.jpg');
h = image(img,'XData',[1 2],'YData',[2 3])
The return value h is a handle to that Image object. You can call set and get to modify it:
set(h,'XData',[4 5])
0 件のコメント
Kelly Kearney
2015 年 7 月 24 日
If you need more than a simple translation of coordinates, you may want to look at the image registration functions in the Image Processing Toolbox ( cpselect, cpcorr, imwarp, etc.).
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!