Filter löschen
Filter löschen

how to do binary conversion of an image?

1 Ansicht (letzte 30 Tage)
sana saleeme
sana saleeme am 7 Jan. 2016
Kommentiert: Walter Roberson am 8 Jan. 2016
how to do binary conversion of an image?
  4 Kommentare
hemalatha
hemalatha am 8 Jan. 2016
Bearbeitet: hemalatha am 8 Jan. 2016
read the image into an array,that array consists of pixels a=imread("give your imagepath"); now convert the array of pixels into binary by using the inbuilt function dec2bin, binaryvalues=dec2bin(a); now you get the binary values in single column
Walter Roberson
Walter Roberson am 8 Jan. 2016
hemalatha, that is not quite correct. You need
binaryvalues = reshape( (dec2bin(a, 8)-'0').', [], 1);
to get the binary values in a single column (presuming that the image was uint8 data type.)

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by