필터 지우기
필터 지우기

how to fill the cells?

조회 수: 4 (최근 30일)
Sarah Nasra
Sarah Nasra 2021년 11월 5일
답변: Sahil Jain 2021년 11월 17일
i want to fill the cells so i used the function "imfill" but because the borders of the cells not completed 100%, not all the cells filled.
A = imread("ניסוי1 חתוך.tif","tif");
A=rgb2gray(A);
t = 0.64;
BW1 = imbinarize(A,t);
BW2 = bwareaopen(BW1,50);
BW3 = medfilt2(BW2);
BW4 = imfill(BW3,'holes');
figure; imshow(BW4); title("after");
in the file there a pic that summrize what i mean.

답변 (1개)

Sahil Jain
Sahil Jain 2021년 11월 17일
Hi Sarah. You can try using the "morphological close" operation to close the cells before filling. You may need to experiment with the size of the structuring element for your use case.
A = imread("ניסוי1 חתוך.tif","tif");
A=rgb2gray(A);
t = 0.64;
BW1 = imbinarize(A,t);
BW2 = bwareaopen(BW1,50);
BW3 = medfilt2(BW2);
se = strel('disk',20);
BW4 = imclose(BW3,se);
BW5 = imfill(BW4,'holes');
figure; imshow(BW5); title("after");

카테고리

Help CenterFile Exchange에서 Tables에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by