フィルターのクリア

find the certain region in image

3 ビュー (過去 30 日間)
prashant singh
prashant singh 2017 年 10 月 8 日
コメント済み: Arsalan Akbar 2018 年 7 月 16 日
i have a set of image database. I am providing two images for my query. I want to find the region marked in blue.
However, if the top tip is attached to one of the regions then I want to ignore that image and do nothing.Like this
Some thoughts: I can't use bwconnected components area for those two regions because there are images in DB where tip can be extreme left or right. In those cases, one area is very small and other will be large. That hole can be at different places in different imagesets.
  3 件のコメント
Image Analyst
Image Analyst 2018 年 7 月 12 日
Possibly not since he didn't mark my solution below as accepted. However I still think that my code below would have worked. Did you try it?
Arsalan Akbar
Arsalan Akbar 2018 年 7 月 16 日
No Sir, i have not tried it yet . You are using area filter which returns the biggest blobs but some times the information is missing and 4,5 or some time 6 blobs are in the images . in that case this code may not work fine . and may be that is why he is not using your code

サインインしてコメントする。

採用された回答

Image Analyst
Image Analyst 2017 年 10 月 8 日
First I'd fill the blobs and call
binaryImage = bwareafilt(binaryImage, 3); % Extract 3 largest blobs.
Then I'd call it again to make sure it's not picking up a small speck, and to make sure if there are 3 blobs that they are of substantial size
binaryImage = bwareafilt(binaryImage, [100, inf]);
Replace 100 with some number that is the number of pixels just below the size you'd expect to the top blob. If, after that you have only two blobs, like you said, ignore that image. However if you have 3 blobs, you can continue. First get the 2 largest ones:
binaryImage = bwareafilt(binaryImage, 2); % Extract 2 largest blobs.
Then I'd get the horizontal profile so that I can identify where the black break in the middle is:
horizontalProfile = sum(binaryImage, 1);
plot(horizontalProfile , 'b-', 'LineWidth', 2);
grid on;
Find the centroid of the dark region
props = regionprops(horizontalProfile > 0, 'Centroid');
xCentroid = props.Centroid(1);
yCentroid = props.Centroid(2);
Now scan down line by line finding, by using the find() function, where is the edge of the blob to the left and the edge of the blob to the right. See if you can figure that out yourself.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing and Computer Vision についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by