How to convert black and white image to a matrix 100 x 100 ?
Afficher commentaires plus anciens
Dear all, I have a black and white image that I want to read it as a matrix of size 100 x 100, I need the elements of the matrix to be 1 for black pixels and -1 for the white pixels, could any one help me in how to have the size of the matrix to be 100 x 100 and its elements 1 and -1? thank you
Réponses (1)
Andrei Bobrov
le 16 Oct 2015
c = [1 0 0 1 1 1 0 1 0 0]
out = ~c*2-1
1 commentaire
sali
le 16 Oct 2015
Modifié(e) : Andrei Bobrov
le 17 Oct 2015
Catégories
En savoir plus sur Convert Image Type dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!