Matlab logical matrix to C char type
Ältere Kommentare anzeigen
So I have a Black/White only Graphic LCD that I want to feed images to. I choose Bitmap arrays as my image data storage type.
So I have managed to convert an image to 128x64 resolution and made it black and white (only logical 1 and 0) and my matrix looks like this:

I want to convert (automatically for multiple photos/video) these logical values to look like this:

Antworten (1)
I can understand how you generate the 0x00 and 0xFF values from your logical data, but how do you generate the other values from false and true? What are the rules behind the conversion?
For mapping false to 0 and true to 0xFF:
r = rand(5) > 0.5
r2 = zeros(size(r), 'uint8');
r2(r) = intmax('uint8')
2 Kommentare
Mihnea Dumitriu
am 22 Jun. 2021
Bearbeitet: Mihnea Dumitriu
am 22 Jun. 2021
Mihnea Dumitriu
am 22 Jun. 2021
Kategorien
Mehr zu Convert Image Type finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!