필터 지우기
필터 지우기

How to find the position of the objects after using bwlabel?

조회 수: 2 (최근 30일)
oshawcole
oshawcole 2019년 4월 23일
답변: Walter Roberson 2019년 4월 23일
So, I want to identify the type of cells. If the cell is green and blue, it has to be categorized as type A. And if the cell is Red and blue it has to be categorized as Type B. I was able to separate these cells as R, G, and B. But I don't know how should I proceed? For example, in this picture, I got two cells in R and six cells in B, but I want to find a way so that if R and B both are present in the detected object then it is Type B cell. This is what I have done for identifying the blue objects.
Thank you in advance.
b=img(:,:,3)-mean(mean(img(:,:,3)));
b=b>100;
b= bwareaopen(b, 100);
[labeledImage_b, numberOfObject_b] = bwlabel(b); %finding the number of blue objects
Image source: Vortex Biosciences

답변 (1개)

Walter Roberson
Walter Roberson 2019년 4월 23일
You can call regionprops() on labeled images to get information about things like bounding box.
However, if you are not planning to use the label information afterwards, it is more efficient to just pass teh binary image to regionprops() instead of labeling and passing the label image.
You can construct several binary images and AND them together to locate regions that have multiple color components.

카테고리

Help CenterFile Exchange에서 Image Segmentation and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by