Znn3bq.jpeg
²é¿´: 718  |  »Ø¸´: 1

CSJ815

гæ (³õÈëÎÄ̳)

[ÇóÖú] Çócircle segment¿ÉÊÓ»¯´úÂë

Çócircle segment¿ÉÊÓ»¯ÊµÏÖ´úÂ룬×îºÃÊÇmatlabдµÄ¡£
»Ø¸´´ËÂ¥

» ÊÕ¼±¾ÌûµÄÌÔÌûר¼­ÍƼö

³ÌÐò

» ²ÂÄãϲ»¶

ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

FMStation

ÖÁ×ðľ³æ (ÖªÃû×÷¼Ò)

¡¾´ð°¸¡¿Ó¦Öú»ØÌû

CODE:
% Demo to write an ellipse into the overlay of an image,
% and then to burn those overlays into the image.

%----- Initializing steps -----
% Clean up
clc;
clear all;
close all;
fontSize = 14;
workspace; % Display the workspace panel.

% Change the current folder to the folder of this m-file.
if(~isdeployed)
        cd(fileparts(which(mfilename)));
end

hasIPT = license('test', 'image_toolbox');
if ~hasIPT
        % User does not have the toolbox installed.
        message = sprintf('Sorry, but you do not seem to have the Image Processing Toolbox.\nDo you want to try to continue anyway?');
        reply = questdlg(message, 'Toolbox missing', 'Yes', 'No', 'Yes');
        if strcmpi(reply, 'No')
                % User said No, so exit.
                return;
        end
end

% Display images to prepare for the demo.
monochromeImage = imread('pout.tif');
subplot(2, 3, 1);
imshow(monochromeImage);
title('Original Image', 'FontSize', fontSize);
subplot(2, 3, 2);
imshow(monochromeImage);
title('Draw ellipse in overlay here', 'FontSize', fontSize);
set(gcf, 'units','normalized','outerposition',[0 0 1 1]); % Maximize figure.
set(gcf,'name','Image Analysis Demo of imellipse() function','numbertitle','off')

%----- Burn ellipse into image -----
% Create elliptical mask, h, as an ROI object over the second image.
subplot(2, 3, 2);
userPrompt = sprintf(' Click and drag out an ellipse.\nDouble click inside of it to accept it.');
uiwait(msgbox(userPrompt));
hEllipse = imellipse(gca); % Second argument defines ellipse shape and position.
% Wait for user to finalize the size and location.
xyCoordinates = wait(hEllipse)

% Create a binary image ("mask") from the ROI object.
binaryImage = hEllipse.createMask();
% Display the ellipse mask.
subplot(2, 3, 3);
imshow(binaryImage);
title('Binary mask of the ellipse', 'FontSize', fontSize);

% Burn white ellipse into image by setting it to 255 wherever the mask is true.
outputImage = monochromeImage; % Re-initialize it.
outputImage(binaryImage) = 255;
% Display the image with the "burned in" ellipse.
subplot(2, 3, 4);
imshow(outputImage);
title('New image with ellipse burned into image', 'FontSize', fontSize);

% Burn black ellipse into image by setting it to 0 wherever the mask is true.
outputImage = monochromeImage; % Re-initialize it.
outputImage(binaryImage) = 0;
% Display the image with the "burned in" ellipse.
subplot(2, 3, 5);
imshow(outputImage);
title('New image with ellipse burned into image', 'FontSize', fontSize);

% Erase image outside of ellipse into image by setting it to 0 wherever the mask is true.
outputImage = monochromeImage; % Re-initialize it.
outputImage(~binaryImage) = 0;
% Display the image with the "burned in" ellipse.
subplot(2, 3, 6);
imshow(outputImage);
title('Image erased outside of ellipse', 'FontSize', fontSize);

2Â¥2016-10-09 23:12:39
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
Ïà¹Ø°æ¿éÌø×ª ÎÒÒª¶©ÔÄÂ¥Ö÷ CSJ815 µÄÖ÷Ìâ¸üÐÂ
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[¿¼ÑÐ] 272·Ö²ÄÁÏ×ÓÇóµ÷¼Á +40 Loy0361 2026-04-10 52/2600 2026-04-12 19:23 by laoshidan
[¿¼ÑÐ] µ÷¼ÁÇóÊÕÁô +28 ¹ûÈ»ÓÐÎÒ 2026-04-10 29/1450 2026-04-12 17:56 by ÓôÓô·Æ·Æ
[¿¼ÑÐ] 0856ר˶Çóµ÷¼Á Ï£ÍûÊÇaÇøÔºÐ£ +22 ºÃºÃÐÝÏ¢ºÃ²»ºÃ 2026-04-09 25/1250 2026-04-12 17:09 by ajpv·çÀ×
[¿¼ÑÐ] 295·ÖÇóµ÷¼Á +13 ?ÒªÉϰ¶? 2026-04-10 13/650 2026-04-12 15:37 by laoshidan
[¿¼ÑÐ] 279Çóµ÷¼Á +8 ÕÅ·¬ÇѲ»³´µ° 2026-04-11 8/400 2026-04-12 12:28 by wp06
[¿¼ÑÐ] 086000µ÷¼Á +6 Ê®Æßsa 2026-04-07 6/300 2026-04-12 11:05 by ´óÁ¦Ë®ÊÖÁ¦´óÎÞÇ
[¿¼ÑÐ] 316Çóµ÷¼Á +5 Ïë¶ÁÑо¿Éú( ?¡ß 2026-04-07 5/250 2026-04-12 00:43 by À¶ÔÆË¼Óê
[¿¼ÑÐ] 332Çóµ÷¼Á +14 ½¶½¶123 2026-04-10 14/700 2026-04-12 00:27 by À¶ÔÆË¼Óê
[¿¼ÑÐ] 0860004 Çóµ÷¼Á 309·Ö +9 Yin DY 2026-04-08 9/450 2026-04-11 22:55 by dongdian1
[¿¼ÑÐ] »¯Ñ§308·ÖÇóµ÷¼Á +22 ÄãºÃÃ÷ÌìÄãºÃ 2026-04-07 24/1200 2026-04-11 11:14 by ChemPharm
[¿¼ÑÐ] ÉúÎïѧµ÷¼Á ¿Éµ÷¼Áµ½ÉúÎïÓëÒ½Ò© +8 ÀîÕþÓ¨ 2026-04-06 9/450 2026-04-11 10:36 by wwj2530616
[¿¼ÑÐ] 293Çóµ÷¼Á +6 ÓÂÔ¶¿â°®314 2026-04-08 6/300 2026-04-11 10:08 by zhq0425
[¿¼ÑÐ] 085402ͨÐŹ¤³Ìµ÷¼Á£¬ÓÐ4Ïîѧ¿Æ¾ºÈü¹ú½±£¨µçÈü¹ú¶þ£©£¬Ë¶Ê¿Ñо¿Éúµ÷¼Á×Ô¼öÐÅ¡£ +5 mÓÀo²»vÑÔoÆúm 2026-04-09 5/250 2026-04-11 09:33 by zhq0425
[¿¼ÑÐ] »¯Ñ§¹¤³ÌÓë¼¼Êõ324µ÷¼Á +23 Ëï³£»ª 2026-04-09 25/1250 2026-04-11 00:07 by ÆïÅ£¶Éº®½­
[¿¼ÑÐ] ²ÄÁÏרҵ344Çóµ÷¼Á +16 hualkop 2026-04-10 21/1050 2026-04-10 17:28 by laoshidan
[¿¼ÑÐ] 314Çóµ÷¼Á +23 wakeluofu 2026-04-09 24/1200 2026-04-10 15:31 by MOF_Catal
[¿¼ÑÐ] ²ÄÁϵ÷¼Á +5 hzhahg 2026-04-06 5/250 2026-04-10 10:10 by may_ÐÂÓî
[¿¼ÑÐ] »úе¹¤³Ì313·ÖÕÒ¹¤¿Æµ÷¼Á +3 ˫һÁ÷±¾¿Æ»úе 2026-04-08 3/150 2026-04-08 20:41 by ÍÁľ˶ʿÕÐÉú
[¿¼ÑÐ] Ò»Ö¾Ô¸211£¬»¯Ñ§Ñ§Ë¶£¬310·Ö£¬±¾¿ÆÖصãË«·Ç£¬Çóµ÷¼Á +10 ŬÁ¦·Ü¶·112 2026-04-07 10/500 2026-04-08 15:01 by screening
[¿¼ÑÐ] 281Çóµ÷¼Á +10 Ò¬×ÓÄ¢¹½ 2026-04-06 10/500 2026-04-08 11:43 by zzucheup
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û