How to segment a region or cluster from an image after k mean clustering

3 views (last 30 days)
I need to extract some of the cysts and tumor regions from the the images. I have tried k means clustering and i am able to segment that regions. but ineed only that regions and disable other clusters. In Labeled.PNG , the black hole is the cyst.
Any help is appreciated

Answers (1)

Shubham
Shubham on 29 Feb 2024
Hello Mino,
If you have already performed k-means clustering on your image and have successfully segmented the cyst and tumor regions, you can extract these regions by isolating the specific cluster(s) that represent them. Assuming you have a label matrix where each pixel is assigned to a cluster, you can proceed as follows:
  1. Analyze the resulting clusters to identify which ones correspond to the cysts and tumor regions. This identification can be done by examining the properties of the clusters such as their location, size, shape, or intensity. The cluster(s) that represent the cysts and tumors are noted for further processing.
  2. For each identified cluster that corresponds to a cyst or tumor, create a binary mask. This is a matrix where pixels belonging to the target cluster are set to 1 (true), and all other pixels are set to 0 (false). The binary mask effectively isolates the region of interest from the rest of the image.
  3. Multiply the original image by the binary mask to extract the regions of interest. Since the mask contains zeros for all non-relevant regions, those areas will be blacked out, leaving only the cysts and tumor regions visible.
  4. Depending on the application, additional post-processing steps may be applied to the extracted regions. This could include morphological operations to clean up the edges, fill holes, or separate connected components.
  5. Use the extracted regions for further analysis, such as measuring their area, perimeter, or other morphological features. The regions can also be used in other stages of the image processing pipeline or saved for documentation and review.

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!