how to fix funtion imbinarize error ?

what did I do wrong and how to fix it?

3 Comments

my code:
clc;clear; %
%read image
I = imread('test1.jpg');
figure
imshow(I)
title('Original Image')
BW = imbinarize(I,'adaptive','ForegroundPolarity','dark','Sensitivity',0.4)
figure
imshow(BW)
title('Binary Version of Image')
Command window:
Warning: Image is too big to fit on screen; displaying at 33%
> In images.internal.initSize (line 71)
In imshow (line 336)
In imbinarize (line 11)
Attempt to execute SCRIPT imbinarize as a function:
G:\LAB\MATLAB code ImageProcessing\testing code\imbinarize.m
Error in imbinarize (line 14)
BW = imbinarize(I,'adaptive','ForegroundPolarity','dark','Sensitivity',0.4)
There is a function in your folder named imbinarize. YOu want to use the inbuilt function right?
Leon Phung
Leon Phung on 11 Jun 2018
Edited: KSSV on 11 Jun 2018
yes, I was trying to convert an image to 2-D binary so I can use it for finite element and others post processing later on.
I was trying to use the function imbinarize https://www.mathworks.com/help/images/ref/imbinarize.html

Sign in to comment.

 Accepted Answer

KSSV
KSSV on 11 Jun 2018
YOu need to rename the script/ file named as imbinarize which is present in the folder.

More Answers (0)

Categories

Find more on Convert Image Type in Help Center and File Exchange

Products

Release

R2018a

Tags

Asked:

on 11 Jun 2018

Edited:

on 11 Jun 2018

Community Treasure Hunt

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

Start Hunting!