Replace elements in binary matrix

4 vues (au cours des 30 derniers jours)
Abdul Salam
Abdul Salam le 29 Juin 2019
Commenté : Abdul Salam le 29 Juin 2019
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?

Réponse acceptée

Michal
Michal le 29 Juin 2019
Modifié(e) : Michal le 29 Juin 2019
% B original binary matrix
% B_ new binary matrix
B_ = ~B;

Plus de réponses (1)

Walter Roberson
Walter Roberson le 29 Juin 2019
B_ = imcomplement(B);

Catégories

En savoir plus sur Read, Write, and Modify Image dans Help Center et File Exchange

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by