I have detected some objects on images from a sequence. For each frame ik I saved:
IMG(ik,:)={centers, radii, metric, ik};
where centers is a n*2 array containing the 2D coordinates of the n circles I detected, radii is the values or their respective radii, metrics provides an info on the "quality" of this detection.
I would like to plot all these circles at once, on one image (which colormap is "gray"), with the color of these circle to correspond to the timestep (i.e. the value of ik). To do so I do the following:
figure(2001)
imagesc(averageIMG)
axis equal
colormap(gray)
hold on
cmap=jet(imgend-imgstart+1);
for ik = 1:length(IMG)
centers = IMG{ik,1};
radii = IMG{ik,2};
viscircles(centers,radii,'Color',cmap(ik,:));
hold on
end
How can I plot a colorbar (with a jet colormap) that corresponds to the colors of the circles as an image of the timestep ik?
Note: I need to keep the colormap "gray" for the image that I use as a background of this plot.
Thank you for your help!