How to find the position of the objects after using bwlabel?
2 ビュー (過去 30 日間)
古いコメントを表示
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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/215612/image.jpeg)
Image source: Vortex Biosciences
0 件のコメント
回答 (1 件)
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.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Image Segmentation and Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!