i am getting error in line 35

RGB =imread('mammogram.jpg');
hsv=rgb2hsv(RGB);
imshow(hsv);
i= 0:20:240;
r1=0.1;
r2=0.85;
s= 0.8;
wgray1= 1-s.^(r1*(255./i).^r2);
i= 0:20:240;
r1= 0.1;
r2=0.85;
s=0.0;
wgray2= 1-s.^(r1*(255./i).^r2);
i= 0:20:240;
r1=0.1;
r2=0.85;
s=0.2;
wgray3= 1-s.^(r1*(255./i).^r2);
i= 0:20:240;
r1=0.1;
r2= 0.85;
s=0.4;
wgray4= 1-s.^(r1*(255./i).^r2);
i= 0:20:240;
r1=0.1;
r2=0.85;
s=0.6;
wgray5= 1-s.^(r1*(255./i).^r2);
i= 0:20:240;
r1=0.1;
r2=0.85;
s=1.0;
wgray6= 1-s.^(r1*(255./i).^r2);
level = graythresh(wgray1+wgray2+wgray3+wgray4+wgray5+wgray6);
BW= im2bw(level,wgray1+wgay2+wgray3+wgray4+wgray5+wgray6); *line 35*
imshow(BW);

Answers (1)

Walter Roberson
Walter Roberson on 29 Jan 2016
im2bw() needs the parameters in the other order, image first and level second.

1 Comment

Please mark the Answer as Accepted if the question is solved.

Sign in to comment.

Products

Asked:

on 29 Jan 2016

Commented:

on 29 Jan 2016

Community Treasure Hunt

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

Start Hunting!