Finding Connected components to a particular pixel in binary image

Hi,
I have a binary image with many blobs. I want to know all the connected pixels to a particular pixel whose index I know before hand. How do i do that?

回答 (1 件)

KALYAN ACHARJYA
KALYAN ACHARJYA 2017 年 12 月 12 日
編集済み: KALYAN ACHARJYA 2017 年 12 月 12 日

0 投票

% Try following
CC=bwconncomp(binary_image); % Default 8 Pixel connected you can change it by
cc=bwconncomp(binary_image,disired_connected_value);
% For detail visit following link
https://in.mathworks.com/help/images/ref/bwconncomp.html

1 件のコメント

RIshabh Golchha
RIshabh Golchha 2017 年 12 月 12 日
bwconncomp gives me all the connected components. My problem statement is that I have a particular pixel index. I need all the connected components to that pixel.
If I use bwconncomp I will get all the connected pixels and then I will run a for loop and search the blob which contains my desired pixel. This will be computationally expensive. Is there a better way?

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

カテゴリ

ヘルプ センター および File ExchangeImages についてさらに検索

質問済み:

2017 年 12 月 12 日

コメント済み:

2017 年 12 月 12 日

Community Treasure Hunt

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

Start Hunting!

Translated by