1

I have written some lines of code using the following function:

adaptivethreshold(IM,ws,c)

and it gives me a Mask bw. I multiply this mask with my original image bb and show the result.

clear
clc
bb=dicomread('30421573');
figure(1)
imagesc(bb)
bw=adaptivethreshold(bb,50,128);
imaa=double(bw).*double(bb);
figure(2)
image(imaa)

the original Image and the result are shown: enter image description here enter image description here

It does not seem to be giving me any mask for my image. Is there any way I can extract those yellow parts from my results?

Cris Luengo
  • 55,762
  • 10
  • 62
  • 120
sn at
  • 61
  • 7
  • Are you using [this File Exchange function](https://www.mathworks.com/matlabcentral/fileexchange/8647-local-adaptive-thresholding)? That would be important to mention in your question. The Image Processing Toolbox has [`adaptthresh`](https://www.mathworks.com/help/images/ref/adaptthresh.html), which is significantly different. – Cris Luengo Nov 01 '19 at 21:18

1 Answers1

0

Try to create the mask before applying to the image, i.e.

bw=adaptivethreshold(bb,50,128);
BW = imbinarize(bb,bw);
imaa=double(bw).*double(BW);
figure(2)
image(imaa)
gep
  • 93
  • 1
  • 7
  • This would be true if OP used `adaptthresh` from the Image Processing Toolbox. But it is not clear which function OP actually uses, see [my other comment](https://stackoverflow.com/questions/58664133/image-segmentation-in-matlab-using-adaptive-threshold-function#comment103635065_58664133). – Cris Luengo Nov 01 '19 at 21:20