Conversion of grayscale to binary Image

7 ビュー (過去 30 日間)
ANUSHA H P
ANUSHA H P 2022 年 1 月 17 日
編集済み: ANUSHA H P 2022 年 1 月 21 日
when a dataset containing gray scale images are converted to binary images , few images are getting complemented i.e, few images with black as background and few with white as background.
I want all images to be in a uniform way, black background and white foreground.
how to use imcomplement() for selected images in a datasset? or is there anyother way?
i have attached few sample input and their corresponding binary images from the dataset.
Thankyou in advance

採用された回答

Image Analyst
Image Analyst 2022 年 1 月 17 日
There is an option for that in imbinarize to make sure you always get either the brighter thing or the darker thing:
BW = imbinarize(grayImage,'adaptive','ForegroundPolarity','dark','Sensitivity',0.4);
  8 件のコメント
Image Analyst
Image Analyst 2022 年 1 月 20 日
If you want the shape to better hug/follow the binary image, instead of using the convex hull, you could fill the blobs and use activecontour. See attached demo.
ANUSHA H P
ANUSHA H P 2022 年 1 月 21 日
編集済み: ANUSHA H P 2022 年 1 月 21 日
yes sir, it was of grt help ,thankyou.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeometric Transformation and Image Registration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by