Home > ISET > utility > ieScale.m

ieScale

PURPOSE ^

Scale the value in im into a specified range

SYNOPSIS ^

function [im,mn,mx] = ieScale(im,b1,b2)

DESCRIPTION ^

 Scale the value in im into a specified range

   [im,mn,mx] = ieScale(im,b1,b2)

 Changes in syntax produce different scaling operations

  im = ieScale(im)                             scale from 0 to 1
  im = ieScale(im,b1,b2)                       scale and offset to range b1, b2
  im = ieScale(im,maxValue)                    scale  largest value to maxValue

   Scale the values in im into the specified range.  There can be one or
   two bounds.
   The data are scaled into the range [0,1]:   (im - min) / (max - min)
   Then they are transformed to                (b2 - b1)*im + b1;
 Examples:
   im = -10:50;
   [min(im(:)),max(im(:))]
   im = ieScale(im,20,90);
   [min(im(:)),max(im(:))]
 
 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