필터 지우기
필터 지우기

how to connect the label region?how regionprops work?

조회 수: 1 (최근 30일)
Tan Wen Kun
Tan Wen Kun 2015년 11월 5일
답변: Walter Roberson 2015년 11월 6일
a = imread('apple.jpg');
b = rgb2gray(a);
BW = edge(b,'canny');
L = bwlabel(BW);
s = regionprops(BW,'centroid');
centroids = cat(1, s.Centroid);
imshow(BW)
hold on
plot(centroids(:,1),centroids(:,2), 'b*')
hold off
The image is just a red apple with white background.
What I want to do is to segment the apple
I want to connect label region together to form the apple again.
How to do it?
What does the regionprops doing?

채택된 답변

Walter Roberson
Walter Roberson 2015년 11월 6일
The regionprops is just taking in the label matrix and calculating the centroids of each region. That does not have any apparent connection to connecting the label regions together to form the apple again.

추가 답변 (0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by