Replace elements in binary matrix

3 ビュー (過去 30 日間)
Abdul Salam
Abdul Salam 2019 年 6 月 29 日
コメント済み: Abdul Salam 2019 年 6 月 29 日
I have a binary image and want to replace all the zeroes with 1s and all the 1s with zeroes. ( so that the binary image is totally opposite to original image). How can i do that?

採用された回答

Michal
Michal 2019 年 6 月 29 日
編集済み: Michal 2019 年 6 月 29 日
% B original binary matrix
% B_ new binary matrix
B_ = ~B;
  1 件のコメント
Abdul Salam
Abdul Salam 2019 年 6 月 29 日
Thanks

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

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2019 年 6 月 29 日
B_ = imcomplement(B);

カテゴリ

Help Center および File ExchangeRead, Write, and Modify Image についてさらに検索

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by