필터 지우기
필터 지우기

I want to draw a boundary around the bubble shown in the image.

조회 수: 1 (최근 30일)
Tajinder Singh
Tajinder Singh 2018년 1월 22일
답변: Hardik Madhok 2018년 1월 23일
I cannot use bwboundaries, because it is not able to distinguish the bubble from the rest of the image. Please provide me a method to find the boundary of this bubble.

답변 (1개)

Hardik Madhok
Hardik Madhok 2018년 1월 23일
clear all close all clc
img = imread('Test.jpg'); figure imshow (img); drawnow
img = rgb2gray(img); img_1 = histeq(img); img_2 = im2bw(img_1); figure imshow (img_2) drawnow
[B,L,N] = bwboundaries(img_2) imshow(img_2); 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
try this i am not sure about which bubble you want to extract but this code makes all the boundaries do check and delete the unwanted areas

Community Treasure Hunt

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

Start Hunting!

Translated by