how to show images at a point in a plot?
I have an autonomous vehicle with a camera that follows a predetermined path. Ive already found a way to save each frame of the video and figure out which lat and long each frame belongs to, what im having trouble with is plotting the images in a for loop. I feel like im close, below is my code:
P = uigetdir(‘C:’);
S1 = dir(fullfile(P,’*.png’));
n_frame = numel(S1);
LatSize = size(Lat1, 1);
LongSize = size(Long1, 1);
FrameCount = LatSize/n_frame;
Lat = Lat1(1:FrameCount:end);
Long = Long1(1:FrameCount:end);
for i = 1:n_frame
F2 = fullfile(S1(i).name);
I{i} = imread(F2(i));
plot(Long, Lat)
axes(‘Position’, [Long(i,:) Lat(i,:) .5 .3])
imshow(I)
end
What am I missing here? I get this error when I run the code:
Unable to find file "F"
The various frames of the video are labeled Frame 0001.png, Frame 0002.png and so, there are 739 frames of the video and I want to plot each frame at the point they were recorded. My ultimate goal is to make it so you can click the plot and the picture will appear but ill deal with that part later. Any help is appreciated, thanks!I have an autonomous vehicle with a camera that follows a predetermined path. Ive already found a way to save each frame of the video and figure out which lat and long each frame belongs to, what im having trouble with is plotting the images in a for loop. I feel like im close, below is my code:
P = uigetdir(‘C:’);
S1 = dir(fullfile(P,’*.png’));
n_frame = numel(S1);
LatSize = size(Lat1, 1);
LongSize = size(Long1, 1);
FrameCount = LatSize/n_frame;
Lat = Lat1(1:FrameCount:end);
Long = Long1(1:FrameCount:end);
for i = 1:n_frame
F2 = fullfile(S1(i).name);
I{i} = imread(F2(i));
plot(Long, Lat)
axes(‘Position’, [Long(i,:) Lat(i,:) .5 .3])
imshow(I)
end
What am I missing here? I get this error when I run the code:
Unable to find file "F"
The various frames of the video are labeled Frame 0001.png, Frame 0002.png and so, there are 739 frames of the video and I want to plot each frame at the point they were recorded. My ultimate goal is to make it so you can click the plot and the picture will appear but ill deal with that part later. Any help is appreciated, thanks! I have an autonomous vehicle with a camera that follows a predetermined path. Ive already found a way to save each frame of the video and figure out which lat and long each frame belongs to, what im having trouble with is plotting the images in a for loop. I feel like im close, below is my code:
P = uigetdir(‘C:’);
S1 = dir(fullfile(P,’*.png’));
n_frame = numel(S1);
LatSize = size(Lat1, 1);
LongSize = size(Long1, 1);
FrameCount = LatSize/n_frame;
Lat = Lat1(1:FrameCount:end);
Long = Long1(1:FrameCount:end);
for i = 1:n_frame
F2 = fullfile(S1(i).name);
I{i} = imread(F2(i));
plot(Long, Lat)
axes(‘Position’, [Long(i,:) Lat(i,:) .5 .3])
imshow(I)
end
What am I missing here? I get this error when I run the code:
Unable to find file "F"
The various frames of the video are labeled Frame 0001.png, Frame 0002.png and so, there are 739 frames of the video and I want to plot each frame at the point they were recorded. My ultimate goal is to make it so you can click the plot and the picture will appear but ill deal with that part later. Any help is appreciated, thanks! imread MATLAB Answers — New Questions