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.
引用格式
Nikolay S. (2024). implot- image plot (https://www.mathworks.com/matlabcentral/fileexchange/37730-implot-image-plot), MATLAB Central File Exchange. 检索时间: .
MATLAB 版本兼容性
平台兼容性
Windows macOS Linux类别
- MATLAB > Graphics > Formatting and Annotation > Labels and Annotations > Annotations >
- Image Processing and Computer Vision > Image Processing Toolbox > Image Filtering and Enhancement > Image Arithmetic >
- MATLAB > Graphics > 2-D and 3-D Plots > Line Plots > Change Markers >
标签
致谢
参考作品: Pack & Unpack variables to & from structures with enhanced functionality, Plot on an image- addMarkerLines2Img
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!