The function allows adding multiple "plots" of markers to an image while the command syntax highly similar (with minor changes) to Matlab "plot" command. Our goal is to propose the users a syntax they are used to, but without usage of "plot", which is inappropriate in several use-cases.
The function returns the marked image. This is achieved by wrapping "addMarkerLines2Img" function, and using custom icons (systems fonts can be used also). Both the functionality and the syntax are highly similar to usage of "plot" with a background image, but here plot command itself is not used. The resulting image can be more useful than a figure: it can be saved as image file (of same type and dimensions) via "imwrite" command, added to a video processed stream etc.. To achieve such a functionality with videos using plot command one must present an image in a figure, hold it, draw a plot above it, and get the figure with the "getframe" command. Besides being cumbersome this “modus operandum” will present a figure on screen, and demands usage of "plot" command- which is not supported by embedded compiler, so you will not be able to export your Matlab code to DSP for example. This functions takes care of this issue, while allowing user to use a plot like syntax, most Matlab users are used to. It is worth noting similar functionality is available as part of the Computer Vision Toolbox- but you have to buy it, right? Users can add custom icons, either by creating appropriate masks, and saving those, or by generating mask form images, using the icon2mask utility function. Naturally icon name and symbol must be added to markerStrings and markerIconNames cell arrays.