Solved with calc_circle code
https://kr.mathworks.com/matlabcentral/newsreader/view_thread/165185
Select 3 point on edge (2 Lowest point with extreme right and left side and 1 highest point on right side) and use this code
Of course it is not precise method, but error is negligible for me. (error in 10 pixel scale.)
I = imread(image);
%Detect Entire Cell
[~, threshold] = edge(I,'sobel');
fudgeFactor = .8;
BWs = edge(I,'sobel',threshold*fudgeFactor);
%Dilate the image
se90 = strel('line',3,90);
se0 = strel('line',3,0);
BWsdil = imdilate(BWs,[se90 se0]);
[B,L,N] = bwboundaries(BWsdil,4,'holes');
figure;
imshow(BWsdil);
axis equal;
hold on;
for k = 1 : length(B),
boundary = B{k};
if(k > N)
plot(boundary(:,2), boundary(:,1), 'g', 'LineWidth', 2);
else
plot(boundary(:,2), boundary(:,1), 'r', 'LineWidth', 2);
end
end
[y,x] = find(BWsdil);
table(:,1) = x; % making table array
table(:,2) = y;
yyy = max(y);
exp1 = table(table(:,2)==yyy); % lowest position on image
pp1 = min(exp1); % end of left side
pp3 = max(exp1); % end of right side
tablefor3rd = table(:,1) > 2000; % X coordinate over 2000
extracted = table(tablefor3rd,:); % rows with X coordinates over 2000
maxiy = min(extracted(:,2)); % highest position
list = extracted(:,2) == maxiy; % point list with highest point
list2 = extracted(list,:);
maxix = max(list2(:,1));
p1 = [pp1,yyy];
p2 = [maxix,maxiy];
p3 = [pp3,yyy];
[c r] = calc_circle(p1, p2, p3);
axis equal
hold on
if r == -1
disp('COLLINEAR')
else
rectangle('Position', [c(1)-r,c(2)-r,2*r,2*r],...
'Curvature', [1,1], 'EdgeColor', 'g')
end
plot(p1(1), p1(2), '*')
plot(p2(1), p2(2), '*')
plot(p3(1), p3(2), '*')