remove small blob by orientation
1 回表示 (過去 30 日間)
古いコメントを表示
hi i have some square image and due to lighting condition i have some glare due to fluorescence so after some succes in binarization i remained some small blob i want to remove it if the shape in 0 so easily removed but i want to use the shape orientation for opening the small blob , i i use different strel like circle it will destroy the corners of the rectangle . as you see i added the reflctions in the table.
se=strel('line',200,0);
bwopenenedImage = imopen(bw,se);
the issue is the rectangle can be rotated a little , so i calculate the orientation of the shape
stats=regionprops(bw,'Area','Orientation');
Orientation: -2.8061
but if i doe strel line with this angle it is not good for me , maybe i need to quintize the angle to 4 : 0,45,90,135 ? anyway regionprops give the angle from -90 to 90 but strel line 0-360 ?
so the line wont be good for image opening
0 件のコメント
回答 (1 件)
Image Analyst
2014 年 10 月 1 日
The best thing is to just avoid the specular reflections in the first place. It looks like you can use crossed polarizers for that. It's a very very common trick in photography to remove shine and reflections. Can you do that?
The main axis of a rectangle, according to regionprops which fits an ellipse to it, is not along the long edge. Of course going along the diagonal is longer so the major axis is along that and that is what your orientation angle will reflect. I did give some rotation demo here: http://www.mathworks.com/matlabcentral/answers/154523-calculate-and-crop-image-based-on-coordinates#answer_151500. But it looks like if you have a rectangle with some little bumps/protrusions out of it, then morphological methods will smooth out or eliminate all bumps, even corners. If you need a perfect rectangle you may have to find the corners and create a perfect rectangle from those.
See attached demo to find the furthest points in a binary blob.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で 3-D Volumetric Image Processing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!