Help using coordinates to overlay an image on a plot
7 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (2)
Mike Garrity
il 24 Lug 2015
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 Commenti
Kelly Kearney
il 24 Lug 2015
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 Commenti
Vedere anche
Categorie
Scopri di più su Image Processing Toolbox in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!