Overlaying Compass Plot on an Image
7 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I would like to overlay a compass plot on top of an image. I would need to set the specific location where I want the plot, and its size. I tried using "hold on" but it didn't work.
0 Commenti
Risposte (1)
Piyush Kumar
il 30 Lug 2024
You can use imfuse function. It creates a composite image from two images. There are examples on this page explaining how to create overlay image.
% Generate some data for the compass plot
U = randn(1,50);
V = randn(1,50);
% Create the compass plot and save it as an image
% figure;
% Create a smaller figure for the compass plot
figure('Position', [100, 100, 150, 150]); % Adjust the size as needed
compass(U, V);
saveas(gcf, 'compass_plot.jpg');% Load or import your image
img = imread('<your-image-path>');
% Load the compass plot image
compass_img = imread('compass_plot.jpg');
% Use imfuse to overlay the compass plot image on the original image
overlay_img = imfuse(img, compass_img, 'falsecolor','Scaling','joint','ColorChannels',[1 2 0]);
% Display the overlay image
% figure;
imshow(overlay_img);
You can adjust the position of the compass plot in the figure function.
0 Commenti
Vedere anche
Categorie
Scopri di più su Convert Image Type 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!