MATLAB Image processing filtering

2 ビュー (過去 30 日間)
Rusty 2016 年 1 月 15 日
編集済み: Rusty 2016 年 1 月 17 日
One sample image is .Download the file and name it as
My code is
Now here , I am getting two regions, one the small area (1) and the other as the big one (2)


Walter Roberson
Walter Roberson 2016 年 1 月 15 日
bwareafilt() if you have a newer MATLAB. If not then regionprops() 'Area' and select only the smaller of the two regions.
  3 件のコメント
Rusty 2016 年 1 月 15 日
Actually I am new to image processing. I also tried image dilation and image erosion but I failed. Could you please help me more?


その他の回答 (2 件)

Image Analyst
Image Analyst 2016 年 1 月 15 日
For that particular image, you can use
labeledImage = bwlabel(binaryImage);
smallBlob = ismember(labeledImage, 2) > 0;
In general somehow you have to identify the blob you want, then use ismember() to extract it. For this one, I know that you have only 2 blobs and that the small inside one will be blob #2 because of the way it does labeling. But in general (like your second image), you may have to use regionprops() to get other measurements to identify the particular blob(s) you want, and then use ismember(). See my Image Segmentation Tutorial for examples of that where I pick out different coins in the image.
You may also want to learn about bwareafilt() or bwselect().
  7 件のコメント
Rusty 2016 年 1 月 16 日
Sir, I have posted the new image ( in which I am facing problem). Please have a look at it. Thanks


harjeet singh
harjeet singh 2016 年 1 月 16 日
try to use this code for these type of image, but not for every slice
clear all
close all
img3=img2 & ~img1;
img5=img4 & ~img3;
  3 件のコメント
Rusty 2016 年 1 月 16 日
Actually I did something else. YOu can see a video of my simulation: at I use the methods told by imageAnalyst in his tutorials. Could you please help me solving this algorithm using watershed?


Community Treasure Hunt

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

Start Hunting!

Translated by