Azzera filtri
Azzera filtri

How to add an image to the current axes without replacing existing plots

1 visualizzazione (ultimi 30 giorni)
I have created a matrix, called "Final" and I want to plot its contour pattern on an image, in a polygon shape.
I tried "imagesc(Final,"XData",[min_x_2 max_x_2],"YData",[min_y_2 max_y_2],"AlphaData",0.5)" and was able to plot a rectangle contour map successfully. But I want to plot it on a RoI such as [1558,1798; 1790,1806; 1782,2006; 1562,2018].
(Note that the "Final" matrix's contour map might exceed the area of the polygon)
Thank you.

Risposte (2)

Matt J
Matt J il 19 Feb 2024
Modificato: Matt J il 19 Feb 2024
You can use hold
fcontour(@(x,y) (x-50).^2+(y-50).^2,[20,80],'m'); hold on
imshow(imread('cameraman.tif')); hold off
h=gca; h.Children=flip(h.Children);

Image Analyst
Image Analyst il 19 Feb 2024
See my attached examples to inset images and plots into other images and plots.

Categorie

Scopri di più su Images in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by