Clear Filters
Clear Filters

Why insertMarker or plot command is not working in binary image?? getting error as "Error in insertMarker (line 73) validateAn​dParseInpu​ts(I, position, varargin{:});"

4 views (last 30 days)
both the commands work in gray scale image but it does not work in binarized image...Any idea how to achieve this?

Accepted Answer

Amy on 12 Dec 2017
In the documentation for 'insertMarker', it says that the function expects the image input to be one of these types: uint8, uint16, int16, double, or single. A binary image is stored as a logical array, so is not a valid input.
You can always convert your binary image into one of the supported data types and use that as input to the 'insertMarker' function (using the 'single' function, for example). If you wanted to, you could also convert the output back into a binary image afterwards (with the 'logical' function).

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!