フィルターのクリア

how to draw ellipse in image processing for finding border irregularity?

19 ビュー (過去 30 日間)
joynob ahmed
joynob ahmed 2020 年 3 月 8 日
編集済み: joynob ahmed 2020 年 3 月 14 日
hi,i am working for image prcessing to find melanoma.for this,i have to find out the border irregularity.So i needed the cpde for drawing an ellipse with the centroid i found before. Please help me out.

回答 (2 件)

Ameer Hamza
Ameer Hamza 2020 年 3 月 8 日
It gives you the option to interactively draw the ellipse, or you can even draw it programmatically by providing the center of the ellipse, length of its axis, and rotation angle. For example,
drawellipse(ax, 'Center',[500,500],'SemiAxes',[200,100],'RotationAngle',90);
ax is the axis on which the image is drawn. The center and axis lengths are in pixels, whereas RotationAngle is in degrees.
  1 件のコメント
joynob ahmed
joynob ahmed 2020 年 3 月 10 日
Sorry,i didn't understand your code. Can you please give me the code for finding border irregularity?

サインインしてコメントする。


Image Analyst
Image Analyst 2020 年 3 月 10 日
If you want to manually draw an ellipse, see this code:
[rows, columns, numberOfColorChannels] = size(rgbImage);
mask = true(rows, columns); % Initialize so we'll have something in case an error is thrown.
hFig = figure;
imshow(rgbImage);
hFig.WindowState = 'maximized';
h = uicontrol('Position',[20 620 200 40],'String','Accept', 'FontSize', 12, 'FontWeight', 'bold', ...
'Callback','uiresume(gcbf)');
userPrompt = sprintf('Please draw out an ellipse.\nClick the Accept button to the left when done.');
msgboxw(userPrompt);
caption = sprintf('Please draw out an ellipse.  Close the window when done.');
title(caption, 'FontSize', 14);
% Have the user interactively drag out the ellipse and adjust its size and position.
roi = drawellipse();
xy = roi.Vertices;
% Quirky other stuff needed to let the user adjust the ellipse and get back the xy coordinates.
% The listener updates xy in the base workspace when the user changes the ellipse.
addlistener(roi, 'ROIMoved', @(src,evt) assignin('base','xy',src.Vertices));
uiwait(hFig);
xy = evalin('base', 'xy'); % Get the xy coordinates from the base workspace.
mask = poly2mask(xy(:, 1), xy(:, 2), rows, columns);
imshow(mask);
drawnow;
close(hFig);
See this to draw ellipses over segmented blobs: Steve Eddins Image Processing Blog
Once you have xy (the coordinates of the ellipse), you can use sqrt() to find the distance from the actual boundary from bwboundaries() to the ellipse. Then get the mean of all those distances.
But, why not just take the blob as it is? Why have the user draw an ellipse? You might be able to use the solidity from regionprops as a relevant metric for border irregularity.
  1 件のコメント
joynob ahmed
joynob ahmed 2020 年 3 月 14 日
編集済み: joynob ahmed 2020 年 3 月 14 日
I have drawn an ellipse from Steve Eddins blog.How can i compare this(image no-11) with my actual image(image no-5) to get border irregularity? have attached my resultant image.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeBiotech and Pharmaceutical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by