Home > ISET > utility > ieCompressData.m

ieCompressData

PURPOSE ^

Compress the image data stored in SCENE and OPTICALIMAGE.

SYNOPSIS ^

function [cData,mn,mx] = ieCompressData(data,bitDepth,mn,mx)

DESCRIPTION ^

 Compress the image data stored in SCENE and OPTICALIMAGE.

  [cData,mn,mx]  = ieCompressData(data,[bitDepth =16],[mn=min(data(:)],[mx=max(data(:)])

   The data are quantized to uint16  (or uint8) spread over the original
   range of the data.  The range of the data is recorded and stored as
   well.  The rounding (compression, uint16) formula is generally

      cData =  uint16 (mxCompress * (data - mn)/(mx - mn));
      where mxCompress = 2^bitDepth - 1

   The user can either specify the min/max or allow the data min and max
   to be used.

   If mn > mx, an error is returned.
   If mn == mx, cData =  uint16 (mxCompress * (data - mn));
      When using the data to determine mn,mx and mn==mx, this means that
      the return is all zeros.

   This compression is inverted in the program ieUncompressData.

 See sceneGet, sceneSet for examples of the usage.  

 Copyright ImagEval Consultants, LLC, 2005.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Sun 14-Jan-2007 10:24:23 by m2html © 2003