MATLAB: This demo isn´t working for the image

binarizationdemo_scriptimage analyst demoImage Processing Toolboxthreshold

Dear all,
I tried use this demo by Image Analyst, but for my image I wasn´t successful. Instead of cameraman.tif I gave my image thorax-mdl.jpg, which I attached. I have this error message in Command Window:
Error using imageDisplayValidateParams>validateCData (line 121)
If input is logical (binary), it must be two-dimensional.
Error in imageDisplayValidateParams (line 31)
common_args.CData = validateCData(common_args.CData,image_type);
Error in imageDisplayParseInputs (line 79)
common_args = imageDisplayValidateParams(common_args);
Error in imshow (line 198)
[common_args,specific_args] = ...
Error in DP (line 86)
imshow(binaryImage, []);
Can anyone give me advice? Thank you for your answers.

Best Answer

You forgot to attach your code. You must have modified a demo of mine somehow and made a new script called DP.m. Evidently the code is expecting a binary image - a 2D logical image - and you're not giving it that. Maybe you're giving it a color image or something. But I can't tell because you didn't supply your code modifications. Please attach your image and DP.m and anything else we need to run your code.
Related Question