how can change pixcle value to binary in matlab and write its bit in what variable?

I want to change my pixel values to binary . and i want to keep its binary value in a variable how can change it to binary and how can put it in a variable can i put it in an array with 8 index

Answers (2)

See dec2bin(), which converts to string. If you want numeric form,
dec2bin(Value,8) - '0'
Perhaps you mean
thresholdValue = 128; % or whatever value you want/need.
binaryImage = grayScaleImage > thresholdValue;
Why don't you just attach your image and tell us what you want to measure or do to it?

This question is closed.

Asked:

on 29 Dec 2013

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!