Separating a group of higher intensity pixels in an image
이전 댓글 표시
I have an binary image in which only a particular group of pixels are my area of interest. I want to separate these higher intensity group of pixels in a new figure of want to differentiate them with a different color. How can I do it? Please have a look at the link for clarification
답변 (3개)
Sean de Wolski
2011년 3월 19일
I would do an:
cirx = imfill(bw, 'holes');
on your circles. Then do a logical AND on this to get the areas inside the circles that are also white. Then maybe bwlabel to color them. I.e:
both = BW&cirx;
L = bwlabel(both);
imshow(label2rgb(L));
Sean de Wolski
2011년 3월 20일
Then use:
bwareaopen
to remove small blobs.
댓글 수: 6
Niranjan
2011년 3월 20일
Niranjan
2011년 3월 20일
Sean de Wolski
2011년 3월 20일
what is the result when you type:
size(BW);
is it [something, something, 3]?
Niranjan
2011년 3월 20일
Niranjan
2011년 3월 20일
Sean de Wolski
2011년 3월 20일
So you have all 3-dimensions of your rgb image binarized.
The easiest way to view it would just be to do:
imshow(uint8(bwAreaOpenBW)*255);
But I get the feeling that you're not understanding everything going on under the hood. Do you want a convert your rgb image to gray scale and then do the logical/morphological operations on them? Do you want to binarize all three dimensions (as you have) and then come up with some criteria based on that e.g. if true in two planes leave true, else no. Etc....
pratibha rane
2013년 4월 10일
0 개 추천
Code: BW = imread('E:\ProjectCode\45.jpg');%Binary image BW2 = bwareaopen(BW, 24); figure,imshow(BW2)
Error: Error using ==> imageDisplayParseInputs>validateCData at 291 If input is logical (binary), it must be two-dimensional.
I want to highlight only object area with white color
카테고리
도움말 센터 및 File Exchange에서 Image Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!