Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!

Problem 898. AVIRIS Hyperspectral Bit Mask

Created by Richard Zapor

The AVIRIS data sometimes is provided uncropped. This creates edge regions with values of "-50". Shown is AVIRIS Moffett Field image Layer 1 (400nm) and a zoom of the top-right corner. The dark blue on the edges is non-imaged ground.

To expedite processing a mask can be employed. For compression a bit mask is applicable. The challenge is to create a bit mask for this image and some other test cases.

Input: m ( 2-D uint16 array with zero and non-zero values )

Output: bmv (uint8 bit map vector with 0s at a==0 and 1s for a>0 locations)

Note: Input arrays may not be modulo 8. Append 0s as needed.


  • m=[ 10 0 20; 15 12 0; 0 8 2] becomes mb=[1 0 1;1 1 0;0 1 1].
  • The idx series is mb(:)=[1 1 0 0 1 1 1 0 1]' .
  • This is 9 long so need to append 7 zeros.
  • Converting the binary to uint8 values yields bmv=[206 128].

This bit mask saves 5% of total image size, yet is itself highly wasteful for compression since only the edges are impacted. A follow-up challenge will be to find the maximum-area non-zero inscribed rectangle.


Problem Group

Solution Statistics

29 correct solutions 22 incorrect solutions
Last solution submitted on Jan 13, 2015

Problem Comments

Solution Comments