Compressing a logical array into a bit-wise boolean representation

조회 수: 17 (최근 30일)
Matt J
Matt J 2013년 10월 15일
댓글: Matt J 2013년 10월 15일
Standard MATLAB logical arrays use 1 byte to represent each boolean element in the array. However, I seem to remember coming across a way, maybe in the Image Processing Toolbox, to convert a logical array to a representation that uses only 1 bit per boolean. My recollection is fuzzy, but can anyone recognize what I'm referring to and, if so, point me to the appropriate doc?

채택된 답변

Sukuchha
Sukuchha 2013년 10월 15일
may be bwpack is function you are looking.
from help.
BWP = bwpack(BW) packs the uint8 binary image BW into the uint32 array BWP, which is known as a packed binary image. Because each 8-bit pixel value in the binary image has only two possible values, 1 and 0, bwpack can map each pixel to a single bit in the packed output image.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by