The function is able to read colors as strings ('red', 'green'…etc…) but cannot read modified color vectors like [1 0 0] or [0.6 1 0.2]. If I use this as an input the shape just come out black.
My color triplet is type double.
Here is the line:
img = insertShape(img, 'Line', position(i,:), 'Color', ColMap(c,:), 'LineWidth', w);
position and line width are perfect. ColMap ia a Mx3 matrix double.
What I dont understand is that using the function 'plot' to simply plot a line over an image everything works perfectly including the color. Meaning, the following line works:
line = plot([x1 x2], [y1 y2], 'Color', ColMap(c,:), 'LineWidth', w);
Any idea?
thank you
Best Answer