# Is there any method to calculate segmentation coefficent automatically according the same size of my boundary area.

1 view (last 30 days)
Ali Zulfikaroglu on 6 Jan 2021
Answered: Srija Kethiri on 30 May 2022
I have a breast mammogram image.
you can see on files , image 1 show boundary of tumour suspicious area(inside red circles)
I made segmentation with using im2bw function and with segmentation coefficient number 0.75
and I got second image.
But when I use 0.63 segmentation coefficient number, I got closer size of in my first image's bounding circles.
But I am trying this every step and every step to get closest size with my bounding size
I mean I am trying many coeefficient number to get closest size of segmentation tumour with the my first image's inside bounding circles size tumour.
How will I calculate coeefficient number automatically or easier way ?
A=im2bw(img,0.75);
figure,imshow(A);
B=im2bw(img,0.63);
figure,imshow(B);

Srija Kethiri on 30 May 2022
Hi Ali,
I am assuming by segmentation coefficient you are referring to the threshold for segmentation
You can use the graythresh() function to find the threshold for segmentation.
X = graythresh(img);
C = im2bw(img,X);
Refer to this documentation to know more about the function graythresh- Global image threshold using Otsu's method - MATLAB graythresh (mathworks.com)
Hope this helps!