function img_con

% IMG_CON Show the help for the functions in this toolbox.

% This file is automatically generated.  Matthew Simoneau, 09-04-98
% Copyright (c) 1984-98 by The MathWorks, Inc. All Rights Reserved
% $Revision: 1.11 $ $Date: 1998/12/31 21:14:26 $

helpwin('img_con/Contents');

function Contents
%MATLAB Tour Partial Function Help:  img_con
%
%Double click on any function for more information
%
%  Image Processing Toolbox.
%  Version 2.2 (R11) 05-Aug-1998
% 
%  Release information.
%    Readme     - Display information about versions 2.0, 2.1, and 2.2.
% 
%  Image display.
%    colorbar   - Display colorbar (MATLAB Toolbox).
%    getimage   - Get image data from axes.
%    image      - Create and display image object (MATLAB Toolbox).
%    imagesc    - Scale data and display as image (MATLAB Toolbox).
%    immovie    - Make movie from multiframe indexed image.
%    imshow     - Display image.
%    montage    - Display multiple image frames as rectangular montage.
%    subimage   - Display multiple images in single figure.
%    truesize   - Adjust display size of image.
%    warp       - Display image as texture-mapped surface.
%    zoom       - Zoom in and out of image or 2-D plot (MATLAB Toolbox).
% 
%  Image file I/O.
%    imfinfo    - Return information about image file (MATLAB Toolbox).
%    imread     - Read image file (MATLAB Toolbox).
%    imwrite    - Write image file (MATLAB Toolbox).
% 
%  Geometric operations.
%    imcrop     - Crop image.
%    imresize   - Resize image.
%    imrotate   - Rotate image.
%    interp2    - 2-D data interpolation (MATLAB Toolbox).
% 
%  Pixel values and statistics.
%    corr2      - Compute 2-D correlation coefficient.
%    imcontour  - Create contour plot of image data.
%    imfeature  - Compute feature measurements for image regions.
%    imhist     - Display histogram of image data.
%    impixel    - Determine pixel color values.
%    improfile  - Compute pixel-value cross-sections along line segments.
%    mean2      - Compute mean of matrix elements.
%    pixval     - Display information about image pixels.
%    std2       - Compute standard deviation of matrix elements.
% 
%  Image analysis.
%    edge       - Find edges in intensity image.
%    qtdecomp   - Perform quadtree decomposition.
%    qtgetblk   - Get block values in quadtree decomposition.
%    qtsetblk   - Set block values in quadtree decomposition.
% 
%  Image enhancement.
%    histeq     - Enhance contrast using histogram equalization.
%    imadjust   - Adjust image intensity values or colormap.
%    imnoise    - Add noise to an image.
%    medfilt2   - Perform 2-D median filtering.
%    ordfilt2   - Perform 2-D order-statistic filtering.
%    wiener2    - Perform 2-D adaptive noise-removal filtering.
% 
%  Linear filtering.
%    conv2      - Perform 2-D convolution (MATLAB Toolbox).
%    convmtx2   - Compute 2-D convolution matrix.
%    convn      - Perform N-D convolution (MATLAB Toolbox).
%    filter2    - Perform 2-D linear filtering (MATLAB Toolbox).
%    fspecial   - Create predefined filters.
% 
%  Linear 2-D filter design.
%    freqspace  - Determine 2-D frequency response spacing (MATLAB Toolbox).
%    freqz2     - Compute 2-D frequency response.
%    fsamp2     - Design 2-D FIR filter using frequency sampling.
%    ftrans2    - Design 2-D FIR filter using frequency transformation.
%    fwind1     - Design 2-D FIR filter using 1-D window method.
%    fwind2     - Design 2-D FIR filter using 2-D window method.
% 
%  Image transforms.
%    dct2       - Compute 2-D discrete cosine transform.
%    dctmtx     - Compute discrete cosine transform matrix.
%    fft2       - Compute 2-D fast Fourier transform (MATLAB Toolbox).
%    fftn       - Compute N-D fast Fourier transform (MATLAB Toolbox).
%    fftshift   - Reverse quadrants of output of FFT (MATLAB Toolbox).
%    idct2      - Compute 2-D inverse discrete cosine transform.
%    ifft2      - Compute 2-D inverse fast Fourier transform (MATLAB Toolbox).
%    ifftn      - Compute N-D inverse fast Fourier transform (MATLAB Toolbox).
%    iradon     - Compute inverse Radon transform.
%    phantom    - Generate a head phantom image.
%    radon      - Compute Radon transform.
% 
%  Neighborhood and block processing.
%    bestblk    - Choose block size for block processing.
%    blkproc    - Implement distinct block processing for image.
%    col2im     - Rearrange matrix columns into blocks.
%    colfilt    - Perform neighborhood operations using columnwise functions.
%    im2col     - Rearrange image blocks into columns.
%    nlfilter   - Perform general sliding-neighborhood operations.
% 
%  Binary image operations.
%    applylut   - Perform neighborhood operations using lookup tables.
%    bwarea     - Compute area of objects in binary image.
%    bweuler    - Compute Euler number of binary image.
%    bwfill     - Fill background regions in binary image.
%    bwlabel    - Label connected components in binary image.
%    bwmorph    - Perform morphological operations on binary image.
%    bwperim    - Determine perimeter of objects in binary image.
%    bwselect   - Select objects in binary image.
%    dilate     - Perform dilation on binary image.
%    erode      - Perform erosion on binary image.
%    makelut    - Construct lookup table for use with applylut.
% 
%  Region-based processing.
%    roicolor   - Select region of interest, based on color.
%    roifill    - Smoothly interpolate within arbitrary region.
%    roifilt2   - Filter a region of interest.
%    roipoly    - Select polygonal region of interest.
% 
%  Colormap manipulation.
%    brighten   - Brighten or darken colormap (MATLAB Toolbox).
%    cmpermute  - Rearrange colors in colormap.
%    cmunique   - Find unique colormap colors and corresponding image.
%    colormap   - Set or get color lookup table (MATLAB Toolbox).
%    imapprox   - Approximate indexed image by one with fewer colors.
%    rgbplot    - Plot RGB colormap components (MATLAB Toolbox).
% 
%  Color space conversions.
%    hsv2rgb    - Convert HSV values to RGB color space (MATLAB Toolbox).
%    ntsc2rgb   - Convert NTSC values to RGB color space.
%    rgb2hsv    - Convert RGB values to HSV color space (MATLAB Toolbox).
%    rgb2ntsc   - Convert RGB values to NTSC color space.
%    rgb2ycbcr  - Convert RGB values to YCBCR color space.
%    ycbcr2rgb  - Convert YCBCR values to RGB color space.
% 
%  Image types and type conversions.
%    dither     - Convert image using dithering.
%    gray2ind   - Convert intensity image to indexed image.
%    grayslice  - Create indexed image from intensity image by thresholding.
%    im2bw      - Convert image to binary image by thresholding.
%    im2double  - Convert image array to double precision.
%    im2uint8   - Convert image array to 8-bit unsigned integers.
%    im2uint16  - Convert image array to 16-bit unsigned integers.
%    ind2gray   - Convert indexed image to intensity image.
%    ind2rgb    - Convert indexed image to RGB image (MATLAB Toolbox).
%    isbw       - Return true for binary image.
%    isgray     - Return true for intensity image.
%    isind      - Return true for indexed image.
%    isrgb      - Return true for RGB image.
%    mat2gray   - Convert matrix to intensity image.
%    rgb2gray   - Convert RGB image or colormap to grayscale.
%    rgb2ind    - Convert RGB image to indexed image.
% 
%  Toolbox preferences.
%    iptgetpref - Get value of Image Processing Toolbox preference.
%    iptsetpref - Set value of Image Processing Toolbox preference.
% 
%  Demos.
%    dctdemo    - 2-D DCT image compression demo.
%    edgedemo   - Edge detection demo.
%    firdemo    - 2-D FIR filtering and filter design demo.
%    imadjdemo  - Intensity adjustment and histogram equalization demo.
%    nrfiltdemo - Noise reduction filtering demo.
%    qtdemo     - Quadtree decomposition demo.
%    roidemo    - Region-of-interest processing demo.
% 
%  Slide shows.
%    ipss001    - Region labeling of steel grains.
%    ipss002    - Feature-based logic.
%    ipss003    - Correction of nonuniform illumination.
%-------------------------------------------
%
%  Image Processing Toolbox --- images/images/private
% 
%    axes2pix   - Convert axes coordinates to pixel coordinates.
%    getcurpt   - Get current point.
%    dct        - Discrete cosine transform.
%    ditherc    - Floyd-Steinberg image dithering MEX-file computation.
%    grayto8    - Scale and convert grayscale image to uint8.
%    grayto16   - Scale and convert grayscale image to uint16.
%    grayxform  - Apply grayscale transformation to an image.
%    idct       - Inverse discrete cosine transform.
%    imhistc    - Image histogram MEX-file computation.
%    impad      - Pad boundaries of an image.
%    imtransform - Compute geometric transformation of an image.
%    intline    - Integer-coordinate line drawing algorithm.
%    iptprefs   - Defaults for Image Processing Toolbox preferences.
%    iptregistry - Store toolbox information in persistent memory.
%    lutbridge  - Bridge lookup table used by BWMORPH.
%    lutclean   - Clean lookup table used by BWMORPH.
%    lutdiag    - Diag lookup table used by BWMORPH.
%    lutdilate  - Dilate lookup table used by BWMORPH.
%    luterode   - Erode lookup table used by BWMORPH.
%    lutfatten  - Fatten lookup table used by BWMORPH.
%    lutfill    - Fill lookup table used by BWMORPH.
%    luthbreak  - Hbreak lookup table used by BWMORPH.
%    lutiso     - Iso lookup table used by BWMORPH.
%    lutmajority - Majority lookup table used by BWMORPH.
%    lutper4    - Perimeter lookup table used by BWMORPH.
%    lutper8    - Perimeter lookup table used by BWMORPH.
%    lutremove  - Remove lookup table used by BWMORPH.
%    lutshrink  - Shrink lookup table used by BWMORPH.
%    lutsingle  - Single lookup table used by BWMORPH.
%    lutskel1   - Skeleton lookup table used by BWMORPH.
%    lutskel2   - Skeleton lookup table used by BWMORPH.
%    lutskel3   - Skeleton lookup table used by BWMORPH.
%    lutskel4   - Skeleton lookup table used by BWMORPH.
%    lutskel5   - Skeleton lookup table used by BWMORPH.
%    lutskel6   - Skeleton lookup table used by BWMORPH.
%    lutskel7   - Skeleton lookup table used by BWMORPH.
%    lutskel8   - Skeleton lookup table used by BWMORPH.
%    lutspur    - Spur lookup table used by BWMORPH.
%    lutthin1   - Thin lookup table used by BWMORPH.
%    lutthin2   - Thin lookup table used by BWMORPH.
%    lutthin3   - Thin lookup table used by BWMORPH.
%    lutthin4   - Thin lookup table used by BWMORPH.
%    mkconstarray - Make constant array of specified numeric class.
%    radonc     - Radon transform MEX-file computation.
%    vmquant    - Color quantization.
%    vmquantc   - Color quantization MEX-file computation.
%-------------------------------------------
%
%  Image Processing Toolbox --- demos and sample images
% 
%  Demos.
%    dctdemo      - 2-D DCT image compression demo.
%    edgedemo     - Edge detection demo.
%    firdemo      - 2-D FIR filtering and filter design demo.
%    imadjdemo    - Intensity adjustment and histogram equalization demo.
%    nrfiltdemo   - Noise reduction filtering demo.
%    qtdemo       - Quadtree decomposition demo.
%    roidemo      - Region-of-interest processing demo.
% 
%  Slide shows.
%    ipss001      - Region labeling of steel grains.
%    ipss002      - Feature-based logic.
%    ipss003      - Correction of nonuniform illumination.
% 
%  Sample MAT-files.
%    imdemos.mat  - Images used in demos.
%    trees.mat    - Scanned painting.
% 
%  Sample TIFF images.
%    alumgrns.tif
%    autumn.tif  
%    bacteria.tif
%    blood1.tif  
%    bonemarr.tif
%    cameraman.tif
%    canoe.tif   
%    circbw.tif
%    circles.tif 
%    circlesm.tif
%    debye1.tif  
%    eight.tif   
%    enamel.tif  
%    flowers.tif
%    forest.tif
%    ic.tif
%    kids.tif
%    logo.tif
%    m83.tif
%    moon.tif
%    ngc4024l.tif
%    ngc4024m.tif
%    ngc4024s.tif
%    paper1.tif
%    pout.tif
%    rice.tif
%    saturn.tif
%    shadow.tif
%    shot1.tif
%    spine.tif
%    testpat1.tif
%    testpat2.tif
%    text.tif
%    tire.tif
%    trees.tif
% 
%  Photo credits
%    alumgrns, bacteria, blood1, bonemarr, circles, circlesm,
%    debye1, enamel, flowers, ic, ngc4024l, ngc4024m, ngc4024s,
%    rice, saturn, shot1, testpat1, testpat2, text, tire:
% 
%      Copyright J. C. Russ, The Image Processing Handbook, 
%      Second Edition, 1994, CRC Press, Boca Raton, ISBN
%      0-8493-2516-1.  Used with permission.
% 
%    moon:
% 
%      Copyright Michael Myers.  Used with permission.
% 
%    cameraman:
% 
%      Copyright Massachusetts Institute of Technology.  Used with
%      permission.
% 
%    trees:
% 
%      Trees with a View, watercolor and ink on paper, copyright
%      Susan Cohen.  Used with permission.
% 
%    forest:
% 
%      Photograph of Carmanah Ancient Forest, British Columbia,
%      Canada, courtesy of Susan Cohen.
% 
%    circuit:
% 
%      Micrograph of 16-bit A/D converter circuit, courtesy of
%      Steve Decker and Shujaat Nadeem, MIT, 1993.
% 
%    m83:
% 
%      M83 spiral galaxy astronomical image courtesy of
%      Anglo-Australian Observatory, photography by David Malin.
%

function Readme
%MATLAB Tour Partial Function Help:  img_con
%
%  README file for the Image Processing Toolbox.
% 
%  This file contains information about the MATLAB Image Processing
%  Toolbox, versions 2.2 and earlier.  The first section of
%  this file discusses the ways that version 2.2 differs from
%  version 2.1.  The subsequent sections detail the difference
%  between earlier versions of the toolbox.
% 
%  If you are upgrading to version 2.2 from version 2.1, you
%  only need to read the first section.  Otherwise, you might
%  wish to review this entire file.
% 
%  DIFFERENCES BETWEEN VERSION 2.2 AND VERSION 2.1
% 
%  This section describes the new features and enhancements in
%  version 2.2 of the Image Processing Toolbox, as well as
%  image-related enhancements in MATLAB 5.3.
% 
%  Support for 16-bit image data
%    Most of the functions in the toolbox have been rewritten
%    to add support for processing 16-bit image data.  (Note
%    that support for 8-bit image processing was added in
%    version 2.0; see below.)
% 
%  Improved speed
%    These functions are significantly faster than their
%    version 2.1 counterparts: bwfill, bwselect, bwlabel,
%    dilate, erode, histeq, imresize, imrotate, ordfilt2,
%    medfilt2, im2uint8.
% 
%  New options
%    New border-handling options have been added to medfilt2
%    and ordfilt2.
% 
%  Data type conversion
%    The new function im2uint16 converts uint8 and double
%    images to uint16.
% 
%  Image-related MATLAB 5.3 changes
%    These changes in MATLAB 5.3 may particularly benefit Image
%    Processing Toolbox users:
%      - Improved support for integer types (uint8, int8,
%        uint16, int16, uint32, int32).  You can use relational
%        operators (<,>,==,~=), logical operators (&,|,~), bit
%        functions, and the SUM function with these data
%        types.
%      - Support for the PNG graphics file format
%      - 16-bit image display
%      - 16-bit TIFF file I/O
% 
%  Bug fixes
%    These bugs have been fixed in version 2.2:
%      blkproc   - incorrect input argument parsing in rare case
%      colfilt   - incorrect input argument parsing in indexed
%                  image case
%      freqz2    - four-input syntax was not accepting uint8
%                  inputs correctly  
%      fsamp2    - was not accepting uint8 inputs correctly
%      fwind1    - was not accepting uint8 inputs correctly
%      fwind2    - was not accepting uint8 inputs correctly
%      im2col    - was not handling certain degenerate cases
%                  correctly 
%      isbw      - was not handling nonlogical doubles
%                  correctly 
%      medfilt2  - was not handling NaN's in input correctly
%      ordfilt2  - was not handling NaN's in input correctly
%      roifilt2  - was not preserving data class correctly in
%                  funfun syntaxes 
%      imcontour - imcontour(...,linespec) syntax was not
%                  implemented 
%      subimage  - was not handling double-precision binary
%                  inputs correctly 
%      imrotate  - was slower than necessary when the rotation
%                  angle was a multiple of 90 degrees
%      isgray,isbw,isrgb - inconsistent output value given
%                  empty input matrix 
% 
% 
%  -----------------------------------------------
%  DIFFERENCES BETWEEN VERSION 2.1 AND VERSION 2.0
% 
%  This section describes the new features and enhancements in version 2.1
%  of the Image Processing Toolbox.
% 
%  Interactive pixel value display
%    The new function pixval installs in a figure an interactive display
%    of the data values for whatever image pixel the cursor is currently
%    over.  You can also click and drag to display the Euclidean
%    distance between two pixels.
% 
%  Feature measurement
%    The new function imfeature computes feature measurements, such as the
%    center of mass and the bounding box, for regions in an image.
% 
%  Inverse Radon transform
%    The new function iradon uses the inverse radon transform to
%    reconstruct images from projection data. In addition, the toolbox
%    has a new function, phantom, that generates test images for use
%    with the Radon and inverse Radon transforms.
% 
%  Canny edge detector
%    The edge function now supports the Canny edge detection method.
%    This method is better at detecting weak edges and is less sensitive
%    to noise than the other supported edge-detection methods.
% 
%  Other enhancements
%    - The bwfill function can now automatically detect and fill holes in
%      objects.
%    - The toolbox now supports the YCbCr color space, through two new
%      functions, ycbcr2rgb and rgb2ycbcr.
%    - You can now easily convert images between double precision and
%      uint8 using two new functions, im2double and im2uint8.
%    - You can control whether imshow automatically calls truesize by
%      setting the new toolbox preference 'ImshowTruesize'.
% 
% 
%  ------------------------------------------------------------------
%  DIFFERENCES BETWEEN VERSION 2.0 AND VERSION 1.0
% 
%  Topics include:
% 
%  - general enhancements
%  - new functions
%  - enhancements to specific functions
%  - compatibility issues
%  - bug fixes
% 
% 
%  GENERAL ENHANCEMENTS
% 
%  This section summarizes general areas of enhancement to the toolbox.  See
%  the Image Processing Toolbox User's Guide for more information about these
%  enhancements.
% 
%  Support for 8-bit image data
%    Most of the functions in the toolbox have been rewritten to take
%    advantage of MATLAB's support of unsigned 8-bit integers (uint8 data).
%    You can now read images into MATLAB as uint8 arrays, and process these
%    images with the toolbox functions.  As a result, memory usage for most
%    image-processing operations has been dramatically reduced.
% 
%  N-dimensional arrays
%    The toolbox takes advantage of another new MATLAB feature, N-dimensional
%    arrays.  For example, an RGB image is now stored in a single
%    three-dimensional array, rather than requiring three separate matrices.
%    In addition, multiframe images no longer require image decks, but can
%    now be stored and processed in four-dimensional arrays.
% 
%  Speed-ups
%    Several of the toolbox functions have been rewritten to run faster, in
%    some cases substantially so.
% 
% 
%  NEW FUNCTIONS
% 
%  This section describes the new functions in the Image Processing Toolbox,
%  as well as new functions in the MATLAB Toolbox that are useful for
%  image-processing applications.
% 
%  Image file I/O
%    imfinfo    - Return information about image file (MATLAB Toolbox).
%    imread     - Read image file (MATLAB Toolbox).
%    imwrite    - Write image file (MATLAB Toolbox).
% 
%  Image analysis
%    qtdecomp   - Perform quadtree decomposition.
%    qtgetblk   - Get block values in quadtree decomposition.
%    qtsetblk   - Set block values in quadtree decomposition.
% 
%  Image enhancement
%    ordfilt2   - Perform 2-D order-statistic filtering.
% 
%  Linear filtering
%    convmtx2   - Compute 2-D convolution matrix.
%    convn      - Perform N-D convolution (MATLAB Toolbox).
% 
%  Image transforms
%    dctmtx     - Compute discrete cosine transform matrix.
%    fftn       - Compute N-D fast Fourier transform (MATLAB Toolbox).
%    ifftn      - Compute N-D inverse fast Fourier transform (MATLAB
%    Toolbox).
% 
%  Binary image operations
%    applylut   - Perform neighborhood operations using lookup tables.
%    bwfill     - Fill background regions in binary image.
%    bwlabel    - Label connected components in binary image.
%    bwselect   - Select objects in binary image.
%    makelut    - Generate lookup table for use with applylut.
% 
%  Region-based processing
%    roifill    - Smoothly interpolate within arbitrary region.
% 
%  Toolbox preferences
%    iptgetpref - Get value of Image Processing Toolbox preference.
%    iptsetpref - Set value of Image Processing Toolbox preference.
% 
%  Demos and sample images
%    There are many new demos and sample images in the toolbox. To see a
%    complete list, type:
% 
%      helpwin imdemos
% 
% 
%  ENHANCEMENTS TO SPECIFIC FUNCTIONS
% 
%  Several functions in the toolbox have been enhanced to provide additional
%  capabilities.  This section summarizes these enhancements.
% 
%    blkproc - The function you specify no longer needs to return output of
%      the same size as the input.  The output can be any size, including
%      empty.
% 
%    bwmorph - You can now specify the number of iterations as Inf, in which
%      case bwmorph repeats the specified operation until the image stops
%      changing.
% 
%    dilate, erode - You can now choose between a new frequency-domain
%      algorithm and the spatial-domain algorithm used in version 1.  The
%      frequency-domain algorithm is faster for large structuring elements,
%      but uses more memory.  Also, the spatial-domain algorithm is faster
%      than it was in version 1.
% 
%    edge - There are two new methods available, 'log' and 'zerocross'.
% 
%    hsv2rgb, ntsc2rgb, rgb2hsv, rgb2ntsc - These functions can now convert
%      images as well as colormaps.
% 
%    imhist, medfilt2, roipoly - These functions are considerably faster
%      than in version 1.
% 
%    imshow - The imshow function has been enhanced in many ways.  See the
%      User's Guide for information about imshow.
% 
% 
%  COMPATIBILITY ISSUES
% 
%  In order to take advantage of MATLAB features such as uint8 support and
%  N-dimensional arrays, most of the functions in the toolbox have been
%  rewritten.  This has introduced some incompatibilities that you should be
%  aware of.  This section summarizes these incompatibilities.
% 
%  Grandfathered functions
% 
%    Several functions from version 1 of the toolbox have been
%    "grandfathered."  This means that these functions are no longer
%    supported, but still work in version 2.  These functions have been
%    superseded by new functions in the toolbox or in MATLAB.  We recommend
%    that you do not use the grandfathered functions, and that you rewrite
%    any M-files you have that rely on them.  They will be removed from the
%    toolbox in a future release.
% 
%    The function mfilter2 has been renamed roifilt2.  mfilter2 has been
%    grandfathered.
% 
%    These toolbox functions are redundant with functions available in
%    MATLAB:
% 
%    imslice   - use N-dimensional arrays and MATLAB indexing
%    imzoom    - use zoom instead
% 
%    These image file i/o functions from version 1 have been superseded by
%    imread, imwrite, and imfinfo:
% 
%    bmpread
%    bmpwrite
%    hdfread
%    hdfpeak
%    hdfwrite
%    pcxread
%    pcxwrite
%    tiffread
%    tiffwrite
%    xwdread
%    xwdwrite
% 
%    The gifread and gifwrite functions have been removed from the toolbox
%    due to patent restrictions.
% 
%  uint8 arrays
%    Many of the functions in the toolbox now return uint8 arrays.  For
%    example, functions that return binary images now return them as uint8
%    arrays.  If you have code that performs mathematical operations on
%    binary images, you will need to modify this code to convert the images
%    to double-precision arrays, because mathematical operations are not
%    supported for uint8 arrays.
% 
%    In addition, the conventional data ranges are different for uint8 and
%    double-precision images.  For example, a double-precision intensity
%    image has data in the range [0,1], while a uint8 intensity image has
%    data in the range [0,255].  See the User's Guide for more information
%    about differences between uint8 and double-precision images.
% 
%  RGB images
%    The toolbox functions that take RGB images as input now accept a single
%    three-dimensional array rather than three two-dimensional matrices.
%    For example:
% 
%    imshow(R,G,B) - v1 syntax
%    imshow(RGB)   - v2 syntax
% 
%    The R,G,B syntax for these functions is grandfathered.  It still works
%    in version 2, but is no longer supported and will be removed in a
%    future release.
% 
%  Image decks
%    Multiframe images are now stored as four-dimensional arrays, rather
%    than as image decks.  The functions that work with image decks, such as
%    montage, now accept a 4-D array as input.  The image deck syntaxes have
%    been grandfathered.
% 
%  Morphological operations
%    In version 1, the dilate and erode functions accepted either a
%    structuring element or a string such as 'thin'.  The string syntax has
%    been grandfathered, because in all cases the same operation is
%    available through the bwmorph function.
% 
%    Similarly, in version 1 the bwmorph function accepted either a string or
%    a lookup table.  The lookup table syntax has been grandfathered, and
%    these
%    operations are now provided by the makelut and applylut functions.
%    Also, the syntax in which bwmorph returned a lookup table has been
%    grandfathered.  In some cases, this syntax still works; however, for
%    many operations, a lookup table is no longer used, and this syntax
%    produces a warning.
% 
%    In addition, the bwmorph operation 'fatten' has been grandfathered,
%    because it does not work well.
% 
%  Detecting image type
%    In version 1, some of the toolbox functions could determine the type of
%    an image based on its data range, and process it accordingly.  An image
%    with integer values greater than 1 was always an indexed image.
% 
%    In version 2, the image type is more difficult to determine; an image
%    with integer values greater than 1 can be indexed, intensity, or RGB.
%    Therefore, certain functions now require you to specify the image
%    type.  These functions are blkproc, colfilt, im2col, medfilt2, and
%    nlfilter.  For example, to process an indexed image with medfilt2:
% 
%    X2 = medfilt2(X1,'indexed')
% 
%    If you omit the 'indexed' string, X1 is processed as an intensity
%    image, and the results may not be correct.
% 
%    Also, the functions that perform interpolation formerly used a
%    different default method depending on whether the image was indexed or
%    not. These functions (improfile, imrotate, and imresize) now always
%    default
%    to nearest neighbor interpolation, regardless of the image type.
% 
%  dct2 function
%    This function produces different results than in version 1, because
%    it now uses the unitary form of the transform.
% 
%  edge function
%    The syntax of the edge function has changed substantially. The 'marr'
%    method has been grandfathered, and has been replaced by two new
%    methods, 'log' and 'zerocross'.  (The 'marr' method will still work,
%    but will produce different results from version 1.)  Also, the
%    directionality factor is now specified with a string rather than a
%    vector, and the order of the arguments has changed.  For information
%    about the new syntax, type "help edge" or see the User's Guide.
% 
% 
%  BUG FIXES
% 
%  This section summarizes the most important bugs in version 1 of the
%  toolbox that have been fixed in version 2.
% 
%    bwmorph - The 'thicken', 'skel', and 'thin' operations did not preserve
%      the Euler number.
% 
%    corr2 - This function produced incorrect answers for inputs with
%      nonzero means.
% 
%    edge - The 'marr' method failed to produce continuous contours and
%      produced double-pixel rather than single-pixel edges; the 'sobel'
%      method was computed incorrectly; and the 'roberts' method failed to
%      find some horizontal and vertical lines.
% 
%    imnoise - The noise variance calculation for the noise type 'speckle'
%      was incorrect.
% 
%    improfile - This function produced an error if the input had duplicate
%      points; and the distance-along-profile computation was incorrect in
%      some circumstances.
% 
%    imrotate - In some cases, if you specified a negative angle, imrotate
%      did not rotate the image.
% 
%    radon - This function produced inaccurate results.
% 
%    roipoly - This function sometime produced incorrect results, especially
%      if the input polygon had closely-spaced vertices.

function colorbar
%MATLAB Tour Partial Function Help:  img_con
%
% COLORBAR Display color bar (color scale).
%    COLORBAR('vert') appends a vertical color scale to the current
%    axis. COLORBAR('horiz') appends a horizontal color scale.
% 
%    COLORBAR(H) places the colorbar in the axes H. The colorbar will
%    be horizontal if the axes H width > height (in pixels).
% 
%    COLORBAR without arguments either adds a new vertical color scale
%    or updates an existing colorbar.
% 
%    H = COLORBAR(...) returns a handle to the colorbar axis.

function getimage
%MATLAB Tour Partial Function Help:  img_con
%
% GETIMAGE Get image data from axes.
%    A = GETIMAGE(H) returns the first image data contained in
%    the Handle Graphics object H.  H can be a figure, axes,
%    image, or texture-mapped surface.  A is identical to the
%    image CData; it contains the same values and is of the same
%    class (uint8 or double) as the image CData. If H is not an
%    image or does not contain an image or texture-mapped surface,
%    A is empty.
% 
%    [X,Y,A] = GETIMAGE(H) returns the image XData in X and the
%    YData in Y. XData and YData are two-element vectors that
%    indicate the range of the x-axis and y-axis.
% 
%    [...,A,FLAG] = GETIMAGE(H) returns an integer flag that
%    indicates the type of image H contains. FLAG is one of these
%    values:
%    
%        0   not an image; A is returned as an empty matrix
% 
%        1   indexed image
% 
%        2   intensity image with values in standard range ([0,1]
%            for double arrays, [0,255] for uint8 arrays,
%            [0,65535] for uint16 arrays)
% 
%        3   intensity data, but not in standard range
% 
%        4   RGB image
% 
%    [...] = GETIMAGE returns information for the current axes. It
%    is equivalent to [...] = GETIMAGE(GCA).
% 
%    Class Support
%    -------------
%    The output array A is of the same class as the image
%    CData. All other inputs and outputs are of class double.
% 
%    Example
%    -------
%    After using imshow to display an image directly from a file,
%    use GETIMAGE to get the image data into the workspace.
% 
%        imshow rice.tif
%        I = getimage;

function image
%MATLAB Tour Partial Function Help:  img_con
%
% IMAGE  Display image.
%    IMAGE(C) displays matrix C as an image.  Each element of C
%    specifies the color of a rectilinear patch in the image.  C can be
%    a matrix of dimension MxN or MxNx3, and can contain double, uint8,
%    or uint16 data.
% 
%    When C is a 2-dimensional MxN matrix, the elements of C are used
%    as indices into the current COLORMAP to determine the color.  The
%    value of the image object's CDataMapping property determines the
%    method used to select a colormap entry.  For 'direct' CDataMapping
%    (the default), values in C are treated as colormap indices
%    (1-based if double, 0-based if uint8 or uint16).  For 'scaled' 
%    CDataMapping, values in C are first scaled according to the axes 
%    CLim and then the result is treated as a colormap index.  When C is
%    a 3-dimensional MxNx3 matrix, the elements in C(:,:,1) are
%    interpreted as red intensities, in C(:,:,2) as green intensities,
%    and in C(:,:,3) as blue intensities, and the CDataMapping property
%    of image is ignored.  For matrices containing doubles, color
%    intensities are on the range [0.0, 1.0].  For uint8 and uint16 
%    matrices, color intensities are on the range [0, 255].
% 
%    IMAGE(C) places the center of element C(1,1) at (1,1) in the axes,
%    and the center of element (M,N) at (M,N) in the axes, and draws
%    each rectilinear patch as 1 unit in width and height.  As a
%    result, the outer extent of the image occupies [0.5 N+0.5 0.5 M+0.5]
%    of the axes, and each pixel center of the image lies at integer
%    coordinates ranging between 1 and M or N.
% 
%    IMAGE(X,Y,C), where X and Y are vectors, specifies the locations
%    of the pixel centers of C(1,1) and C(M,N).  Element C(1,1) is
%    centered over (X(1), Y(1)), element C(M,N) is centered over
%    (X(end), Y(end)), and the pixel centers of the remaining elements
%    of C are spread out evenly between those two points, so that the
%    rectilinear patches are all of equal width and height.
% 
%    IMAGE returns a handle to an IMAGE object.
% 
%    C or the X,Y,C triple can be followed by parameter/value
%    pairs to specify additional properties of the image.
%    C or the X,Y,C triple can be omitted entirely, and all
%    properties specified using parameter/value pairs.
% 
%    When called with C or X,Y,C, IMAGE sets the axes limits to tightly
%    enclose the image, sets the axes YDir property to 'reverse', and
%    sets the axes View property to [0 90].
% 
%    The image object will not render at axes View angles other than
%    [0 90].  To get a similar effect to rotating an image, use SURF
%    with texture mapping or PCOLOR.
% 
%    Execute GET(H), where H is an image handle, to see a list of image
%    object properties and their current values. Execute SET(H) to see a
%    list of image object properties and legal property values.
% 
%    

function imagesc
%MATLAB Tour Partial Function Help:  img_con
%
% IMAGESC Scale data and display as image.
%    IMAGESC(...) is the same as IMAGE(...) except the data is scaled
%    to use the full colormap.
%    
%    IMAGESC(...,CLIM) where CLIM = [CLOW CHIGH] can specify the
%    scaling.
% 
%    

function immovie
%MATLAB Tour Partial Function Help:  img_con
%
% IMMOVIE Make movie from multiframe indexed image.
%    MOV = IMMOVIE(X,MAP) returns the movie matrix MOV from the
%    images in the multiframe indexed image X. As it creates the
%    movie matrix, it displays the movie frames on the
%    screen. You can play the movie using the MATLAB MOVIE
%    function.
% 
%    X comprises multiple indexed images, all having the same size
%    and all using the colormap MAP. X is an M-by-N-by-1-by-K
%    array, where K is the number of images.
% 
%    Class Support
%    -------------
%    X can be of class uint8, uint16, or double. MOV is of class 
%    double.
% 
%    Example
%    -------
%         load mri
%         mov = immovie(D,map);
%         movie(mov,3)
% 
%    

function imshow
%MATLAB Tour Partial Function Help:  img_con
%
% IMSHOW Display image.
%    IMSHOW(I,N) displays the intensity image I with N discrete
%    levels of gray. If you omit N, IMSHOW uses 256 gray levels on
%    24-bit displays, or 64 gray levels on other systems.
% 
%    IMSHOW(I,[LOW HIGH]) displays I as a grayscale intensity
%    image, specifying the data range for I. The value LOW (and
%    any value less than LOW) displays as black, the HIGH (and any
%    value greater than HIGH) displays as white, and values in
%    between display as intermediate shades of gray. IMSHOW uses
%    the default number of gray levels. If you use an empty matrix
%    ([]) for [LOW HIGH], IMSHOW uses [min(I(:)) max(I(:))]; the
%    minimum value in I displays as black, and the maximum value
%    displays as white.
% 
%    IMSHOW(BW) displays the binary image BW. Values of 0 display
%    as black, and values of 1 display as white.
% 
%    IMSHOW(X,MAP) displays the indexed image X with the colormap
%    MAP.
% 
%    IMSHOW(RGB) displays the truecolor image RGB.
% 
%    IMSHOW(...,DISPLAY_OPTION) displays the image, calling
%    TRUESIZE if DISPLAY_OPTION is 'truesize', or suppressing the
%    call to TRUESIZE if DISPLAY_OPTION is 'notruesize'. Either
%    option string can be abbreviated. If you do not supply this
%    argument, IMSHOW determines whether to call TRUESIZE based on
%    the setting of the 'ImshowTruesize' preference.
% 
%    IMSHOW(x,y,A,...) uses the 2-element vectors x and y to
%    establish a nondefault spatial coordinate system, by
%    specifying the image XData and YData.
% 
%    IMSHOW(FILENAME) displays the image stored in the graphics
%    file FILENAME. IMSHOW calls IMREAD to read the image from the
%    file, but the image data is not stored in the MATLAB
%    workspace. The file must be in the current directory or on
%    the MATLAB path.
% 
%    H = IMSHOW(...) returns the handle to the image object
%    created by IMSHOW.
% 
%    Class Support
%    -------------
%    The input image can be of class uint8, uint16, or double.
% 
%    Remarks
%    -------
%    You can use the IPTSETPREF function to set several toolbox
%    preferences that modify the behavior of IMSHOW:
% 
%    - 'ImshowBorder' controls whether IMSHOW displays the image
%      with a border around it.
% 
%    - 'ImshowAxesVisible' controls whether IMSHOW displays the
%      image with the axes box and tick labels.
% 
%    - 'ImshowTruesize' controls whether IMSHOW calls the TRUESIZE
%      function.
% 
%    For more information about these preferences, see the
%    reference entry for IPTSETPREF.
% 
%    

function montage
%MATLAB Tour Partial Function Help:  img_con
%
% MONTAGE Display multiple image frames as rectangular montage.
%    MONTAGE displays all the frames of a multiframe image array
%    in a single image object, arranging the frames so that they
%    roughly form a square.
% 
%    MONTAGE(I) displays the K frames of the intensity image array
%    I. I is M-by-N-by-1-by-K.
% 
%    MONTAGE(BW) displays the K frames of the binary image array
%    BW. BW is M-by-N-by-1-by-K.
% 
%    MONTAGE(X,MAP) displays the K frames of the indexed image
%    array X, using the colormap MAP for all frames. X is
%    M-by-N-by-1-by-K.
% 
%    MONTAGE(RGB) displays the K frames of the truecolor image
%    array RGB. RGB is M-by-N-by-3-by-K.
% 
%    H = MONTAGE(...) returns the handle to the image object.
% 
%    Class support
%    -------------
%    The input image can be of class uint8, uint16, or double.
% 
%    Example
%    -------
%        load mri
%        montage(D,map)
% 
%    

function subimage
%MATLAB Tour Partial Function Help:  img_con
%
% SUBIMAGE Display multiple images in single figure.
%    You can use SUBIMAGE in conjunction with SUBPLOT to create
%    figures with multiple images, even if the images have
%    different colormaps. SUBIMAGE works by converting images to
%    truecolor for display purposes, thus avoiding colormap
%    conflicts.
% 
%    SUBIMAGE(X,MAP) displays the indexed image X with colormap
%    MAP in the current axes.
% 
%    SUBIMAGE(I) displays the intensity image I in the current
%    axes.
% 
%    SUBIMAGE(BW) displays the binary image BW in the current
%    axes.
% 
%    SUBIMAGE(RGB) displays the truecolor image RGB in the current
%    axes.
% 
%    SUBIMAGE(x,y,...) displays an image with nondefault spatial
%    coordinates.
% 
%    H = SUBIMAGE(...) returns a handle to the image object.
% 
%    Class Support
%    -------------
%    The input image can be of class uint8, uint16, or double.
% 
%    Example
%    -------
%        load trees
%        [X2,map2] = imread('forest.tif');
%        subplot(1,2,1), subimage(X,map)
%        subplot(1,2,2), subimage(X2,map2)
% 
%    

function truesize
%MATLAB Tour Partial Function Help:  img_con
%
% TRUESIZE Adjust display size of image.
%    TRUESIZE(FIG,[MROWS NCOLS]) adjusts the display size of an
%    image. FIG is a figure containing a single image or a single 
%    image with a colorbar. [MROWS MCOLS] is a 1-by-2 vector that
%    specifies the requested screen area (in pixels) that the
%    image should occupy.
% 
%    TRUESIZE(FIG) uses the image height and width for 
%    [MROWS MCOLS]. This results in the display having one screen
%    pixel for each image pixel.
% 
%    If you omit the figure argument, TRUESIZE works on the
%    current figure.
% 
%    Remarks
%    -------
%    If the 'TruesizeWarning' toolbox preference is 'on', TRUESIZE
%    displays a warning if the image is too large to fit on the
%    screen. (The entire image is still displayed, but at less
%    than true size.) If 'TruesizeWarning' is 'off', TRUESIZE does
%    not display the warning. Note that this preference applies
%    even when you call TRUESIZE indirectly, such as through
%    IMSHOW.
% 
%    

function warp
%MATLAB Tour Partial Function Help:  img_con
%
% WARP Display image as texture-mapped surface.
%    WARP(X,MAP) displays the indexed image X with colormap MAP as
%    a texture map on a simple rectangular surface.
% 
%    WARP(I,N) displays the intensity image I with gray scale
%    colormap of length N as a texture map on a simple rectangular
%    surface.
% 
%    WARP(BW) displays the binary image BW as a texture map on a
%    simple rectangular surface.
% 
%    WARP(RGB) displays the RGB image in the array RGB as a
%    texture map on a simple rectangular surface.
% 
%    WARP(z,...) displays the image on the surface z.
% 
%    WARP(x,y,z,...) displays the image on the surface (x,y,z).
% 
%    H = WARP(...) returns a handle to the texture mapped
%    surface.
% 
%    Class Support
%    -------------
%    The input image can be of class uint8, uint16, or double.
% 
%    Remarks
%    -------
%    Texture-mapped surfaces generally render more slowly than
%    images.
% 
%    Example
%    -------
%        [x,y,z] = cylinder;
%        I = imread('testpat1.tif');
%        warp(x,y,z,I);
% 
%    

function zoom
%MATLAB Tour Partial Function Help:  img_con
%
% ZOOM   Zoom in and out on a 2-D plot.
%    ZOOM with no arguments toggles the zoom state.
%    ZOOM(FACTOR) zooms the current axis by FACTOR.
%        Note that this does not affect the zoom state.
%    ZOOM ON turns zoom on for the current figure.  
%    ZOOM OFF turns zoom off in the current figure.
%    ZOOM OUT returns the plot to its initial (full) zoom.
%    ZOOM XON or ZOOM YON turns zoom on for the x or y axis only.
%    ZOOM RESET clears the zoom out point.
% 
%    When zoom is on, click the left mouse button to zoom in on the
%    point under the mouse.  Click the right mouse button to zoom out
%    (shift-click on the Macintosh).  Each time you click, the axes
%    limits will be changed by a factor of 2 (in or out).  You can also
%    click and drag to zoom into an area.  Double clicking zooms out to
%    the point at which zoom was first turned on for this figure.  Note
%    that turning zoom on, then off does not reset the zoom point.
%    This may be done explicitly with ZOOM RESET.
%    
%    ZOOM(FIG,OPTION) applies the zoom command to the figure specified
%    by FIG. OPTION can be any of the above arguments.

function imfinfo
%MATLAB Tour Partial Function Help:  img_con
%
% IMFINFO Information about graphics file.
%    INFO = IMFINFO(FILENAME,FMT) returns a structure whose
%    fields contain information about an image in a graphics
%    file.  FILENAME is a string that specifies the name of the
%    graphics file, and FMT is a string that specifies the format
%    of the file.  The file must be in the current directory or in
%    a directory on the MATLAB path.  If IMFINFO cannot find a
%    file named FILENAME, it looks for a file named FILENAME.FMT.
%    
%    The possible values for FMT include:
%    
%       'bmp'           Windows Bitmap (BMP)
%       'hdf'           Hierarchical Data Format (HDF)
%       'jpg' or 'jpeg' Joint Photographric Experts Group
%       'pcx'           Windows Paintbrush (PCX)
%       'png'           Portable Network Graphics (PNG)
%       'tif' or 'tiff' Tagged Image File Format (TIFF)
%       'xwd'           X Window Dump (XWD)
% 
%    If FILENAME is a TIFF or HDF file containing more than one
%    image, INFO is a structure array with one element for each
%    image in the file.  For example, INFO(3) would contain
%    information about the third image in the file.
% 
%    INFO = IMFINFO(FILENAME) attempts to infer the format of the
%    file from its content.
% 
%    The set of fields in INFO depends on the individual file and
%    its format.  However, the first nine fields are always the
%    same.  These common fields are:
% 
%    Filename       A string containing the name of the file; if
%                   the file is not in the current directory, the
%                   string contains the full pathname of the file
% 
%    FileModDate    A string containing the modification date of
%                   the file
% 
%    FileSize       An integer indicating the size of the file in
%                   bytes
% 
%    Format         A string containing the file format, as
%                   specified by FMT; for JPEG and TIFF files, the
%                   three-letter variant is returned
% 
%    FormatVersion  A string or number specifying the file format
%                   version 
% 
%    Width          An integer indicating the width of the image
%                   in pixels
% 
%    Height         An integer indicating the height of the image
%                   in pixels
% 
%    BitDepth       An integer indicating the number of bits per
%                   pixel 
% 
%    ColorType      A string indicating the type of image; either
%                   'truecolor' for a truecolor (RGB) image,
%                   'grayscale' for a grayscale intensity image,
%                   or 'indexed', for an indexed image 
% 
%    
%    

function imread
%MATLAB Tour Partial Function Help:  img_con
%
% IMREAD Read image from graphics file.
%    A = IMREAD(FILENAME,FMT) reads the image in FILENAME into
%    A. If the file contains a grayscale intensity image, A is
%    a two-dimensional array.  If the file contains a truecolor
%    (RGB) image, A is a three-dimensional (M-by-N-by-3) array.
%    FILENAME is a string that specifies the name of the
%    graphics file, and FMT is a string that specifies the
%    format of the file.  The file must be in the current
%    directory or in a directory on the MATLAB path.  If IMREAD
%    cannot find a file named FILENAME, it looks for a file
%    named FILENAME.FMT.
% 
%    The possible values for FMT include:
% 
%       'jpg' or 'jpeg' Joint Photographic Experts Group (JPEG)
%       'tif' or 'tiff' Tagged Image File Format (TIFF)
%       'bmp'           Windows Bitmap (BMP)
%       'png'           Portable Network Graphics
%       'hdf'           Hierarchical Data Format (HDF)
%       'pcx'           Windows Paintbrush (PCX)
%       'xwd'           X Window Dump (XWD)
% 
%    [X,MAP] = IMREAD(FILENAME,FMT) reads the indexed image in
%    FILENAME into X and its associated colormap into MAP.
%    Colormap values in the image file are automatically
%    rescaled into the range [0,1]. 
% 
%    [...] = IMREAD(FILENAME) attempts to infer the format of the
%    file from its content.
% 
%    Data types
%    ----------
%    In most of the image file formats supported by IMREAD,
%    pixels are stored using 8 or fewer bits per color plane.
%    When reading such a file, the class of the output (A or X)
%    is uint8.  IMREAD also supports reading 16-bit-per-pixel
%    data from TIFF and PNG files; for such image files, the
%    class of the output (A or X) is uint16.
% 
%    TIFF-specific syntaxes
%    ----------------------
%    [...] = IMREAD(...,IDX) reads in one image from a
%    multi-image TIFF file.  IDX is an integer value that
%    specifies the order that the image appears in the file.
%    For example, if IDX is 3, IMREAD reads the third image in
%    the file.  If you omit this argument, IMREAD reads the
%    first image in the file. 
% 
%    PNG-specific syntaxes
%    ---------------------
%    [...] = IMREAD(...,'BackgroundColor',BG) composites any
%    transparent pixels in the input image against the color
%    specified in BG.  If BG is 'none', then no compositing is
%    performed. Otherwise, if the input image is indexed, BG
%    should be an integer in the range [1,P] where P is the
%    colormap length. If the input image is grayscale, BG
%    should be an integer in the range [0,1].  If the input
%    image is RGB, BG should be a three-element vector whose
%    values are in the range [0,1]. The string
%    'BackgroundColor' may be abbreviated.  
% 
%    If the ALPHA output argument is used (see below), then BG
%    defaults to 'none' if not specified by the
%    user. Otherwise, if the PNG file contains a background
%    color chunk, that color is used as the default value for
%    BG. If ALPHA is not used and the file does not contain a
%    background color chunk, then the default value for BG is 1
%    for indexed images; 0 for grayscale images; and [0 0 0]
%    for RGB images.  
% 
%    [A,MAP,ALPHA] = IMREAD(...) returns the alpha channel if
%    one is present; otherwise ALPHA is [].  Note that MAP may
%    be empty if the file contains a grayscale or truecolor 
%    image.
% 
%    HDF-specific syntaxes
%    ---------------------
%    [...] = IMREAD(...,REF) reads in one image from a
%    multi-image HDF file.  REF is an integer value that
%    specifies the reference number used to identify the image.
%    For example, if REF is 12, IMREAD reads the image whose
%    reference number is 12.  (Note that in an HDF file the
%    reference numbers do not necessarily correspond with the
%    order of the images in the file.  You can use IMFINFO to
%    match up image order with reference number.)  If you omit
%    this argument, IMREAD reads the first image in the file.
% 
%    Supported file types
%    --------------------
%    JPEG  Any baseline JPEG image; JPEG images with some
%          commonly used extensions
% 
%    TIFF  Any baseline TIFF image, including 1-bit, 8-bit, and
%          24-bit uncompressed images; 1-bit, 8-bit, and 24-bit
%          images with packbits compression; 1-bit images with
%          CCITT compression; also, 16-bit grayscale, 16-bit
%          indexed, and 48-bit RGB images
% 
%    BMP   1-bit, 4-bit, 8-bit, and 24-bit uncompressed images;
%          4-bit and 8-bit run-length encoded (RLE) images
% 
%    PNG   Any PNG image, including 1-bit, 2-bit, 4-bit, 8-bit,
%          and 16-bit grayscale images; 8-bit and 16-bit
%          indexed images; 24-bit and 48-bit RGB images
% 
%    HDF   8-bit raster image datasets, with or without an
%          associated colormap; 24-bit raster image datasets
% 
%    PCX   1-bit, 8-bit, and 24-bit images
% 
%    XWD   1-bit and 8-bit ZPixmaps; XYBitmaps; 1-bit XYPixmaps
% 
%    

function imwrite
%MATLAB Tour Partial Function Help:  img_con
%
% IMWRITE Write image to graphics file.
%    IMWRITE(A,FILENAME,FMT) writes the image A to FILENAME.
%    FILENAME is a string that specifies the name of the output
%    file, and FMT is a string the specifies the format of the
%    file.  A can be either a grayscale image (M-by-N) or a
%    truecolor image (M-by-N-by-3).
% 
%    The possible values for FMT include:
% 
%       'tif' or 'tiff' Tagged Image File Format (TIFF)
%       'jpg' or 'jpeg' Joint Photographic Experts Group (JPEG)
%       'bmp'           Windows Bitmap (BMP)
%       'png'           Portable Network Graphics (PNG)
%       'hdf'           Hierarchical Data Format (HDF)
%       'pcx'           Windows Paintbrush (PCX)
%       'xwd'           X Window Dump (XWD)
% 
%    IMWRITE(X,MAP,FILENAME,FMT) writes the indexed image in X,
%    and its associated colormap MAP, to FILENAME.  If X is of
%    class uint8 or uint16, IMWRITE writes the actual values in
%    the array to the file.  If X is of class double, IMWRITE
%    offsets the values in the array before writing, using
%    uint8(X-1).  MAP must be a valid MATLAB colormap.  Note
%    that most image file formats do not support colormaps with
%    more than 256 entries.
% 
%    IMWRITE(...,FILENAME) writes the image to FILENAME,
%    inferring the format to use from the filename's extension.
%    The extension must be one of the legal values for FMT.
% 
%    IMWRITE(...,PARAM1,VAL1,PARAM2,VAL2,...) specifies
%    parameters that control various characteristics of the
%    output file. Parameters are currently supported for HDF,
%    JPEG, TIFF, and PNG files.
% 
%    Data types
%    ----------
%    Most of the supported image file formats store uint8
%    data.  PNG and TIFF additionally support uint16 data.  For
%    grayscale and RGB images, if the data array is double, the
%    assumed dynamic range is [0,1].  The data array is
%    automatically scaled by 255 before being written out as
%    uint8.  If the data array is uint8 or uint16 (PNG and TIFF
%    only), then it is written out without scaling as uint8 or
%    uint16, respectively.  NOTE: If a logical double or uint8
%    is written to a PNG or TIFF file, it is assumed to be a
%    binary image and will be written with a bitdepth of 1.
% 
%    For indexed images, if the index array is double, then the
%    indices are first converted to zero-based indices by
%    subtracting 1 from each element, and then they are written
%    out as uint8.  If the index array is uint8 or uint16 (PNG
%    and TIFF only), then it is written out without
%    modification as uint8 or uint16, respectively.
% 
%    When writing PNG files, you can override this behavior
%    with the 'BitDepth' parameter; see below for details.
% 
%    HDF-specific parameters
%    -----------------------
%    'Compression'  One of these strings: 'none' (the default), 
%                   'rle' (only valid for grayscale and indexed
%                   images), 'jpeg' (only valid for grayscale
%                   and RGB images)
% 
%    'Quality'      A number between 0 and 100; parameter applies
%                   only if 'Compression' is 'jpeg'; higher
%                   numbers mean quality is better (less image
%                   degradation due to compression), but the
%                   resulting file size is larger 
% 
%    'WriteMode'    One of these strings: 'overwrite' (the
%                   default) or 'append'
% 
%    JPEG parameters and values include:
% 
%    'Quality'      A number between 0 and 100; higher numbers
%                   mean quality is better (less image degradation
%                   due to compression), but the resulting file
%                   size is larger
% 
%    TIFF-specific parameters
%    ------------------------
%    'Compression'  One of these strings: 'none', 'packbits'
%                   (default for nonbinary images), 'ccitt'
%                   (default for binary images); 'ccitt' is valid
%                   for binary images only
% 
%    'Description'  Any string; fills in the ImageDescription
%                   field returned by IMFINFO
% 
%    'Resolution'   A two-element vector containing the
%                   XResolution and YResolution, or a scalar
%                   indicating both resolutions; the default value
%                   is 72
% 
%    PNG-specific parameters
%    -----------------------
%    'Author'       A string
% 
%    'Description'  A string
% 
%    'Copyright'    A string
% 
%    'CreationTime' A string
% 
%    'Software'     A string
% 
%    'Disclaimer'   A string
% 
%    'Warning'      A string
% 
%    'Source'       A string
% 
%    'Comment'      A string
% 
%    'InterlaceType' Either 'none' or 'adam7'
% 
%    'BitDepth'     A scalar value indicating desired bitdepth;
%                   for grayscale images this can be 1, 2, 4,
%                   8, or 16; for grayscale images with an
%                   alpha channel this can be 8 or 16; for
%                   indexed images this can be 1, 2, 4, or 8;
%                   for truecolor images with or without an
%                   alpha channel this can be 8 or 16
% 
%    'Transparency' This value is used to indicate transparency
%                   information when no alpha channel is used.
%                   
%                   For indexed images: a Q-element vector in
%                     the range [0,1]; Q is no larger than the
%                     colormap length; each value indicates the
%                     transparency associated with the
%                     corresponding colormap entry
%                   For grayscale images: a scalar in the range
%                     [0,1]; the value indicates the grayscale
%                     color to be considered transparent
%                   For truecolor images: a 3-element vector in
%                     the range [0,1]; the value indicates the
%                     truecolor color to be considered
%                     transparent
% 
%                   You cannot specify 'Transparency' and
%                   'Alpha' at the same time.
% 
%    'Background'   The value specifies background color to be
%                   used when compositing transparent pixels.
% 
%                   For indexed images: an integer in the range
%                     [1,P], where P is the colormap length
%                   For grayscale images: a scalar in the range
%                     [0,1]
%                   For truecolor images: a 3-element vector in
%                     the range [0,1]
% 
%    'Gamma'        A nonnegative scalar indicating the file
%                   gamma
% 
%    'Chromaticities' An 8-element vector [wx wy rx ry gx gy bx
%                   by] that specifies the reference white
%                   point and the primary chromaticities 
% 
%    'XResolution'  A scalar indicating the number of
%                   pixels/unit in the horizontal direction
% 
%    'YResolution'  A scalar indicating the number of
%                   pixels/unit in the vertical direction
% 
%    'ResolutionUnit' Either 'unknown' or 'meter'
% 
%    'Alpha'        A matrix specifying the transparency of
%                   each pixel individually; the row and column
%                   dimensions must be the same as the data
%                   array; may be uint8, uint16, or double, in
%                   which case the values should be in the
%                   range [0,1]
% 
%    'SignificantBits' A scalar or vector indicating how many
%                   bits in the data array should be regarded
%                   as significant; values must be in the range
%                   [1,bitdepth]
% 
%                   For indexed images: a 3-element vector
%                   For grayscale images: a scalar
%                   For grayscale images with an alpha channel:
%                     a 2-element vector
%                   For truecolor images: a 3-element vector
%                   For truecolor images with an alpha channel:
%                     a 4-element vector
% 
%    In addition to these PNG parameters, you can use any
%    parameter name that satisfies the PNG specification for
%    keywords: only printable characters, 80 characters or
%    fewer, and no leading or trailing spaces.  The value
%    corresponding to these user-specified parameters must be a
%    string that contains no control characters except for
%    linefeed.
% 
%    Table: summary of supported image types
%    ---------------------------------------
%    BMP   8-bit and 24-bit uncompressed images
% 
%    TIFF  Baseline TIFF images, including 1-bit, 8-bit, and
%          24-bit uncompressed images; 1-bit, 8-bit, and 24-bit
%          images with packbits compression; 1-bit images with
%          CCITT compression
% 
%    JPEG  Baseline JPEG images
% 
%    PNG   1-bit, 2-bit, 4-bit, 8-bit, and 16-bit grayscale
%          images; 8-bit and 16-bit grayscale images with alpha
%          channels; 1-bit, 2-bit, 4-bit, and 8-bit indexed
%          images; 24-bit and 48-bit truecolor images; 24-bit
%          and 48-bit truecolor images with alpha channels
% 
%    HDF   8-bit raster image datasets, with or without associated
%          colormap; 24-bit raster image datasets; uncompressed or
%          with RLE or JPEG compression
% 
%    PCX   8-bit images
% 
%    XWD   8-bit ZPixmaps
% 
%    

function imcrop
%MATLAB Tour Partial Function Help:  img_con
%
% IMCROP Crop image.
%    IMCROP crops an image to a specified rectangle. In the
%    syntaxes below, IMCROP displays the input image and waits for
%    you to specify the crop rectangle with the mouse:
% 
%         I2 = IMCROP(I)
%         X2 = IMCROP(X,MAP)
%         RGB2 = IMCROP(RGB)
% 
%    If you omit the input arguments, IMCROP operates on the image
%    in the current axes.
% 
%    To specify the rectangle:
% 
%    - For a single-button mouse, press the mouse button and drag
%      to define the crop rectangle. Finish by releasing the mouse
%      button.
% 
%    - For a 2- or 3-button mouse, press the left mouse button and
%      drag to define the crop rectangle. Finish by releasing the
%      mouse button.
% 
%    If you hold down the SHIFT key while dragging, or if you
%    press the right mouse button on a 2- or 3-button mouse,
%    IMCROP constrains the bounding rectangle to be a square.
% 
%    When you release the mouse button, IMCROP returns the cropped
%    image in the supplied output argument. If you do not supply
%    an output argument, IMCROP displays the output image in a new
%    figure.
% 
%    You can also specify the cropping rectangle noninteractively,
%    using these syntaxes:
% 
%         I2 = IMCROP(I,RECT)
%         X2 = IMCROP(X,MAP,RECT)
%         RGB2 = IMCROP(RGB,RECT)
% 
%    RECT is a 4-element vector with the form [XMIN YMIN WIDTH
%    HEIGHT]; these values are specified in spatial coordinates.
% 
%    To specify a nondefault spatial coordinate system for the
%    input image, precede the other input arguments with two
%    2-element vectors specifying the XData and YData:
% 
%         [...] = IMCROP(X,Y,...)
% 
%    If you supply additional output arguments, IMCROP returns
%    information about the selected rectangle and the coordinate
%    system of the input image:
% 
%         [A,RECT] = IMCROP(...)
%         [X,Y,A,RECT] = IMCROP(...)
% 
%    A is the output image. X and Y are the XData and YData of the
%    input image.
% 
%    Remarks
%    -------
%    Because RECT is specified in terms of spatial coordinates,
%    the WIDTH and HEIGHT of RECT do not always correspond exactly
%    with the size of the output image. For example, suppose RECT
%    is [20 20 40 30], using the default spatial coordinate
%    system. The upper left corner of the specified rectangle is
%    the center of the pixel (20,20) and the lower right corner is
%    the center of the pixel (50,60). The resulting output image
%    is 31-by-41, not 30-by-40, because the output image includes
%    all pixels in the input that are completely or partially
%    enclosed by the rectangle.
% 
%    Class Support
%    -------------
%    The input image A can be of class uint8, uint16, or double. 
%    The output image B is of the same class as A. RECT is always 
%    of class double.
% 
%    Example
%    -------
%         I = imread('ic.tif');
%         I2 = imcrop(I,[60 40 100 90]);
%         imshow(I), figure, imshow(I2)
% 
%    

function imresize
%MATLAB Tour Partial Function Help:  img_con
%
% IMRESIZE Resize image.
%    IMRESIZE resizes an image of any type using the specified
%    interpolation method. Supported interpolation methods
%    include:
% 
%         'nearest'  (default) nearest neighbor interpolation
% 
%         'bilinear' bilinear interpolation
% 
%         'bicubic'  bicubic interpolation
% 
%    B = IMRESIZE(A,M,METHOD) returns an image that is M times the
%    size of A. If M is between 0 and 1.0, B is smaller than A. If
%    M is greater than 1.0, B is larger than A. If METHOD is
%    omitted, IMRESIZE uses nearest neighbor interpolation.
% 
%    B = IMRESIZE(A,[MROWS MCOLS],METHOD) returns an image of size
%    MROWS-by-MCOLS. If the specified size does not produce the
%    same aspect ratio as the input image has, the output image is
%    distorted.
% 
%    When the specified output size is smaller than the size of
%    the input image, and METHOD is 'bilinear' or 'bicubic',
%    IMRESIZE applies a lowpass filter before interpolation to
%    reduce aliasing. The default filter size is 11-by-11.
% 
%    You can specify a different order for the default filter
%    using:
% 
%         [...] = IMRESIZE(...,METHOD,N)
% 
%    N is an integer scalar specifying the size of the filter,
%    which is N-by-N. If N is 0, IMRESIZE omits the filtering
%    step.
% 
%    You can also specify your own filter H using:
% 
%         [...] = IMRESIZE(...,METHOD,H)
% 
%    H is any two-dimensional FIR filter (such as those returned
%    by FTRANS2, FWIND1, FWIND2, or FSAMP2).
% 
%    Class Support
%    -------------
%    The input image can be of class uint8, uint16, or
%    double. The output image is of the same class as the input
%    image.
% 
%    

function imrotate
%MATLAB Tour Partial Function Help:  img_con
%
% IMROTATE Rotate image.
%    B = IMROTATE(A,ANGLE,METHOD) rotates the image A by ANGLE
%    degrees in a counter-clockwise direction, using the specified
%    interpolation method. METHOD is a string that can have one of
%    these values:
% 
%         'nearest'  (default) nearest neighbor interpolation
% 
%         'bilinear' bilinear interpolation
% 
%         'bicubic'  bicubic interpolation
% 
%    If you omit the METHOD argument, IMROTATE uses the default
%    method of 'nearest'. To rotate the image clockwise, specify a
%    negative angle.
% 
%    The returned image matrix B is, in general, larger than A to
%    include the whole rotated image. IMROTATE sets invalid values
%    on the periphery of B to 0.
% 
%    B = IMROTATE(A,ANGLE,METHOD,'crop') rotates the image A
%    through ANGLE degrees and returns the central portion that
%    is the same size as A.
% 
%    Class Support
%    -------------
%    The input image can be of class uint8, uint16, or
%    double. The output image is of the same class as the input
%    image.
% 
%    Example
%    -------
%         I = imread('ic.tif');
%         J = imrotate(I,-3,'bilinear','crop');
%         imshow(I), figure, imshow(J)
% 
%    

function interp2
%MATLAB Tour Partial Function Help:  img_con
%
% INTERP2 2-D interpolation (table lookup).
%    ZI = INTERP2(X,Y,Z,XI,YI) interpolates to find ZI, the values of the
%    underlying 2-D function Z at the points in matrices XI and YI.
%    Matrices X and Y specify the points at which the data Z is given.
%    Out of range values are returned as NaN.
% 
%    XI can be a row vector, in which case it specifies a matrix with
%    constant columns. Similarly, YI can be a column vector and it 
%    specifies a matrix with constant rows. 
% 
%    ZI = INTERP2(Z,XI,YI) assumes X=1:N and Y=1:M where [M,N]=SIZE(Z).
%    ZI = INTERP2(Z,NTIMES) expands Z by interleaving interpolates between
%    every element, working recursively for NTIMES.  INTERP2(Z) is the
%    same as INTERP2(Z,1).
% 
%    ZI = INTERP2(...,'method') specifies alternate methods.  The default
%    is linear interpolation.  Available methods are:
% 
%      'nearest' - nearest neighbor interpolation.
%      'linear'  - bilinear interpolation.
%      'cubic'   - bicubic interpolation.
%      'spline'  - spline interpolation.
%      'surf'    - linear interpolation on triangles
%                  for SURF or MESH plots.
% 
%    All the interpolation methods require that X and Y be monotonic and
%    plaid (as if they were created using MESHGRID).  X and Y can be
%    non-uniformly spaced.  For faster interpolation when X and Y are
%    equally spaced and monotonic, use the methods '*linear', '*cubic', or
%    '*nearest'.
% 
%    For example, to generate a coarse approximation of PEAKS and
%    interpolate over a finer mesh:
%        [x,y,z] = peaks(10); [xi,yi] = meshgrid(-3:.1:3,-3:.1:3);
%        zi = interp2(x,y,z,xi,yi); mesh(xi,yi,zi)
%       
%    

function corr2
%MATLAB Tour Partial Function Help:  img_con
%
% CORR2 Compute 2-D correlation coefficient.
%    R = CORR2(A,B) computes the correlation coefficient between A
%    and B, where A and B are matrices or vectors of the same size.
% 
%    Class Support
%    -------------
%    A and B can be of class double or of any integer class.  R
%    is a scalar of class double.
% 
%    

function imcontour
%MATLAB Tour Partial Function Help:  img_con
%
% IMCONTOUR Create contour plot of image data.
%    IMCONTOUR(I,N) draws a contour plot of the intensity image I,
%    automatically setting up the axes so their orientation and
%    aspect ratio match the image. N is the number of equally
%    spaced contour levels in the plot; if you omit the argument,
%    the number of levels and the values of the levels are chosen
%    automatically.
% 
%    IMCONTOUR(I,V) draws a contour plot of I with contour lines
%    at the data values specified in vector V. The number of
%    contour levels is equal to length(V).
% 
%    IMCONTOUR(X,Y,...) uses the vectors X and Y to specify the x-
%    and y-axis limits.
% 
%    IMCONTOUR(...,LINESPEC) draws the contours using the line
%    type and color specified by LINESPEC. Marker symbols are
%    ignored.
% 
%    [C,H] = IMCONTOUR(...) returns the contour matrix C and a
%    vector of handles to the objects in the plot. (The objects
%    are actually patches, and the lines are the edges of the
%    patches.) You can use the CLABEL function with the contour
%    matrix C to add contour labels to the plot.
% 
%    Class Support
%    -------------
%    The input image can be of class uint8, uint16, or double.
% 
%    Example
%    -------
%        I = imread('ic.tif');
%        imcontour(I,3)
% 
%    

function imfeature
%MATLAB Tour Partial Function Help:  img_con
%
% IMFEATURE Compute feature measurements for image regions.
%    STATS = IMFEATURE(L,MEASUREMENTS) computes a set of
%    measurements for each labeled region in the label matrix
%    L. Positive integer elements of L correspond to different
%    regions. For example, the set of elements of L equal to 1
%    corresponds to region 1; the set of elements of L equal to 2
%    corresponds to region 2; and so on. STATS is a structure
%    array of length max(L(:)). The fields of the structure array
%    denote different measurements for each region, as specified
%    by MEASUREMENTS.
% 
%    MEASUREMENTS can be a comma-separated list of strings, a cell
%    array containing strings, the string 'all', or the string
%    'basic'. The set of valid measurement strings includes:
% 
%      'Area'              'ConvexHull'    'EulerNumber'
%      'Centroid'          'ConvexImage'   'Extrema'
%      'BoundingBox'       'ConvexArea'    'EquivDiameter'
%      'MajorAxisLength'   'Image'         'Solidity'
%      'MinorAxisLength'   'FilledImage'   'Extent'
%      'Orientation'       'FilledArea'    'PixelList'
%      'Eccentricity'
% 
%    Measurement strings are case insensitive and can be
%    abbreviated.
% 
%    If MEASUREMENTS is the string 'all', then all of the above
%    measurements are computed. If MEASUREMENTS is not specified
%    or if it is the string 'basic', then these measurements are 
%    computed: 'Area', 'Centroid', and 'BoundingBox'.
% 
%    STATS = IMFEATURE(L,MEASUREMENTS,N) specifies the type of
%    connectivity used in computing the 'FilledImage',
%    'FilledArea', and 'EulerNumber' measurements. N can have a
%    value of either 4 or 8, where 4 specifies 4-connected objects
%    and 8 specifies 8-connected objects; if the argument is
%    omitted, it defaults to 8.
% 
%    Class Support
%    -------------
%    The input label matrix L can be of class double or of any
%    integer class.
% 
%    

function imhist
%MATLAB Tour Partial Function Help:  img_con
%
% IMHIST Display histogram of image data.
%    IMHIST(I,N) displays a histogram with N bins for the
%    intensity image I above a grayscale colorbar of length N. If
%    you omit the argument, IMHIST uses a default value of N=256
%    if I is a grayscale image, or N=2 if I is a binary image.
% 
%    IMHIST(X,MAP) displays a histogram for the indexed image
%    X. This histogram shows the distribution of pixel values
%    above a colorbar of the colormap MAP. The colormap must be at
%    least as long as the largest index in X. The histogram has
%    one bin for each entry in the colormap.
% 
%    [COUNTS,X] = imhist(...) returns the histogram counts in
%    COUNTS and the bin locations in X so that stem(X,COUNTS)
%    shows the histogram. For indexed images, it returns the
%    histogram counts for each colormap entry; the length of
%    COUNTS is the same as the length of the colormap.
% 
%    Class Support
%    -------------
%    The input image can be of class uint8, uint16, or double.
% 
%    Note
%    ----
%    For intensity images, the N bins of the histogram are each
%    half-open intervals of width A/(N-1).  In particular, the
%    p-th bin is the half-open interval:
% 
%         A*(p-1.5)/(N-1)  <= x  <  A*(p-0.5)/(N-1)
% 
%    The scale factor A depends on the image class.  A is 1 if
%    the intensity image is double; A is 255 if the intensity
%    image is uint8; and A is 65535 if the intensity image is
%    uint16.
% 
%    Example
%    -------
%         I = imread('pout.tif');
%         imhist(I)
% 
%    

function impixel
%MATLAB Tour Partial Function Help:  img_con
%
% IMPIXEL Determine pixel color values.
%    IMPIXEL returns the red, green, and blue color values of
%    specified image pixels. In the syntaxes below, IMPIXEL
%    displays the input image and waits for you to specify the
%    pixels with the mouse:
% 
%         P = IMPIXEL(I)
%         P = IMPIXEL(X,MAP)
%         P = IMPIXEL(RGB)
% 
%    If you omit the input arguments, IMPIXEL operates on the
%    image in the current axes.
% 
%    Use normal button clicks to select pixels. Press <BACKSPACE>
%    or <DELETE> to remove the previously selected pixel. A
%    shift-click, right-click, or double-click adds a final pixel
%    and ends the selection; pressing <RETURN> finishes the
%    selection without adding a pixel.
% 
%    When you finish selecting pixels, IMPIXEL returns an M-by-3
%    matrix of RGB values in the supplied output argument. If you
%    do not supply an output argument, IMPIXEL returns the matrix
%    in ANS.
% 
%    You can also specify the pixels noninteractively, using these
%    syntaxes:
% 
%         P = IMPIXEL(I,C,R)
%         P = IMPIXEL(X,MAP,C,R)
%         P = IMPIXEL(RGB,C,R)
% 
%    R and C are equal-length vectors specifying the coordinates
%    of the pixels whose RGB values are returned in P. The k-th
%    row of P contains the RGB values for the pixel (R(k),C(k)).
% 
%    If you supply three output arguments, IMPIXEL returns the
%    coordinates of the selected pixels:
% 
%         [C,R,P] = IMPIXEL(...)
% 
%    To specify a nondefault spatial coordinate system for the
%    input image, use these syntaxes:
% 
%         P = IMPIXEL(x,y,I,xi,yi)
%         P = IMPIXEL(x,y,X,MAP,xi,yi)
%         P = IMPIXEL(x,y,RGB,xi,yi)
% 
%    x and y are 2-element vectors specifying the image XData and
%    YData. xi and yi are equal-length vectors specifying the
%    spatial coordinates of the pixels whose RGB values are
%    returned in P. If you supply three output arguments, IMPIXEL
%    returns the coordinates of the selected pixels:
% 
%         [xi,yi,P] = IMPIXEL(x,y,...)
% 
%    Class Support
%    -------------
%    The input image can be of class uint8, uint16, or double. 
%    All other inputs and outputs are of class double.
% 
%    Example
%    -------
%        RGB = imread('flowers.tif');
%        c = [12 146 410];
%        r = [104 156 129];
%        pixels = impixel(RGB,c,r)
% 
%    

function improfile
%MATLAB Tour Partial Function Help:  img_con
%
% IMPROFILE Compute pixel-value cross-sections along line segments.
%    IMPROFILE computes the intensity values along a line or a
%    multiline path in an image. IMPROFILE selects equally spaced
%    points along the path you specify, and then uses
%    interpolation to find the intensity value for each
%    point. IMPROFILE works with grayscale intensity images and
%    RGB images.
% 
%    If you call IMPROFILE with one of these syntaxes, it operates
%    interactively on the image in the current axes:
% 
%         C = IMPROFILE
%         C = IMPROFILE(N)
% 
%    N specifies the number of points to compute intensity values
%    for. If you do not provide this argument, IMPROFILE chooses a
%    value for N, roughly equal to the number of pixels the path
%    traverses.
% 
%    You specify the line or path using the mouse, by clicking on
%    points in the image. Press <BACKSPACE> or <DELETE> to remove
%    the previously selected point. A shift-click, right-click, or
%    double-click adds a final point and ends the selection;
%    pressing <RETURN> finishes the selection without adding a
%    point. When you finish selecting points, IMPROFILE returns
%    the interpolated data values in C. C is an N-by-1 vector if
%    the input is a grayscale intensity image, or an N-by-1-by-3
%    array if the input image is an RGB image.
% 
%    If you omit the output argument, IMPROFILE displays a plot of
%    the computed intensity values. If the specified path consists
%    of a single line segment, IMPROFILE creates a two-dimensional
%    plot of intensity values versus the distance along the line
%    segment; if the path consists of two or more line segments,
%    IMPROFILE creates a three-dimensional plot of the intensity
%    values versus their x- and y-coordinates.
% 
%    You can also specify the path noninteractively, using these
%    syntaxes:
% 
%         C = IMPROFILE(I,xi,yi)
%         C = IMPROFILE(I,xi,yi,N)
% 
%    xi and yi are equal-length vectors specifying the spatial
%    coordinates of the endpoints of the line segments.
% 
%    You can use these syntaxes to return additional information:
% 
%         [CX,CY,C] = IMPROFILE(...)
%         [CX,CY,C,xi,yi] = IMPROFILE(...)
% 
%    CX and CY are vectors of length N, containing the spatial
%    coordinates of the points at which the intensity values are
%    computed.
% 
%    To specify a nondefault spatial coordinate system for the
%    input image, use these syntaxes:
% 
%         [...] = IMPROFILE(x,y,I,xi,yi)
%         [...] = IMPROFILE(x,y,I,xi,yi,N)
% 
%    x and y are 2-element vectors specifying the image XData and
%    YData.
% 
%    [...] = IMPROFILE(...,METHOD) uses the specified
%    interpolation method. METHOD is a string that can have one of
%    these values:
% 
%         'nearest'  (default) uses nearest neighbor interpolation
% 
%         'bilinear' uses bilinear interpolation
% 
%         'bicubic'  uses bicubic interpolation
% 
%    If you omit the METHOD argument, IMPROFILE uses the default
%    method of 'nearest'.
% 
%    Class Support
%    -------------
%    The input image can be of class uint8, uint16, or double. 
%    All other inputs and outputs are of class double.
% 
%    Example
%    -------
%         I = imread('alumgrns.tif');
%         x = [35 338 346 103];
%         y = [253 250 17 148];
%         improfile(I,x,y), grid on
% 
%    

function mean2
%MATLAB Tour Partial Function Help:  img_con
%
% MEAN2 Compute mean of matrix elements.
%    B = MEAN2(A) computes the mean of the values in A.
% 
%    Class Support
%    -------------
%    A is an array of class double or of any integer class. B
%    is a scalar of class double. 
% 
%    

function pixval
%MATLAB Tour Partial Function Help:  img_con
%
% PIXVAL Display information about image pixels.
%    PIXVAL ON turns on interactive display of information about image pixels
%    in the current figure. PIXVAL installs a black bar at the bottom of the
%    figure which displays the row-column coordinates for whatever pixel the
%    cursor is currently over, and the color information for that pixel. If
%    the image is binary or intensity, the color information is a single
%    intensity value. If the image is indexed or RGB, the color information
%    is an RGB triplet. The values displayed are the actual data values,
%    regardless of the class of the image array, or whether the data is in
%    normal image range.
% 
%    If you click on the image and hold down the mouse button while you move
%    the cursor, PIXVAL also displays the Euclidean distance between the
%    point you clicked on and current cursor location. PIXVAL draws a line
%    between these points to indicate the distance being measured. When you
%    release the mouse button, the line and the distance display disappear.
% 
%    You can move the display bar by clicking on it and dragging it to
%    another place in the figure.
% 
%    PIXVAL OFF turns interactive display off in the current figure. You can
%    also turn off the display by clicking the button on the right side of
%    the display bar.
% 
%    PIXVAL toggles interactive display on or off in the current figure.
% 
%    PIXVAL(FIG,OPTION) applies the PIXVAL command to the figure specified
%    by FIG. OPTION is string containing 'on' or 'off'.
% 
%    

function std2
%MATLAB Tour Partial Function Help:  img_con
%
% STD2 Compute standard deviation of matrix elements.
%    B = STD2(A) computes the standard deviation of the values in
%    A.
% 
%    Class Support
%    -------------
%    A is an array of class double or of any integer class. B
%    is a scalar of class double.
% 
%    

function edge
%MATLAB Tour Partial Function Help:  img_con
%
% EDGE Find edges in intensity image.
%    EDGE takes an intensity image I as its input, and returns a binary image
%    BW of the same size as I, with 1's where the function finds edges in I
%    and 0's elsewhere.
% 
%    EDGE supports six different edge-finding methods:
% 
%       The Sobel method finds edges using the Sobel approximation to the
%       derivative. It returns edges at those points where the gradient of
%       I is maximum.
% 
%       The Prewitt method finds edges using the Prewitt approximation to
%       the derivative. It returns edges at those points where the gradient
%       of I is maximum.
% 
%       The Roberts method finds edges using the Roberts approximation to
%       the derivative. It returns edges at those points where the gradient
%       of I is maximum.
% 
%       The Laplacian of Gaussian method finds edges by looking for zero
%       crossings after filtering I with a Laplacian of Gaussian filter.
% 
%       The zero-cross method finds edges by looking for zero crossings
%       after filtering I with a filter you specify.
% 
%       The Canny method finds edges by looking for local maxima of the
%       gradient of I. The gradient is calculated using the derivative of a
%       Gaussian filter. The method uses two thresholds, to detect strong
%       and weak edges, and includes the weak edges in the output only if
%       they are connected to strong edges. This method is therefore less
%       likely than the others to be "fooled" by noise, and more likely to
%       detect true weak edges.
% 
%    The parameters you can supply differ depending on the method you
%    specify. If you do not specify a method, EDGE uses the Sobel method.
% 
%    Sobel Method
%    ------------
%    BW = EDGE(I,'sobel') specifies the Sobel method.
% 
%    BW = EDGE(I,'sobel',THRESH) specifies the sensitivity threshold for 
%    the Sobel method. EDGE ignores all edges that are not stronger than 
%    THRESH.  If you do not specify THRESH, or if THRESH is empty ([]), 
%    EDGE chooses the value automatically.
% 
%    BW = EDGE(I,'sobel',THRESH,DIRECTION) specifies directionality for the
%    Sobel method. DIRECTION is a string specifying whether to look for
%    'horizontal' or 'vertical' edges, or 'both' (the default).
% 
%    [BW,thresh] = EDGE(I,'sobel',...) returns the threshold value.
% 
%    Prewitt Method
%    --------------
%    BW = EDGE(I,'prewitt') specifies the Prewitt method.
% 
%    BW = EDGE(I,'prewitt',THRESH) specifies the sensitivity threshold for
%    the Prewitt method. EDGE ignores all edges that are not stronger than
%    THRESH. If you do not specify THRESH, or if THRESH is empty ([]),
%    EDGE chooses the value automatically.
% 
%    BW = EDGE(I,'prewitt',THRESH,DIRECTION) specifies directionality for
%    the Prewitt method. DIRECTION is a string specifying whether to look
%    for 'horizontal' or 'vertical' edges, or 'both' (the default).
% 
%    [BW,thresh] = EDGE(I,'prewitt',...) returns the threshold value.
% 
%    Roberts Method
%    --------------
%    BW = EDGE(I,'roberts') specifies the Roberts method.
% 
%    BW = EDGE(I,'roberts',THRESH) specifies the sensitivity threshold for
%    the Roberts method. EDGE ignores all edges that are not stronger than
%    THRESH. If you do not specify THRESH, or if THRESH is empty ([]),
%    EDGE chooses the value automatically.
% 
%    [BW,thresh] = EDGE(I,'roberts',...) returns the threshold value.
% 
%    Laplacian of Gaussian Method
%    ----------------------------
%    BW = EDGE(I,'log') specifies the Laplacian of Gaussian method.
% 
%    BW = EDGE(I,'log',THRESH) specifies the sensitivity threshold for the
%    Laplacian of Gaussian method. EDGE ignores all edges that are not
%    stronger than THRESH. If you do not specify THRESH, or if THRESH is 
%    empty ([]), EDGE chooses the value automatically.
% 
%    BW = EDGE(I,'log',THRESH,SIGMA) specifies the Laplacian of Gaussian
%    method, using SIGMA as the standard deviation of the LoG filter. The
%    default SIGMA is 2; the size of the filter is N-by-N, where
%    N=CEIL(SIGMA*3)*2+1. 
% 
%    [BW,thresh] = EDGE(I,'log',...) returns the threshold value.
% 
%    Zero-cross Method
%    -----------------
%    BW = EDGE(I,'zerocross',THRESH,H) specifies the zero-cross method,
%    using the specified filter H. If THRESH is empty ([]), EDGE chooses 
%    the sensitivity threshold automatically.
% 
%    [BW,THRESH] = EDGE(I,'zerocross',...) returns the threshold value.
% 
%    Canny Method
%    ----------------------------
%    BW = EDGE(I,'canny') specifies the Canny method.
% 
%    BW = EDGE(I,'canny',THRESH) specifies sensitivity thresholds for the
%    Canny method. THRESH is a two-element vector in which the first element
%    is the low threshold, and the second element is the high threshold. If
%    you specify a scalar for THRESH, this value is used for the high
%    threshold and 0.4*THRESH is used for the low threshold. If you do not
%    specify THRESH, or if THRESH is empty ([]), EDGE chooses low and high 
%    values automatically.
% 
%    BW = EDGE(I,'canny',THRESH,SIGMA) specifies the Canny method, using
%    SIGMA as the standard deviation of the Gaussian filter. The default
%    SIGMA is 1; the size of the filter is chosen automatically, based
%    on SIGMA. 
% 
%    [BW,thresh] = EDGE(I,'canny',...) returns the threshold values as a
%    two-element vector.
% 
%    Class Support
%    -------------
%    I can be of class uint8, uint16, or double. BW is of class uint8.
% 
%    Remarks
%    -------
%    For the 'log' and 'zerocross' methods, if you specify a
%    threshold of 0, the output image has closed contours, because
%    it includes all of the zero crossings in the input image.
% 
%    Example
%    -------
%    Find the edges of the rice.tif image using the Prewitt and Canny
%    methods:
% 
%        I = imread('rice.tif');
%        BW1 = edge(I,'prewitt');
%        BW2 = edge(I,'canny');
%        imshow(BW1)
%        figure, imshow(BW2)
% 
%    

function qtdecomp
%MATLAB Tour Partial Function Help:  img_con
%
% QTDECOMP Perform quadtree decomposition.
%    QTDECOMP divides a square image into four equal-sized square
%    blocks, and then tests each block to see if meets some
%    criterion of homogeneity. If a block meets the criterion, it
%    is not divided any further. If it does not meet the
%    criterion, it is subdivided again into four blocks, and the
%    test criterion is applied to those blocks. This process is
%    repeated iteratively until each block meets the
%    criterion. The result may have blocks of several different
%    sizes.
% 
%    S = QTDECOMP(I) performs a quadtree decomposition on the
%    intensity image I, and returns the quadtree structure in the
%    sparse matrix S. If S(k,m) is nonzero, then (k,m) is the
%    upper-left corner of a block in the decomposition, and the
%    size of the block is given by S(k,m). By default, QTDECOMP
%    splits a block unless all elements in the block are equal.
% 
%    S = QTDECOMP(I,THRESHOLD) splits a block if the maximum value
%    of the block elements minus the minimum value of the block
%    elements is greater than THRESHOLD. THRESHOLD is specified as
%    a value between 0 and 1, even if I is of class uint8 or
%    uint16. If I is uint8, the threshold value you supply is
%    multiplied by 255 to determine the actual threshold to
%    use; if I is uint16, the threshold value you supply is
%    multiplied by 65535.
% 
%    S = QTDECOMP(I,THRESHOLD,MINDIM) will not produce blocks
%    smaller than MINDIM, even if the resulting blocks do not meet
%    the threshold condition.
% 
%    S = QTDECOMP(I,THRESHOLD,[MINDIM MAXDIM]) will not produce
%    blocks smaller than MINDIM or larger than MAXDIM. Blocks
%    larger than MAXDIM are split even if they meet the threshold
%    condition. MAXDIM/MINDIM must be a power of 2.
% 
%    S = QTDECOMP(I,FUN) uses the function FUN to determine
%    whether to split a block. QTDECOMP calls FUN with all the
%    current blocks of size M-by-M stacked into M-by-M-by-K array,
%    where K is the number of M-by-M blocks. FUN should return a
%    K-element vector whose values are 1 if the corresponding
%    block should be split, and 0 otherwise. FUN can be a string
%    containing the name of a function, a string containing an
%    expression, or an inline function.
% 
%    S = QTDECOMP(I,FUN,P1,P2,...) passes P1,P2,..., as additional
%    arguments to FUN.
% 
%    Class Support
%    -------------
%    For the syntaxes that do not include a function, the input
%    image can be of class uint8, uint16, or double. For the 
%    syntaxes that include a function, the input image can be of 
%    any class supported by the function. The output matrix is 
%    always of class sparse.
% 
%    Example
%    -------
%        I = [1    1    1    1    2    3    6    6
%             1    1    2    1    4    5    6    8
%             1    1    1    1   10   15    7    7
%             1    1    1    1   20   25    7    7
%            20   22   20   22    1    2    3    4
%            20   22   22   20    5    6    7    8
%            20   22   20   20    9   10   11   12
%            22   22   20   20   13   14   15   16];
%        S = qtdecomp(I,5);
%        full(S)
% 
%    

function qtgetblk
%MATLAB Tour Partial Function Help:  img_con
%
% QTGETBLK Get block values in quadtree decomposition.
%    [VALS,R,C] = QTGETBLK(I,S,DIM) returns in VALS an array
%    containing the DIM-by-DIM blocks in the quadtree
%    decomposition of I. S is the sparse matrix returned by
%    QTDECOMP; it contains the quadtree structure. VALS is a
%    DIM-by-DIM-by-K array, where K is the number of DIM-by-DIM
%    blocks in the quadtree decomposition; if there are no blocks
%    of the specified size, all outputs are returned as empty
%    matrices. R and C are vectors containing the row and column
%    coordinates of the upper-left corners of the blocks.
% 
%    [VALS,IDX] = QTGETBLK(I,S,DIM) returns in IDX a vector
%    containing the linear indices of the upper-left corners of
%    the blocks.
% 
%    Class Support
%    -------------
%    I can be of class uint8, uint16, or double. S is of class 
%    sparse.
% 
%    Remarks
%    -------
%    The ordering of the blocks in VALS matches the columnwise
%    order of the blocks in I. For example, if VALS is
%    4-by-4-by-2, VALS(:,:,1) contains the values from the first
%    4-by-4 block in I, and VALS(:,:,2) contains the values from
%    the second 4-by-4 block.
% 
%    Example
%    -------
%        I = [1    1    1    1    2    3    6    6
%             1    1    2    1    4    5    6    8
%             1    1    1    1   10   15    7    7
%             1    1    1    1   20   25    7    7
%            20   22   20   22    1    2    3    4
%            20   22   22   20    5    6    7    8
%            20   22   20   20    9   10   11   12
%            22   22   20   20   13   14   15   16];
% 
%        S = qtdecomp(I,5);
%        [vals,r,c] = qtgetblk(I,S,4);
% 
%    

function qtsetblk
%MATLAB Tour Partial Function Help:  img_con
%
% QTSETBLK Set block values in quadtree decomposition.
%    J = QTSETBLK(I,S,DIM,VALS) replaces each DIM-by-DIM block in
%    the quadtree decomposition of I with the corresponding
%    DIM-by-DIM block in VALS. S is the sparse matrix returned by
%    QTDECOMP; it contains the quadtree structure. VALS is a
%    DIM-by-DIM-by-K array, where K is the number of DIM-by-DIM
%    blocks in the quadtree decomposition.
% 
%    Class Support
%    -------------
%    I can be of class uint8, uint16, or double. S is of class 
%    sparse.
% 
%    Remarks
%    -------
%    The ordering of the blocks in VALS must match the columnwise
%    order of the blocks in I. For example, if VALS is
%    4-by-4-by-2, VALS(:,:,1) contains the values used to replace
%    the first 4-by-4 block in I, and VALS(:,:,2) contains the
%    values for the second 4-by-4 block.
% 
%    Example
%    -------
%        I = [1    1    1    1    2    3    6    6
%             1    1    2    1    4    5    6    8
%             1    1    1    1   10   15    7    7
%             1    1    1    1   20   25    7    7
%            20   22   20   22    1    2    3    4
%            20   22   22   20    5    6    7    8
%            20   22   20   20    9   10   11   12
%            22   22   20   20   13   14   15   16];
% 
%        S = qtdecomp(I,5);
%        newvals = cat(3,zeros(4),ones(4));
%        J = qtsetblk(I,S,4,newvals);
% 
%    

function histeq
%MATLAB Tour Partial Function Help:  img_con
%
% HISTEQ Enhance contrast using histogram equalization.
%    HISTEQ enhances the contrast of images by transforming the
%    values in an intensity image, or the values in the colormap
%    of an indexed image, so that the histogram of the output
%    image approximately matches a specified histogram.
% 
%    J = HISTEQ(I,HGRAM) transforms the intensity image I so that
%    the histogram of the output image J with length(HGRAM) bins
%    approximately matches HGRAM. The vector HGRAM should contain
%    integer counts for equally spaced bins with intensity values
%    from 0.0 to 1.0. HISTEQ automatically scales HGRAM so that
%    sum(HGRAM) = prod(size(I)). The histogram of J will better
%    match HGRAM when length(HGRAM) is much smaller than the
%    number of discrete levels in I.
% 
%    J = HISTEQ(I,N) transforms the intensity image I, returning
%    in J an intensity image with N discrete levels. A roughly
%    equal number of pixels is mapped to each of the N levels in
%    J, so that the histogram of J is approximately flat. (The
%    histogram of J is flatter when N is much smaller than the
%    number of discrete levels in I.) The default value for N is
%    64.
% 
%    [J,T] = HISTEQ(I) returns the gray scale transformation that
%    maps gray levels in the intensity image I to gray levels in
%    J.
% 
%    NEWMAP = HISTEQ(X,MAP,HGRAM) transforms the colormap
%    associated with the indexed image X so that the histogram of
%    the gray component of the indexed image (X,NEWMAP)
%    approximately matches HGRAM. HISTEQ returns the transformed
%    colormap in NEWMAP. length(HGRAM) must be the same as
%    size(MAP,1).
% 
%    NEWMAP = HISTEQ(X,MAP) transforms the values in the colormap
%    so that the histogram of the gray component of the indexed
%    image X is approximately flat. It returns the transformed
%    colormap in NEWMAP.
% 
%    [NEWMAP,T] = HISTEQ(X,...) returns the gray scale
%    transformation T that maps the gray component of MAP to the
%    gray component of NEWMAP.
% 
%    Class Support
%    -------------
%    For syntaxes that include an intensity image I as input, I
%    can be of class uint8, uint16, or double, and the output 
%    image J has the same class as I. For syntaxes that include 
%    an indexed image X as input, X can be of class uint8 or 
%    double; the output colormap is always of class double. 
%    Also, the optional output T (the gray level transform) 
%    is always of class double.
% 
%    Example
%    -------
%    Enhance the contrast of an intensity image using histogram
%    equalization.
% 
%        I = imread('tire.tif');
%        J = histeq(I);
%        imshow(I), figure, imshow(J)
% 
%    

function imadjust
%MATLAB Tour Partial Function Help:  img_con
%
% IMADJUST Adjust image intensity values or colormap.
%    J = IMADJUST(I,[LOW HIGH],[BOTTOM TOP],GAMMA) transforms the
%    values in the intensity image I to values in J by mapping
%    values between LOW and HIGH to values between BOTTOM and
%    TOP. Values below LOW and above HIGH are clipped; that is,
%    values below LOW map to BOTTOM, and those above HIGH map to
%    TOP. You can use an empty matrix ([]) for [LOW HIGH] or for
%    [BOTTOM TOP] to specify the default of [0 1]. GAMMA specifies
%    the shape of the curve describing the relationship between
%    the values in I and J. If GAMMA is less than 1, the mapping
%    is weighted toward higher (brighter) output values. If GAMMA
%    is greater than 1, the mapping is weighted toward lower
%    (darker) output values. If you omit the argument, GAMMA
%    defaults to 1 (linear mapping).
% 
%    NEWMAP = IMADJUST(MAP,[LOW HIGH],[BOTTOM TOM],GAMMA)
%    transforms the colormap associated with an indexed image. If
%    [LOW HIGH] and [BOTTOM TOP] are both 2-by-3, and GAMMA is a
%    1-by-3 vector, IMADJUST rescales the red, green, and blue
%    components separately. The rescaled colormap, NEWMAP, is the
%    same size as MAP.
% 
%    RGB2 = IMADJUST(RGB1,...) performs the adjustment on each
%    image plane (red, green, and blue) of the RGB image RGB1. As
%    with the colormap adjustment, you can use different parameter
%    values for each plane by specifying [LOW HIGH] and [BOTTOM
%    TOP] as 2-by-3 matrices, and GAMMA as a 1-by-3 vector.
% 
%    Note that if TOP < BOTTOM, the output image is reversed, as
%    in a photographic negative.
% 
%    Class Support
%    -------------
%    For syntaxes that include an input image (rather than a
%    colormap), the input image can be of class uint8, uint16, 
%    or double. The output image has the same class as the
%    input image. For syntaxes that include a colormap, the
%    input and output colormaps are of class double.
% 
%    Example
%    -------
%        I = imread('pout.tif');
%        J = imadjust(I,[0.3 0.7],[]);
%        imshow(I), figure, imshow(J)
% 
%    

function imnoise
%MATLAB Tour Partial Function Help:  img_con
%
% IMNOISE Add noise to image.
%    J = IMNOISE(I,TYPE,...) adds noise of type TYPE to the
%    intensity image I.  TYPE is a string that can have one of
%    these values:
% 
%        'gaussian'       for Gaussian white noise
% 
%        'salt & pepper'  for "on and off" pixels
% 
%        'speckle'        for multiplicative noise
% 
%    Depending on TYPE, you can specify additional parameters to
%    IMNOISE.
%    
%    J = IMNOISE(I,'gaussian',M,V) adds Gaussian white noise of
%    mean M and variance V to the image I. The default is zero
%    mean noise with 0.01 variance. 
%    
%    J = IMNOISE(I,'salt & pepper',D) adds salt and pepper noise
%    to the image I, where D is the noise density.  This affects
%    approximately D*PROD(SIZE(I)) pixels. The default is 0.05
%    noise density.
%    
%    J = IMNOISE(I,'speckle',V) adds multiplicative noise to the
%    image I, using the equation J = I + n*I, where n is uniformly
%    distributed random noise with mean 0 and variance V.  The
%    default for V is 0.04. 
% 
%    Class Support
%    -------------
%    The input image I can be of class uint8, uint16, or double. 
%    The output image J is of the same class as I.
% 
%    Example
%    -------
%         I = imread('eight.tif');
%         J = imnoise(I,'salt & pepper', 0.02);
%         imshow(I), figure, imshow(J)
% 
%    

function medfilt2
%MATLAB Tour Partial Function Help:  img_con
%
% MEDFILT2 Perform 2-D median filtering.
%    B = MEDFILT2(A,[M N]) performs median filtering of the matrix
%    A in two dimensions. Each output pixel contains the median
%    value in the M-by-N neighborhood around the corresponding
%    pixel in the input image. MEDFILT2 pads the image with zeros
%    on the edges, so the median values for the points within 
%    [M N]/2 of the edges may appear distorted.
% 
%    B = MEDFILT2(A) performs median filtering of the matrix A
%    using the default 3-by-3 neighborhood.
% 
%    B = MEDFILT2(...,PADOPT) controls how the matrix boundaries
%    are padded.  PADOPT may be 'zeros' (the default),
%    'symmetric', or 'indexed'. If PADOPT is 'zeros', A is padded
%    with zeros at the boundaries. If PADOPT is 'symmetric', A is
%    symmetrically extended at the boundaries. If PADOPT is
%    'indexed', A is padded with ones if it is double; otherwise
%    it is padded with zeros.
% 
%    Class Support
%    -------------
%    The input image A can be of class uint8, uint16, or double
%    (unless the 'indexed' syntax is used, in which case A
%    cannot be of class uint16). The output image B is of the
%    same class as A.
% 
%    Remarks
%    -------
%    If the input image A is of class uint8, all of the output
%    values are returned as uint8 integers. If the number of
%    pixels in the neighborhood (i.e., M*N) is even, some of the
%    median values may not be integers. In these cases, the
%    fractional parts are discarded.
% 
%    Example
%    -------
%        I = imread('eight.tif');
%        J = imnoise(I,'salt & pepper',0.02);
%        K = medfilt2(J);
%        imshow(J), figure, imshow(K)
% 
%    

function ordfilt2
%MATLAB Tour Partial Function Help:  img_con
%
% ORDFILT2 Perform 2-D order-statistic filtering.
%    B=ORDFILT2(A,ORDER,DOMAIN) replaces each element in A by the
%    ORDER-th element in the sorted set of neighbors specified by
%    the nonzero elements in DOMAIN.  
% 
%    B = ORDFILT2(A,ORDER,DOMAIN,S), where S is the same size as
%    DOMAIN, uses the values of S corresponding to the nonzero
%    values of DOMAIN as additive offsets.
% 
%    B = ORDFILT2(...,PADOPT) controls how the matrix boundaries
%    are padded.  PADOPT may be 'zeros' (the default) or
%    'symmetric'.  If PADOPT is 'zeros', A is padded with zeros at
%    the boundaries.  If PADOPT is 'symmetric', A is symmetrically
%    extended at the boundaries.
% 
%    Class Support
%    -------------
%    The class of A may be uint8, uint16, or double.  The class of
%    B is the same as the class of A, unless the additive offset
%    form of ORDFILT2 is used, in which case the class of B is
%    double.
% 
%    Remarks
%    -------
%    DOMAIN is equivalent to the structuring element used for
%    binary image operations. It is a matrix containing only 1's
%    and 0's; the 1's define the neighborhood for the filtering
%    operation.
% 
%    For example, B=ORDFILT2(A,5,ONES(3,3)) implements a 3-by-3
%    median filter; B=ORDFILT2(A,1,ONES(3,3)) implements a 3-by-3
%    minimum filter; and B=ORDFILT2(A,9,ONES(3,3)) implements a
%    3-by-3 maximum filter.  B=ORDFILT2(A,4,[0 1 0; 1 0 1; 0 1 0])
%    replaces each element in X by the maximum of its north, east,
%    south, and west neighbors. 
% 
%    The syntax that includes S (the matrix of additive offsets)
%    can be used to implement grayscale morphological operations,
%    including grayscale dilation and erosion.
% 
%    

function wiener2
%MATLAB Tour Partial Function Help:  img_con
%
% WIENER2 Perform 2-D adaptive noise-removal filtering.
%    WIENER2 lowpass filters an intensity image that has been
%    degraded by constant power additive noise. WIENER2 uses a
%    pixel-wise adaptive Wiener method based on statistics
%    estimated from a local neighborhood of each pixel.
% 
%    J = WIENER2(I,[M N],NOISE) filters the image I using
%    pixel-wise adaptive Wiener filtering, using neighborhoods of
%    size M-by-N to estimate the local image mean and standard
%    deviation. If you omit the [M N] argument, M and N default to
%    3. The additive noise (Gaussian white noise) power is assumed
%    to be NOISE.
% 
%    [J,NOISE] = WIENER2(I,[M N]) also estimates the additive
%    noise power before doing the filtering. WIENER2 returns this
%    estimate as NOISE.
% 
%    Class Support
%    -------------
%    The input image I can be of class uint8, uint16, or double. 
%    The output image J is of the same class as I.
% 
%    Example
%    -------
%        I = imread('saturn.tif');
%        J = imnoise(I,'gaussian',0,0.005);
%        K = wiener2(J,[5 5]);
%        imshow(J), figure, imshow(K)
% 
%    

function conv2
%MATLAB Tour Partial Function Help:  img_con
%
% CONV2 Two dimensional convolution.
%    C = CONV2(A, B) performs the 2-D convolution of matrices
%    A and B.   If [ma,na] = size(A) and [mb,nb] = size(B), then
%    size(C) = [ma+mb-1,na+nb-1].
%    C = CONV2(HCOL, HROW, A) convolves A separably with HCOL
%    in the column direction and HROW in the row direction.
%    HCOL and HROW should both be vectors.
% 
%    C = CONV2( ... ,'shape') returns a subsection of the 2-D
%    convolution with size specified by 'shape':
%      'full'  - (default) returns the full 2-D convolution,
%      'same'  - returns the central part of the convolution
%                that is the same size as A.
%      'valid' - returns only those parts of the convolution
%                that are computed without the zero-padded
%                edges, size(C) = [ma-mb+1,na-nb+1] when
%                size(A) > size(B).
%    CONV2 is fastest when size(A) > size(B).
% 
%    

function convmtx2
%MATLAB Tour Partial Function Help:  img_con
%
% CONVMTX2 Compute 2-D convolution matrix.
%    T=CONVMTX2(H,M,N) or T=CONVMTX2(H,[M N]) returns the
%    convolution matrix for the matrix H.  If X is an M-by-N
%    matrix, then reshape(T*X(:), size(H)+[M N]-1) is the same
%    as conv2(X,H).  
% 
%    Class Support
%    -------------
%    The inputs are all of class double.  The output matrix T is
%    of class sparse.  The number of nonzero elements in T is no
%    larger than prod(size(H))*M*N.
% 
%    

function convn
%MATLAB Tour Partial Function Help:  img_con
%
% CONVN  N-dimensional convolution.
%    C = CONVN(A, B) performs the N-dimensional convolution of
%    matrices A and B.
%    C = CONVN(A, B, 'shape') controls the size of the answer C:
%      'full'   - (default) returns the full N-D convolution
%      'same'   - returns the central part of the convolution that
%                 is the same size as A.
%      'valid'  - returns only the part of the result that can be
%                 computed without assuming zero-padded arrays.  The
%                 size of the result is max(size(A)-size(B)+1,0).
% 
%    

function filter2
%MATLAB Tour Partial Function Help:  img_con
%
% FILTER2 Two-dimensional digital filter.
%    Y = FILTER2(B,X) filters the data in X with the 2-D FIR
%    filter in the matrix B.  The result, Y, is computed 
%    using 2-D correlation and is the same size as X. 
% 
%    Y = FILTER2(B,X,'shape') returns Y computed via 2-D
%    correlation with size specified by 'shape':
%      'same'  - (default) returns the central part of the 
%                correlation that is the same size as X.
%      'valid' - returns only those parts of the correlation
%                that are computed without the zero-padded
%                edges, size(Y) < size(X).
%      'full'  - returns the full 2-D correlation, 
%                size(Y) > size(X).
% 
%    FILTER2 uses CONV2 to do most of the work.  2-D correlation
%    is related to 2-D convolution by a 180 degree rotation of the
%    filter matrix.
% 
%    

function fspecial
%MATLAB Tour Partial Function Help:  img_con
%
% FSPECIAL Create predefined filters.
%    H = FSPECIAL(TYPE) creates a two-dimensional filter H of the
%    specified type. (FSPECIAL returns H as a computational
%    molecule, which is the appropriate form to use with FILTER2.)
%    TYPE is a string having one of these values:
% 
%         'gaussian'  for a Gaussian lowpass filter
%         'sobel'     for a Sobel horizontal edge-emphasizing
%                        filter 
%         'prewitt'   for a Prewitt horizontal edge-emphasizing
%                        filter 
%         'laplacian' for a filter approximating the
%                        two-dimensional Laplacian operator
%         'log'       for a Laplacian of Gaussian filter
%         'average'   for an averaging filter
%         'unsharp'   for an unsharp contrast enhancement filter
% 
%    Depending on TYPE, FSPECIAL can take additional parameters
%    which you can supply.  These parameters all have default
%    values. 
% 
%    H = FSPECIAL('gaussian',N,SIGMA) returns a rotationally
%    symmetric Gaussian lowpass filter with standard deviation
%    SIGMA (in pixels). N is a 1-by-2 vector specifying the number
%    of rows and columns in H. (N can also be a scalar, in which
%    case H is N-by-N.) If you do not specify the parameters,
%    FSPECIAL uses the default values of [3 3] for N and 0.5 for
%    SIGMA.
% 
%    H = FSPECIAL('sobel') returns this 3-by-3 horizontal edge
%    finding and y-derivative approximation filter:
% 
%        [1 2 1;0 0 0;-1 -2 -1].
% 
%    To find vertical edges, or for x-derivates, use -h'.
% 
%    H = FSPECIAL('prewitt') returns this 3-by-3 horizontal edge
%    finding and y-derivative approximation filter:
% 
%        [1 1 1;0 0 0;-1 -1 -1].
% 
%    To find vertical edges, or for x-derivates, use -h'.
% 
%    H = FSPECIAL('laplacian',ALPHA) returns a 3-by-3 filter
%    approximating the shape of the two-dimensional Laplacian
%    operator. The parameter ALPHA controls the shape of the
%    Laplacian and must be in the range 0.0 to 1.0. FSPECIAL uses
%    the default value of 0.2 if you do not specify ALPHA.
% 
%    H = FSPECIAL('log',N,SIGMA) returns a rotationally symmetric
%    Laplacian of Gaussian filter with standard deviation SIGMA
%    (in pixels). N is a 1-by-2 vector specifying the number of
%    rows and columns in H. (N can also be a scalar, in which case
%    H is N-by-N.) If you do not specify the parameters, FSPECIAL
%    uses the default values of [5 5] for N and 0.5 for SIGMA.
% 
%    H = FSPECIAL('average',N) returns an averaging filter. N is a
%    1-by-2 vector specifying the number of rows and columns in
%    H. (N can also be a scalar, in which case H is N-by-N.) If
%    you do not specify N, FSPECIAL uses the default value of 
%    [3 3].
% 
%    H = FSPECIAL('unsharp',ALPHA) returns a 3-by-3 unsharp
%    contrast enhancement filter. FSPECIAL creates the unsharp
%    filter from the negative of the Laplacian filter with
%    parameter ALPHA. ALPHA controls the shape of the Laplacian
%    and must be in the range 0.0 to 1.0. FSPECIAL uses the
%    default value of 0.2 if you do not specify ALPHA.
% 
%    Example
%    -------
%        I = imread('saturn.tif');
%        h = fspecial('unsharp',0.5);
%        I2 = filter2(h,I)/255;
%        imshow(I), figure, imshow(I2)
% 
%    

function freqspace
%MATLAB Tour Partial Function Help:  img_con
%
% FREQSPACE Frequency spacing for frequency response.
%    FREQSPACE returns the implied frequency range for equally spaced
%    frequency responses.  FREQSPACE is useful when creating desired
%    frequency responses for FSAMP2, FWIND1, and FWIND2 as well as
%    for various 1-D applications.
%    
%    [F1,F2] = FREQSPACE(N) returns the 2-D frequency range vectors
%    F1 and F2 for an N-by-N matrix.
%    [F1,F2] = FREQSPACE([M N]) returns the 2-D frequency range 
%    vectors for an M-by-N matrix.
% 
%    For 2-D vectors and n odd,  F = (-1+1/n:2/n:1-1/n).
%    For 2-D vectors and n even, F = (-1    :2/n:1-2/n).
% 
%    [F1,F2] = FREQSPACE(...,'meshgrid') is equivalent to
%        [F1,F2] = freqspace(...); [F1,F2] = meshgrid(F1,F2);
% 
%    F = FREQSPACE(N) returns the 1-D frequency vector F assuming N
%    equally spaced points around the unit circle.  For 1-D vectors, 
%    F = (0:2/N:1).  F = FREQSPACE(N,'whole') returns all N equally
%    spaced points. In this case, F = (0:2/N:2*(N-1)/N).
% 
%    

function freqz2
%MATLAB Tour Partial Function Help:  img_con
%
% FREQZ2 Compute two-dimensional frequency response.
%    [H,F1,F2] = FREQZ2(h,N1,N2) returns H, the N2-by-N1
%    frequency response of h, and the frequency vectors F1 (of
%    length N1) and f2 (of length N2). h is a two-dimensional FIR
%    filter, in the form of a computational molecule. F1 and F2
%    are returned as normalized frequencies in the range -1.0 to
%    1.0, where 1.0 corresponds to half the sampling frequency, or
%    pi radians.
% 
%    [H,F1,F2] = FREQZ2(h,[N2 N1]) returns the same result as
%    [H,F1,F2] = FREQZ2(h,N1,N2).
% 
%    [H,F1,F2] = FREQZ2(h) uses [N2 N1] = [64 64].
% 
%    [H,F1,F2] = freqz2(h,F1,F2) returns the frequency response
%    for the FIR filter h at frequency values in F1 and F2. These
%    frequency values must be in the range -1.0 to 1.0, where 1.0
%    corresponds to half the sampling frequency, or pi radians.
% 
%    [...] = FREQZ2(h,...,[DX DY]) uses [DX DY] to override the
%    intersample spacing in h. DX determines the spacing for the
%    x-dimension and DY determines the spacing for the
%    y-dimension. The default spacing is 0.5, which corresponds to
%    a sampling frequency of 2.0.
% 
%    [...] = FREQZ2(h,...,DX) uses DX to determine the intersample
%    spacing in both dimensions.
% 
%    With no output arguments, FREQZ2(...) produces a mesh plot of
%    the two-dimensional frequency response.
% 
%    Class Support
%    -------------
%    The input matrix h can be of class double or of any
%    numeric class. All other inputs to freqz2 must be of class
%    double. All outputs are of class double.
% 
%    Example
%    -------
%    Use the window method to create a 16-by-16 filter, then view
%    its frequency response using FREQZ2.
% 
%        Hd = zeros(16,16);
%        Hd(5:12,5:12) = 1;
%        Hd(7:10,7:10) = 0;
%        h = fwind1(Hd,bartlett(16));
%        freqz2(h,[32 32]); axis([-1 1 -1 1 0 1]); colormap(jet(64))
% 
%    

function fsamp2
%MATLAB Tour Partial Function Help:  img_con
%
% FSAMP2 Design 2-D FIR filter using frequency sampling.
%    FSAMP2 designs two-dimensional FIR filters based on a desired
%    two-dimensional frequency response sampled at points on the
%    Cartesian plane.
% 
%    H = FSAMP2(HD) designs a two-dimensional FIR filter with
%    frequency response HD, and returns the filter coefficients in
%    matrix H. (FSAMP2 returns H as a computational molecule,
%    which is the appropriate form to use with FILTER2.) The
%    filter H has a frequency response that passes through points
%    in HD. If HD is M-by-N then H is also M-by-N.
% 
%    HD is a matrix containing the desired frequency response
%    sampled at equally spaced points between -1.0 and 1.0 along
%    the x and y frequency axes, where 1.0 corresponds to half the
%    sampling frequency, or pi radians. For accurate results, use
%    frequency points returned by FREQSPACE to create HD.
% 
%    H = FSAMP2(F1,F2,HD,[M N]) produces an M-by-N FIR filter by
%    matching the filter response HD at the points in the vectors
%    F1 and F2. The resulting filter fits the desired response as
%    closely as possible in the least squares sense. For best
%    results, there must be at least M*N desired frequency
%    points. FSAMP2 issues a warning if you specify fewer than M*N
%    points.
% 
%    Class Support
%    -------------
%    The input matrix HD can be of class double or of any
%    integer class. All other inputs to FSAMP2 must be of class
%    double. All outputs are of class double.
% 
%    Example
%    -------
%    Use FSAMP2 to design an approximately symmetric
%    two-dimensional bandpass filter with passband between 0.1 and
%    0.5 (normalized frequency).
%    
%        [f1,f2] = freqspace(21,'meshgrid');
%        Hd = ones(size(f1));
%        r = sqrt(f1.^2 + f2.^2);
%        Hd((r<0.1) | (r>0.5)) = 0;
%        h = fsamp2(Hd);
%        freqz2(h)
% 
%    

function ftrans2
%MATLAB Tour Partial Function Help:  img_con
%
% FTRANS2 Design 2-D FIR filter design using frequency transformation.
%    H = FTRANS2(B,T) produces the 2-D FIR filter H that
%    corresponds to the 1-D FIR filter B using the transform
%    T. (FTRANS2 returns H as a computational molecule, which is
%    the appropriate form to use with FILTER2.) B must be a 1-D
%    odd-length (type I) filter such as can be returned by FIR1,
%    FIR2, or REMEZ in the Signal Processing Toolbox.  The
%    transform matrix T contains coefficients that define the
%    frequency transformation to use.  If T is M-by-N and B has
%    length Q, then H is size ((M-1)*(Q-1)/2+1)-by-((N-1)*(Q-1)/2+1).
% 
%    H = FTRANS2(B) uses the McClellan transformation
% 
%         T = [ 1   2   1  ;
%               2  -4   2  ;
%               1   2   1  ] / 8
% 
%    which produces filters that are approximately circularly
%    symmetric.
% 
%    Example
%    -------
%    Use FTRANS2 to design an approximately circularly symmetric
%    2-D bandpass filter with passband between 0.1 and 0.6
%    (normalized frequency).
% 
%        b = remez(10,[0 0.05 0.15 0.55 0.65 1],[0 0 1 1 0 0]);
%        h = ftrans2(b);
%        freqz2(h)
% 
%    

function fwind1
%MATLAB Tour Partial Function Help:  img_con
%
% FWIND1 Design 2-D FIR filter using 1-D window method.
%    FWIND1 designs two-dimensional FIR filters using the window
%    method. FWIND1 uses a one-dimensional window specification to
%    design a two-dimensional FIR filter based on the desired
%    frequency response HD. FWIND1 works with one-dimensional
%    windows only; use FWIND2 to work with two-dimensional
%    windows.
% 
%    H = FWIND1(HD,WIN) designs a two-dimensional FIR filter H
%    with frequency response HD. (FWIND1 returns H as a
%    computational molecule, which is the appropriate form to use
%    with FILTER2.) FWIND1 uses the one-dimensional window WIN to
%    form an approximately circularly symmetric two-dimensional
%    window using Huang's method. You can specify WIN using
%    window functions in the Signal Processing Toolbox, such as
%    BOXCAR, HAMMING, HANNING, BARTLETT, BLACKMAN, KAISER, or
%    CHEBWIN. If length(WIN) is N, then H is N-by-N.
% 
%    HD is a matrix containing the desired frequency response
%    sampled at equally spaced points between -1.0 and 1.0 (in
%    normalized frequency, where 1.0 corresponds to half the
%    sampling frequency, or pi radians) along the x and y
%    frequency axes. For accurate results, use frequency points
%    returned by FREQSPACE to create HD. 
% 
%    H = FWIND1(HD,WIN1,WIN2) uses the two one-dimensional windows
%    WIN1 and WIN2 to create a separable two-dimensional
%    window. If length(WIN1) is N and length(WIN2) is M, then H is
%    M-by-N.
% 
%    H = FWIND1(F1,F2,HD,...) lets you specify the desired
%    frequency response HD at arbitrary frequencies (F1 and F2, in
%    normalized frequency) along the x and y axes. The length of
%    the window(s) controls the size of the resulting filter, as
%    above.
% 
%    Class Support
%    -------------
%    The input matrix Hd can be of class double or of any
%    integer class.  All other inputs to FWIND1 must be of
%    class double.  All outputs are of class double.
% 
%    Example
%    -------
%    Use FWIND1 to design an approximately circularly symmetric
%    two-dimensional bandpass filter with passband between 0.1 and
%    0.5 (normalized frequency).
% 
%        [f1,f2] = freqspace(21,'meshgrid');
%        Hd = ones(21);
%        r = sqrt(f1.^2 + f2.^2);
%        Hd((r<0.1) | (r>0.5)) = 0;
%        h = fwind1(Hd,hamming(21));
%        freqz2(h)
% 
%    

function fwind2
%MATLAB Tour Partial Function Help:  img_con
%
% FWIND2 Design 2-D FIR filter using 2-D window method.
%    Use FWIND2 to design two-dimensional FIR filters using the
%    window method. FWIND2 uses a two-dimensional window
%    specification to design a two-dimensional FIR filter based on
%    the desired frequency response HD. FWIND2 works with
%    two-dimensional windows; use FWIND1 to work with
%    one-dimensional windows.
% 
%    H = FWIND2(HD,WIN) produces the two-dimensional FIR filter H
%    using an inverse Fourier transform of the desired frequency
%    response HD and multiplication by the window WIN. HD is a
%    matrix containing the desired frequency response at equally
%    spaced points in the Cartesian plane. FWIND2 returns H as a 
%    computational molecule, which is the appropriate form to use
%    with FILTER2. The size of WIN controls the size of the
%    resulting filter; if WIN is M-by-N then H will also be
%    M-by-N.
% 
%    For accurate results, use frequency points returned by
%    FREQSPACE to create HD.
% 
%    H = FWIND2(F1,F2,HD,WIN) lets you specify the desired
%    frequency response HD at arbitrary frequencies (F1 and F2)
%    along the x and y axes. The frequency vectors F1 and F2
%    should be in the range -1.0 to 1.0, where 1.0 corresponds to
%    half the sampling frequency, or pi radians.
% 
%    Class Support
%    -------------
%    The input matrix Hd can be of class double or of any
%    integer class.  All other inputs to FWIND2 must be of
%    class double.  All outputs are of class double.
% 
%    Example
%    -------
%    Use FWIND2 to design an approximately circularly symmetric
%    two-dimensional bandpass filter with passband between 0.1 and
%    0.5 (normalized frequency).
% 
%        [f1,f2] = freqspace(21,'meshgrid');
%        Hd = ones(21);
%        r = sqrt(f1.^2 + f2.^2);
%        Hd((r<0.1) | (r>0.5)) = 0;
%        win = fspecial('gaussian',21,2);
%        win = win ./ max(win(:));  % Make the maximum window value be 1.
%        h = fwind2(Hd,win);
%        freqz2(h)
% 
%    

function dct2
%MATLAB Tour Partial Function Help:  img_con
%
% DCT2 Compute 2-D discrete cosine transform.
%    B = DCT2(A) returns the discrete cosine transform of A.
%    The matrix B is the same size as A and contains the
%    discrete cosine transform coefficients.
% 
%    B = DCT2(A,[M N]) or B = DCT2(A,M,N) pads the matrix A with
%    zeros to size M-by-N before transforming. If M or N is
%    smaller than the corresponding dimension of A, DCT2 truncates
%    A. 
% 
%    This transform can be inverted using IDCT2.
% 
%    Class Support
%    -------------
%    A can be of class double or of any integer class.  The
%    returned matrix B is of class double.
% 
%    Example
%    -------
%        RGB = imread('autumn.tif');
%        I = rgb2gray(RGB);
%        J = dct2(I);
%        imshow(log(abs(J)),[]), colormap(jet), colorbar
% 
%    The commands below set values less than magnitude 10 in the
%    DCT matrix to zero, then reconstruct the image using the
%    inverse DCT function IDCT2.
% 
%        J(abs(J)<10) = 0;
%        K = idct2(J);
%        imshow(I), figure, imshow(K,[0 255])
% 
%    

function dctmtx
%MATLAB Tour Partial Function Help:  img_con
%
% DCTMTX Compute discrete cosine transform matrix.
%    D = DCTMTX(N) returns the N-by-N DCT transform matrix.  D*A
%    is the DCT of the columns of A and D'*A is the inverse DCT of
%    the columns of A (when A is N-by-N).
% 
%    If A is square, the two-dimensional DCT of A can be computed
%    as D*A*D'. This computation is sometimes faster than using
%    DCT2, especially if you are computing large number of small
%    DCT's, because D needs to be determined only once.
% 
%    Class Support
%    -------------
%    N is a scalar of class double. D is returned as a matrix of
%    class double.
%    
%    

function fft2
%MATLAB Tour Partial Function Help:  img_con
%
% FFT2 Two-dimensional discrete Fourier Transform.
%    FFT2(X) returns the two-dimensional Fourier transform of matrix X.
%    If X is a vector, the result will have the same orientation.
% 
%    FFT2(X,MROWS,NCOLS) pads matrix X with zeros to size MROWS-by-NCOLS
%    before transforming.
% 
%    

function fftn
%MATLAB Tour Partial Function Help:  img_con
%
% FFTN N-dimensional discrete Fourier Transform.
%    FFTN(X) returns the N-dimensional discrete Fourier transform
%    of the N-D array X.  If X is a vector, the output will have
%    the same orientation.
% 
%    FFTN(X,SIZ) pads X so that its size vector is SIZ before
%    performing the transform.  If any element of SIZ is smaller
%    than the corresponding dimension of X, then X will be cropped
%    in that dimension.
% 
%    

function fftshift
%MATLAB Tour Partial Function Help:  img_con
%
% FFTSHIFT Shift DC component to center of spectrum.
%    For vectors, FFTSHIFT(X) swaps the left and right halves of
%    X.  For matrices, FFTSHIFT(X) swaps the first and third
%    quadrants and the second and fourth quadrants.  For N-D
%    arrays, FFTSHIFT(X) swaps "half-spaces" of X along each
%    dimension.
% 
%    FFTSHIFT is useful for visualizing the Fourier transform with
%    the DC component in the middle of the spectrum.
% 
%    

function idct2
%MATLAB Tour Partial Function Help:  img_con
%
% IDCT2 Compute 2-D inverse discrete cosine transform.
%    B = IDCT2(A) returns the two-dimensional inverse discrete
%    cosine transform of A.
% 
%    B = IDCT2(A,[M N]) or B = IDCT2(A,M,N) pads A with zeros (or
%    truncates A) to create a matrix of size M-by-N before
%    transforming. 
% 
%    For any A, IDCT2(DCT2(A)) equals A to within roundoff error.
% 
%    The discrete cosine transform is often used for image
%    compression applications.
% 
%    Class Support
%    -------------
%    The input matrix A can be of class double or of any
%    numeric class. The output matrix B is of class double.
% 
%    

function ifft2
%MATLAB Tour Partial Function Help:  img_con
%
% IFFT2 Two-dimensional inverse discrete Fourier transform.
%    IFFT2(F) returns the two-dimensional inverse Fourier transform
%    of matrix F.  If F is a vector, the result will have the same
%    orientation.
% 
%    IFFT2(F,MROWS,NCOLS) pads matrix F with zeros to size MROWS-by-NCOLS
%    before transforming.
% 
%    

function ifftn
%MATLAB Tour Partial Function Help:  img_con
%
% IFFTN N-dimensional inverse discrete Fourier transform.
%    IFFTN(F) returns the N-dimensional inverse discrete Fourier
%    transform of the N-D array F.  If F is a vector, the result
%    will have the same orientation.
% 
%    IFFTN(F,SIZ) pads F so that its size vector is SIZ before
%    performing the transform.  If any element of SIZ is smaller
%    than the corresponding dimension of F, then F will be cropped
%    in that dimension.
% 
%    

function iradon
%MATLAB Tour Partial Function Help:  img_con
%
% IRADON Compute inverse Radon transform.
%    I = iradon(R,THETA) reconstructs the image I from projection 
%    data in the 2-D array R.  The columns of R are parallel beam 
%    projection data.  IRADON assumes that the center of rotation
%    is the center point of the projections, which is defined as
%    ceil(size(R,1)/2).
% 
%    THETA describes the angles (in degrees) at which the projections    
%    were taken.  It can be either a vector containing the angles or 
%    a scalar specifying D_theta, the incremental angle between 
%    projections. If THETA is a vector, it must contain angles with 
%    equal spacing between them.  If THETA is a scalar specifying   
%    D_theta, the projections are taken at angles THETA = m * D_theta; 
%    m = 0,1,2,...,size(R,2)-1.  If the input is the empty matrix
%    ([]), D_theta defaults to 180/size(R,2).   
% 
%    IRADON uses the filtered backprojection algorithm to perform
%    the inverse Radon transform.  The filter is designed directly 
%    in the frequency domain and then multiplied by the FFT of the 
%    projections.  The projections are zero-padded to a power of 2 
%    before filtering to prevent spatial domain aliasing and to 
%    speed up the FFT.
% 
%    I = IRADON(R,THETA,INTERP,FILTER,D,N) specifies parameters 
%    to use in the inverse Radon transform.  You can specify
%    any combination of the last four arguments.  IRADON uses 
%    default values for any of these arguments that you omit.
% 
%    INTERP specifies the type of interpolation to use in the   
%    backprojection.  The available options are listed in order
%    of increasing accuracy and computational complexity:
% 
%       'nearest' - nearest neighbor interpolation 
%       'linear'  - linear interpolation (default)
%       'spline'  - spline interpolation
% 
%    FILTER specifies the filter to use for frequency domain filtering.  
%    FILTER is a string that specifies any of the following standard 
%    filters:
%  
%    'Ram-Lak'     The cropped Ram-Lak or ramp filter (default).  The    
%                  frequency response of this filter is |f|.  Because 
%                  this filter is sensitive to noise in the projections, 
%                  one of the filters listed below may be preferable.   
%    'Shepp-Logan' The Shepp-Logan filter multiplies the Ram-Lak
%                  filter by a sinc function.
%    'Cosine'      The cosine filter multiplies the Ram-Lak filter 
%                  by a cosine function.
%    'Hamming'     The Hamming filter multiplies the Ram-Lak filter 
%                  by a Hamming window.
%    'Hann'        The Hann filter multiplies the Ram-Lak filter by 
%                  a Hann window.
%    
%    D is a scalar in the range (0,1] that modifies the filter by 
%    rescaling its frequency axis.  The default is 1.  If D is less 
%    than 1, the filter is compressed to fit into the frequency range  
%    [0,D], in normalized frequencies; all frequencies above D are set  
%    to 0.
%  
%    N is a scalar that specifies the number of rows and columns in the 
%    reconstructed image.  If N is not specified, the size is determined   
%    from the length of the projections:
% 
%        N = 2*floor(size(R,1)/(2*sqrt(2)))
% 
%    If you specify N, IRADON reconstructs a smaller or larger portion of 
%    the image, but does not change the scaling of the data.  
%  
%    If the projections were calculated with the RADON function, the 
%    reconstructed image may not be the same size as the original 
%    image.  
% 
%    [I,H] = iradon(...) returns the frequency response of the filter
%    in the vector H.
% 
%    Class Support
%    -------------
%    All input arguments must be of class double.  The output arguments are
%    of class double.
% 
%    Example
%    -------
%        P = phantom(128);
%        R = radon(P,0:179);
%        I = iradon(R,0:179,'nearest','Hann');
%        imshow(P); figure; imshow(I);
% 
%    

function phantom
%MATLAB Tour Partial Function Help:  img_con
%
% PHANTOM Generate a head phantom image.
%    P = PHANTOM(DEF,N) generates an image of a head phantom that can   
%    be used to test the numerical accuracy of RADON and IRADON or other  
%    2-D reconstruction algorithms.  P is a grayscale intensity image that
%    consists of one large ellipse (representing the brain) containing
%    several smaller ellipses (representing features in the brain).
% 
%    DEF is a string that specifies the type of head phantom to generate.
%    Valid values are: 
%          
%       'Shepp-Logan'            A test image used widely by researchers in
%                                tomography
%       'Modified Shepp-Logan'   (default) A variant of the Shepp-Logan phantom
%                                in which the contrast is improved for better  
%                                visual perception.
% 
%    N is a scalar that specifies the number of rows and columns in P.
%    If you omit the argument, N defaults to 256.
%  
%    P = PHANTOM(E,N) generates a user-defined phantom, where each row
%    of the matrix E specifies an ellipse in the image.  E has six columns,
%    with each column containing a different parameter for the ellipses:
%    
%      Column 1:  A    the additive intensity value of the ellipse
%      Column 2:  a    the length of the horizontal semi-axis of the ellipse 
%      Column 3:  b    the length of the vertical semi-axis of the ellipse
%      Column 4:  x0   the x-coordinate of the center of the ellipse
%      Column 5:  y0   the y-coordinate of the center of the ellipse
%      Column 6:  phi  the angle (in degrees) between the horizontal semi-axis 
%                      of the ellipse and the x-axis of the image        
% 
%    For purposes of generating the phantom, the domains for the x- and 
%    y-axes span [-1,1].  Columns 2 through 5 must be specified in terms
%    of this range.
% 
%    [P,E] = PHANTOM(...) returns the matrix E used to generate the phantom.
% 
%    Class Support
%    -------------
%    All inputs must be of class double.  All outputs are of class double.
% 
%    Remarks
%    -------
%    For any given pixel in the output image, the pixel's value is equal to the
%    sum of the additive intensity values of all ellipses that the pixel is a 
%    part of.  If a pixel is not part of any ellipse, its value is 0.  
% 
%    The additive intensity value A for an ellipse can be positive or negative;
%    if it is negative, the ellipse will be darker than the surrounding pixels.
%    Note that, depending on the values of A, some pixels may have values outside
%    the range [0,1].
%     
%    

function radon
%MATLAB Tour Partial Function Help:  img_con
%
% RADON Compute Radon transform.
%    The RADON function computes the Radon transform, which is the
%    projection of the image intensity along a radial line
%    oriented at a specific angle.
% 
%    R = RADON(I,THETA) returns the Radon transform of the
%    intensity image I for the angle THETA degrees. If THETA is a
%    scalar, the result R is a column vector containing the Radon
%    transform for THETA degrees. If THETA is a vector, then R is
%    a matrix in which each column is the Radon transform for one
%    of the angles in THETA. If you omit THETA, it defaults to
%    0:179.
% 
%    R = RADON(I,THETA,N) returns a Radon transform with the
%    projection computed at N points. R has N rows. If you do not
%    specify N, the number of points the projection is computed at
%    is:
% 
%         2*ceil(norm(size(I)-floor((size(I)-1)/2)-1))+3
% 
%    This number is sufficient to compute the projection at unit
%    intervals, even along the diagonal.
% 
%    [R,Xp] = RADON(...) returns a vector Xp containing the radial
%    coordinates corresponding to each row of R.
% 
%    Class Support
%    -------------
%    I can be of class double or of any integer class. All
%    other inputs and outputs are of class double.
% 
%    Remarks
%    -------
%    The radial coordinates returned in Xp are the values along
%    the x-prime axis, which is oriented at THETA degrees
%    counterclockwise from the x-axis. The origin of both axes is
%    the center pixel of the image, which is defined as:
% 
%         floor((size(I)+1)/2)
% 
%    For example, in a 20-by-30 image, the center pixel is
%    (10,15).
% 
%    Example
%    -------
%        I = zeros(100,100);
%        I(25:75, 25:75) = 1;
%        theta = 0:180;
%        [R,xp] = radon(I,theta);
%        imshow(theta,xp,R,[],'n')
%        xlabel('\theta (degrees)')
%        ylabel('x''')
%        colormap(hot), colorbar
% 
%    

function bestblk
%MATLAB Tour Partial Function Help:  img_con
%
% BESTBLK Choose block size for block processing.
%    SIZ = BESTBLK([M N],K) returns, for an M-by-N image, the
%    optimal block size for block processing. K is a scalar
%    specifying the maximum row and column dimensions for the
%    block; if the argument is omitted, it defaults to 100. SIZ is
%    a 1-by-2 vector containing row and column dimensions for the
%    block.
% 
%    [MB,NB] = BESTBLK([M N],K) returns the row and column
%    dimensions in MB and NB, respectively.
% 
%    Example
%    -------
%        siz = bestblk([640 800], 72)
% 
%    

function blkproc
%MATLAB Tour Partial Function Help:  img_con
%
% BLKPROC Implement distinct block processing for image.
%    B = BLKPROC(A,[M N],FUN) processes the image A by applying
%    the function FUN to each distinct M-by-N block of A, padding
%    A with zeros if necessary. FUN can be an inline function, a
%    text string containing the name of a function, or a string
%    containing an expression. FUN should operate on an M-by-N
%    block, X, and return a matrix, vector, or scalar Y:
% 
%         Y = FUN(X)
% 
%    BLKPROC does not require that Y be the same size as X.
%    However, B is the same size as A only if Y is the same size
%    as X. 
% 
%    B = BLKPROC(A,[M N],FUN,P1,P2,...) passes the additional
%    parameters P1,P2,..., to FUN.
% 
%    B = BLKPROC(A,[M N],[MBORDER NBORDER],FUN,...) defines an
%    overlapping border around the blocks.  BLKPROC extends the
%    original M-by-N blocks by MBORDER on the top and bottom, and
%    NBORDER on the left and right, resulting in blocks of size
%    (M+2*MBORDER)-by-(N+2*NBORDER). BLKPROC pads the border with
%    zeros, if necessary, on the edges of A. FUN should operate
%    on the extended block.
% 
%    B = BLKPROC(A,'indexed',...) processes A as an indexed image,
%    padding with zeros if the class of A is uint8 or uint16, or 
%    ones if the class of A is double.
% 
%    Class Support
%    -------------
%    The input image A can be of any class supported by FUN. The
%    class of B depends on the class of the output from FUN.
% 
%    Example
%    -------
%    This example uses BLKPROC to set the pixels in each 8-by-8
%    block to the standard deviation of the elements in that
%    block.
%    
%        I = imread('alumgrns.tif');
%        I2 = blkproc(I,[8 8],'std2(x)*ones(size(x))');
%        imshow(I)
%        figure, imshow(I2,[])
% 
%    

function col2im
%MATLAB Tour Partial Function Help:  img_con
%
% COL2IM Rearrange matrix columns into blocks.
%    A = COL2IM(B,[M N],[MM NN],'distinct') rearranges each column
%    of B into a distinct M-by-N block to create the matrix A of
%    size MM-by-NN.  If B = [A11(:) A12(:) A21(:) A22(:)], where
%    each column has length M*N, then A = [A11 A12; A21 A22] where
%    each Aij is M-by-N.
% 
%    A = COL2IM(B,[M N],[MM NN],'sliding') rearranges the row
%    vector B into a matrix of size (MM-M+1)-by-(NN-N+1). B must
%    be a vector of size 1-by-(MM-M+1)*(NN-N+1). B is usually the
%    result of processing the output of IM2COL(...,'sliding')
%    using a column compression function (such as SUM).
% 
%    COL2IM(B,[M N],[MM NN]) is the same as COL2IM(B,[M N],[MM
%    NN],'sliding').
% 
%    Class Support
%    -------------
%    B can be of class double or of any integer class. A is of the
%    same class as B.
% 
%    

function colfilt
%MATLAB Tour Partial Function Help:  img_con
%
% COLFILT Perform neighborhood operations using columnwise functions.
%    COLFILT processes distinct or sliding blocks as
%    columns. COLFILT can perform similar operations to BLKPROC
%    and NLFILTER, but often executes much faster.
% 
%    B = COLFILT(A,[M N],BLOCK_TYPE,FUN) processes the image A by
%    rearranging each M-by-N block of A into a column of a
%    temporary matrix, and then applying the function FUN to this
%    matrix. FUN can be an inline function, a text string
%    containing the name of a function, or a string containing an
%    expression. COLFILT zero pads A, if necessary.
% 
%    Before calling FUN, COLFILT calls IM2COL to create the
%    temporary matrix. After calling FUN, COLFILT rearranges the
%    columns of the matrix back into M-by-N blocks using COL2IM.
% 
%    BLOCK_TYPE is a string with one these values:
% 
%         'distinct' for M-by-N distinct blocks
%         'sliding'  for M-by-N sliding neighborhoods
% 
%    B = COLFILT(A,[M N],'distinct',FUN) rearranges each M-by-N
%    distinct block of A in a temporary matrix, and then applies
%    the function FUN to this matrix. FUN must return a matrix of
%    the same size as the temporary matrix. COLFILT then
%    rearranges the columns of the matrix returned by FUN into
%    M-by-N distinct blocks.
% 
%    B = COLFILT(A,[M N],'sliding',FUN) rearranges each M-by-N
%    sliding neighborhood of A into a column in a temporary
%    matrix, and then applies the function FUN to this matrix. FUN
%    must return a row vector containing a single value for each
%    column in the temporary matrix. (Column compression functions
%    such as SUM return the appropriate type of output.) COLFILT
%    then rearranges the vector returned by FUN into a matrix of
%    the same size as A.
% 
%    B = COLFILT(A,[M N],BLOCK_TYPE,FUN,P1,P2,...) passes the
%    additional parameters P1,P2,..., to FUN. COLFILT calls FUN
%    using:
% 
%         Y = FUN(X,P1,P2,...)
% 
%    where X is the temporary matrix before processing, and Y is
%    the temporary matrix after processing.
% 
%    B = COLFILT(A,[M N],[MBLOCK NBLOCK],BLOCK_TYPE,FUN,...)
%    processes the matrix A as above, but in blocks of size
%    MBLOCKS-by-NBLOCKS to save memory. Note that using the
%    [MBLOCK NBLOCK] argument does not change the result of the
%    operation.
% 
%    B = COLFILT(A,'indexed',...) processes A as an indexed image,
%    padding with zeros if the class of A is uint8 or uint16, or 
%    ones if the class of A is double.
% 
%    Class Support
%    -------------
%    The input image A can be of any class supported by FUN. The
%    class of B depends on the class of the output from FUN.
% 
%    Example
%    -------
%        I = imread('tire.tif');
%        imshow(I)
%        I2 = uint8(colfilt(I,[5 5],'sliding','mean'));
%        figure, imshow(I2)
% 
%    

function im2col
%MATLAB Tour Partial Function Help:  img_con
%
% IM2COL Rearrange image blocks into columns.
%    B = IM2COL(A,[M N],'distinct') rearranges each distinct
%    M-by-N block in the image A into a column of B. IM2COL pads A
%    with zeros, if necessary, so its size is an integer multiple
%    of M-by-N. If A = [A11 A12; A21 A22], where each Aij is
%    M-by-N, then B = [A11(:) A12(:) A21(:) A22(:)].
% 
%    B = IM2COL(A,[M N],'sliding') converts each sliding M-by-N
%    block of A into a column of B, with no zero padding. B has
%    M*N rows and will contain as many columns as there are M-by-N
%    neighborhoods in A. If the size of A is [MM NN], then the
%    size of B is (M*N)-by-((MM-M+1)*(NN-N+1). Each column of B
%    contains the neighborhoods of A reshaped as NHOOD(:), where
%    NHOOD is a matrix containing an M-by-N neighborhood of
%    A. IM2COL orders the columns of B so that they can be
%    reshaped to form a matrix in the normal way. For example,
%    suppose you use a function, such as SUM(B), that returns a
%    scalar for each column of B. You can directly store the
%    result in a matrix of size (MM-M+1)-by-(NN-N+1) using these
%    calls: 
% 
%         B = im2col(A,[M N],'sliding');
%         C = reshape(sum(B),MM-M+1,NN-N+1);
% 
%    B = IM2COL(A,[M N]) uses the default block type of
%    'sliding'.
% 
%    B = IM2COL(A,'indexed',...) processes A as an indexed image,
%    padding with zeros if the class of A is uint8, or ones if the
%    class of A is double.
% 
%    Class Support
%    -------------
%    The input image A can be of class double or of any integer
%    class. The output matrix B is of the same class as the
%    input image.
% 
%    

function nlfilter
%MATLAB Tour Partial Function Help:  img_con
%
% NLFILTER Perform general sliding-neighborhood operations.
%    B = NLFILTER(A,[M N],FUN) applies the function FUN to
%    each M-by-N sliding block of A.  FUN may be a string
%    containing the name of a function, a string containing an
%    expression, or an inline function object.  FUN should accept
%    an M-by-N block as input, and return a scalar result:
% 
%        C = FUN(X)
% 
%    C is the output value for the center pixel in the M-by-N
%    block X. NLFILTER calls FUN for each pixel in A. NLFILTER
%    zero pads the M-by-N block at the edges, if necessary.
% 
%    B = NLFILTER(A,[M N],FUN,P1,P2,...) passes the additional
%    parameters P1,P2,..., to FUN.
% 
%    B = NLFILTER(A,'indexed',...) processes A as an indexed image,
%    padding with ones if A is of class double and zeros if A is
%    of class uint8.
% 
%    Class Support
%    -------------
%    The input image A can be of any class supported by FUN. The
%    class of B depends on the class of the output from FUN.
% 
%    Remarks
%    -------
%    NLFILTER can take a long time to process large images. In
%    some cases, the COLFILT function can perform the same
%    operation much faster.
% 
%    Example
%    -------
%    This call produces the same result as calling MEDFILT2 with a
%    3-by-3 neighborhood:
% 
%        B = NLFILTER(A,[3 3],'median(x(:))');
% 
%    

function applylut
%MATLAB Tour Partial Function Help:  img_con
%
% APPLYLUT Perform neighborhood operations using lookup tables.
%    A = APPLYLUT(BW,LUT) performs a 2-by-2 or 3-by-3
%    neighborhood operation on binary image BW by using a lookup
%    table (LUT).  LUT is either a 16-element or 512-element
%    vector returned by MAKELUT.  The vector consists of the
%    output values for all possible 2-by-2 or 3-by-3
%    neighborhoods.
% 
%    The values returned in A depend on the values in LUT. For
%    example, if LUT consists of all 1's and 0's, A is a binary
%    image.
% 
%    Class Support
%    -------------
%    BW and LUT can be of class uint8 or double.  If the class of
%    LUT is uint8, or if the elements of LUT are all integer
%    values between 0 and 255, then the class of A is uint8;
%    otherwise, the class of A is double.
% 
%    Example
%    -------
%    In this example, you perform erosion using a 2-by-2
%    neighborhood. An output pixel is "on" only if all four of the
%    input pixel's neighborhood pixels are "on."
% 
%        lut = makelut('sum(x(:)) == 4', 2);
%        BW1 = imread('text.tif');
%        BW2 = applylut(BW1,lut);
%        imshow(BW1)
%        figure, imshow(BW2)
% 
%    

function bwarea
%MATLAB Tour Partial Function Help:  img_con
%
% BWAREA Compute the area of objects in binary image.
%    TOTAL = BWAREA(BW) estimates the area of the objects in
%    binary image BW. TOTAL is a scalar whose value corresponds
%    roughly to the total number of "on" pixels in the image, but
%    may not be exactly the same because different patterns of
%    pixels are weighted differently.
% 
%    Class Support
%    -------------
%    BW can be of class uint8 or double. TOTAL is of class
%    double.
% 
%    Example
%    -------
%        BW = imread('circles.tif');
%        imshow(BW)
%        bwarea(BW)
% 
%    

function bweuler
%MATLAB Tour Partial Function Help:  img_con
%
% BWEULER Compute the Euler number of binary image.
%    EUL = BWEULER(BW,N) returns the Euler number for the binary
%    image BW. EUL is a scalar whose value is the number of
%    objects in the image minus the total number of holes in those
%    objects.  N can have a value of either 4 or 8, where 4
%    specifies 4-connected objects and 8 specifies 8-connected
%    objects; if the argument is omitted, it defaults to 8. 
% 
%    Class Support
%    -------------
%    BW can be of class uint8 or double. EUL is of class double.
% 
%    Example
%    -------
%        BW = imread('circles.tif');
%        imshow(BW)
%        bweuler(BW)
% 
%    

function bwfill
%MATLAB Tour Partial Function Help:  img_con
%
% BWFILL Fill background regions in binary image.
%    BW2 = BWFILL(BW1,C,R,N) performs a flood-fill operation on
%    the input binary image BW1, starting from the pixel (R,C). If
%    R and C are equal-length vectors, the fill is performed in
%    parallel from the starting locations (R(k),C(k)). N can have
%    a value of either 4 or 8 (the default), where 4 specifies
%    4-connected foreground and 8 specifies 8-connected
%    foreground. The foreground of BW1 comprises the "on" pixels
%    (i.e., having value of 1).
% 
%    BW2 = BWFILL(BW1,N) displays the image BW1 on the screen and
%    lets you select the starting points using the mouse. If you
%    omit BW1, BWFILL operates on the image in the current
%    axes. Use normal button clicks to add points. Press
%    <BACKSPACE> or <DELETE> to remove the previously selected 
%    point. A shift-click, right-click, or double-click selects
%    a final point and then starts the fill; pressing <RETURN>
%    finishes the selection without adding a point.
% 
%    [BW2,IDX] = BWFILL(...) returns the linear indices of all
%    pixels filled by BWFILL.
% 
%    BW2 = BWFILL(X,Y,BW1,Xi,Yi,N) uses the vectors X and Y to
%    establish a nondefault spatial coordinate system for BW1. Xi
%    and Yi are scalars or equal-length vectors that specify
%    locations in this coordinate system.
% 
%    [X,Y,BW2,IDX,Xi,Yi] = BWFILL(...) returns the XData and YData
%    in X and Y; the output image in BW2; linear indices of all
%    filled pixels in IDX; and the fill starting points in Xi and
%    Yi.
% 
%    BW2 = BWFILL(BW1,'holes',N) fills the holes in the binary
%    image BW1. BWFILL automatically determines which pixels are
%    in object holes, and then changes the value of those pixels
%    from 0 to 1. N defaults to 8 if you omit the argument.
% 
%    [BW2,IDX] = BWFILL(BW1,'holes',N) returns the linear indices
%    of all pixels filled in by BWFILL.
% 
%    If BWFILL is used with no output arguments, the resulting
%    image is displayed in a new figure.
% 
%    Remarks
%    -------
%    BWFILL differs from many other binary image operations in
%    that it operates on background pixels, rather than foreground
%    pixels. If the foreground is 8-connected, the background is
%    4-connected, and vice versa. Note, however, that you specify
%    the connectedness of the foreground when you call BWFILL.
% 
%    Class Support
%    -------------
%    The input image BW1 can be double or uint8. The output image
%    BW2 is of class uint8.
% 
%    Examples
%    --------
%        BW1 = [1 0 0 0 0 0 0 0
%               1 1 1 1 1 0 0 0
%               1 0 0 0 1 0 1 0
%               1 0 0 0 1 1 1 0
%               1 1 1 1 0 1 1 1
%               1 0 0 1 1 0 1 0
%               1 0 0 0 1 0 1 0
%               1 0 0 0 1 1 1 0]
%        BW2 = bwfill(BW1,3,3,8)
%        BW3 = bwfill(BW1,'holes');
% 
%        BW4 = ~im2bw(imread('blood1.tif'));
%        BW5 = bwfill(BW4,'holes');
%        imshow(BW4), figure, imshow(BW5)
% 
%    

function bwlabel
%MATLAB Tour Partial Function Help:  img_con
%
% BWLABEL Label connected components in binary image.
%    L = BWLABEL(BW,N) returns a matrix L, of the same size as BW,
%    containing labels for the connected components in BW. N can
%    have a value of either 4 or 8, where 4 specifies 4-connected
%    objects and 8 specifies 8-connected objects; if the argument
%    is omitted, it defaults to 8. 
% 
%    The elements of L are integer values greater than or equal to
%    0.  The pixels labeled 0 are the background.  The pixels
%    labeled 1 make up one object, the pixels labeled 2 make up a
%    second object, and so on. 
% 
%    [L,NUM] = BWLABEL(BW,N) returns in NUM the number of
%    connected objects found in BW.
% 
%    Class Support
%    -------------
%    The input image BW can be of class double or uint8. The
%    output matrix L is of class double.
% 
%    Example
%    -------
%        BW = [1 1 1 0 0 0 0 0
%              1 1 1 0 1 1 0 0
%              1 1 1 0 1 1 0 0
%              1 1 1 0 0 0 1 0
%              1 1 1 0 0 0 1 0
%              1 1 1 0 0 0 1 0
%              1 1 1 0 0 1 1 0
%              1 1 1 0 0 0 0 0];
%        L = bwlabel(BW,4);
%        [r,c] = find(L == 2);
% 
%    

function bwmorph
%MATLAB Tour Partial Function Help:  img_con
%
% BWMORPH Perform morphological operations on binary image.
%    BW2 = BWMORPH(BW1,OPERATION) applies a specific
%    morphological operation to the binary image BW1.  
% 
%    BW2 = BWMORPH(BW1,OPERATION,N) applies the operation N
%    times.  N can be Inf, in which case the operation is repeated
%    until the image no longer changes.
% 
%    OPERATION is a string that can have one of these values:
%       'bothat'   Subtract the input image from its closing
%       'bridge'   Bridge previously unconnected pixels
%       'clean'    Remove isolated pixels (1's surrounded by 0's)
%       'close'    Perform binary closure (dilation followed by
%                    erosion)  
%       'diag'     Diagonal fill to eliminate 8-connectivity of
%                    background
%       'dilate'   Perform dilation using the structuring element
%                    ones(3) 
%       'erode'    Perform erosion using the structuring element
%                    ones(3) 
%       'fill'     Fill isolated interior pixels (0's surrounded by
%                    1's)
%       'hbreak'   Remove H-connected pixels
%       'majority' Set a pixel to 1 if five or more pixels in its
%                    3-by-3 neighborhood are 1's
%       'open'     Perform binary opening (erosion followed by
%                    dilation) 
%       'remove'   Set a pixel to 0 if its 4-connected neighbors
%                    are all 1's, thus leaving only boundary
%                    pixels
%       'shrink'   With N = Inf, shrink objects to points; shrink
%                    objects with holes to connected rings
%       'skel'     With N = Inf, remove pixels on the boundaries
%                    of objects without allowing objects to break
%                    apart
%       'spur'     Remove end points of lines without removing
%                    small objects completely.
%       'thicken'  With N = Inf, thicken objects by adding pixels
%                    to the exterior of objects without connected
%                    previously unconnected objects
%       'thin'     With N = Inf, remove pixels so that an object
%                    without holes shrinks to a minimally
%                    connected stroke, and an object with holes
%                    shrinks to a ring halfway between the hold
%                    and outer boundary
%       'tophat'   Subtract the opening from the input image
% 
%    Class Support
%    -------------
%    The input image BW1 can be of class double or uint8. The
%    output image BW2 is of class uint8.
% 
%    Examples
%    --------
%        BW1 = imread('circles.tif');
%        imshow(BW1)
%        BW2 = bwmorph(BW1,'remove');
%        BW3 = bwmorph(BW1,'skel',Inf);
%        figure, imshow(BW2)
%        figure, imshow(BW3)
% 
%    

function bwperim
%MATLAB Tour Partial Function Help:  img_con
%
% BWPERIM Determine perimeter of objects in binary image.
%    BW2 = BWPERIM(BW1,N) returns a binary image containing
%    only the perimeter pixels of objects in the input image BW1.
%    A pixel is part of the perimeter if its value is 1 and there
%    is at least one zero-valued pixel in its neighborhood.  N can
%    have a value of either 4 or 8, where 4 specifies 4-connected
%    neighborhoods and 8 specifies 8-connected neighborhoods; if
%    the argument if omitted, it defaults to 4.
% 
%    Class Support
%    -------------
%    The input image BW1 can be of class double or uint8.  The
%    output image BW2 is of class uint8.
% 
%    Example
%    -------
%        BW1 = imread('circbw.tif');
%        BW2 = bwperim(BW1,8);
%        imshow(BW1)
%        figure, imshow(BW2)
% 
%    

function bwselect
%MATLAB Tour Partial Function Help:  img_con
%
% BWSELECT Select objects in binary image.
%    BW2 = BWSELECT(BW1,C,R,N) returns a binary image containing
%    the objects that overlap the pixel (R,C). R and C can be
%    scalars or equal-length vectors. If R and C are vectors, BW2
%    contains the set of objects overlapping with any of the
%    pixels (R(k),C(k)). N can have a value of either 4 or 8 (the
%    default), where 4 specifies 4-connected objects and 8
%    specifies 8-connected objects. Objects are connected sets of
%    "on" pixels (i.e., having value of 1).
% 
%    BW2 = BWSELECT(BW1,N) displays the image BW1 on the screen
%    and lets you select the (R,C) coordinates using the mouse. If
%    you omit BW1, BWSELECT operates on the image in the current
%    axes. Use normal button clicks to add points. Pressing
%    <BACKSPACE> or <DELETE> removes the previously selected
%    point. A shift-click, right-click, or double-click selects
%    the final point; pressing <RETURN> finishes the selection
%    without adding a point.
% 
%    [BW2,IDX] = BWSELECT(...) returns the linear indices of the 
%    pixels belonging to the selected objects.
% 
%    BW2 = BWSELECT(X,Y,BW1,Xi,Yi,N) uses the vectors X and Y to
%    establish a nondefault spatial coordinate system for BW1. Xi
%    and Yi are scalars or equal-length vectors that specify
%    locations in this coordinate system.
% 
%    [X,Y,BW2,IDX,Xi,Yi] = BWSELECT(...) returns the XData and
%    YData in X and Y; the output image in BW2; linear indices of
%    the pixels belonging to the selected objects in IDX; and the 
%    specified spatial coordinates Xi and Yi.
% 
%    If bwselect is called with no output arguments, the resulting
%    image is displayed in a new figure.
% 
%    Class Support
%    -------------
%    The input image BW1 can be of class double or uint8. The
%    output image BW2 is of class uint8.
% 
%    Example
%    -------
%        BW1 = imread('text.tif');
%        c = [16 90 144];
%        r = [85 197 247];
%        BW2 = bwselect(BW1,c,r,4);
%        imshow(BW1)
%        figure, imshow(BW2)
% 
%    

function dilate
%MATLAB Tour Partial Function Help:  img_con
%
% DILATE Perform dilation on binary image.
%    BW2 = DILATE(BW1,SE) performs dilation on the binary image
%    BW1, using the binary structuring element SE.  SE is a matrix
%    containing only 1's and 0's.  
% 
%    BW2 = DILATE(BW1,SE,ALG) performs dilation using the
%    specified algorithm.  ALG is a string that can have one of
%    these values:
% 
%      'spatial' - processes the image in the spatial domain. This
%                  algorithm works well for relatively small
%                  images and structuring elements, but for large
%                  images and structuring elements it can be slow.
%                  This is the default algorithm.
%      'frequency' processes the image in the frequency
%                  domain. This algorithm is faster for large
%                  images than 'spatial', but uses much more
%                  memory. 
% 
%    The spatial and frequency algorithms produce the same result,
%    but make different tradeoffs between speed and memory use. If
%    you want to speed up dilation, specify the 'frequency'
%    algorithm. If you receive "out of memory" messages when you
%    perform dilation, specify the 'spatial' algorithm.
% 
%    BW2 = DILATE(BW1,SE,...,N) performs the dilation operation N
%    times.
% 
%    Class Support
%    -------------
%    The input image BW1 can be of class double or uint8.  The
%    output image BW2 is of class uint8.
% 
%    Example
%    -------
%        BW1 = imread('text.tif');
%        SE = ones(6,2);
%        BW2 = dilate(BW1,SE);
%        imshow(BW1)
%        figure, imshow(BW2)
% 
%    

function erode
%MATLAB Tour Partial Function Help:  img_con
%
% ERODE Perform erosion on binary image.
%    BW2 = ERODE(BW1,SE) performs erosion on the binary image
%    BW1 using the binary structuring element SE.  SE is a matrix
%    containing only 1's and 0's.
% 
%    BW2 = ERODE(BW1,SE,ALG) performs erosion using the
%    specified algorithm.  ALG is a string that can have one of
%    these values:
% 
%      'spatial'   (default) - processes the image in the spatial
%                  domain. This algorithm works well for
%                  relatively small images and structuring
%                  elements, but for large images and structuring
%                  elements it can be slow.
% 
%      'frequency' - processes the image in the frequency
%                  domain. This algorithm is faster for large
%                  images and structuring elements than 'spatial',
%                  but uses much more memory. 
% 
%    The spatial and frequency algorithms produce the same result,
%    but make different tradeoffs between speed and memory
%    usage. If you want to speed up erosion, specify the
%    'frequency' algorithm. If you receive "out of memory"
%    messages or if your computer slows down because of disk
%    paging, specify the 'spatial' algorithm.
% 
%    BW2 = ERODE(BW1,SE,...,N) performs the erosion operation N
%    times.
% 
%    Class Support
%    -------------
%    The input image BW1 can be of class double or uint8.  The
%    output image BW2 is of class uint8.
% 
%    Example
%    -------
%        BW1 = imread('text.tif');
%        SE = ones(3,1);
%        BW2 = erode(BW1,SE);
%        imshow(BW1), figure, imshow(BW2)
% 
%    

function makelut
%MATLAB Tour Partial Function Help:  img_con
%
% MAKELUT Construct lookup table for use with APPLYLUT.
%    LUT = MAKELUT(FUN,N) returns a lookup table for use with
%    APPLYLUT.  FUN is either a string containing the name of a
%    function or an inline function object.  The function should
%    take a 2-by-2 or 3-by-3 matrix of 1's and 0's as input and
%    return a scalar.  N is either 2 or 3, indicating the size of
%    the input to FUN.  MAKELUT creates LUT by passing all
%    possible 2-by-2 or 3-by-3 neighborhoods to FUN, one at a
%    time, and constructing either a 16-element vector (for 2-by-2
%    neighborhoods) or a 512-element vector (for 3-by-3
%    neighborhoods).  The vector consists of the output from FUN
%    for each possible neighborhood.
% 
%    LUT = MAKELUT(FUN,N,P1,P2,...) passes the additional
%    parameters P1, P2, ..., to FUN.
% 
%    Class Support
%    -------------
%    LUT is returned as a vector of class double.
% 
%    Example
%    -------
%        f = inline('sum(x(:)) >= 2');
%        lut = makelut(f,2);
% 
%    

function roicolor
%MATLAB Tour Partial Function Help:  img_con
%
% ROICOLOR Select region of interest based on color.
%    ROICOLOR selects a region of interest within an indexed or
%    intensity image and returns a binary image. (You can use the
%    returned image as a mask for masked filtering using
%    ROIFILT2.)
% 
%    BW = ROICOLOR(A,LOW,HIGH) returns a region of interest
%    selected as those pixels that lie within the colormap range
%    [LOW HIGH]:
% 
%        BW = (A >= LOW) & (A <= HIGH);
% 
%    BW is a binary image with 0's outside the region of interest
%    and 1's inside.
% 
%    BW = ROICOLOR(A,V) returns a region of interest selected as
%    those pixels in A that match the values in vector V. BW is a
%    binary image with 1's where the values of A match the values
%    of V.
% 
%    Class Support
%    -------------
%    The input image A can be of class double or of any integer
%    class. The output image BW is of class uint8.
% 
%    Example
%    -------
%        I = imread('rice.tif');
%        BW = roicolor(I,128,255);
%        imshow(I), figure, imshow(BW)
% 
%    

function roifill
%MATLAB Tour Partial Function Help:  img_con
%
% ROIFILL Smoothly interpolate within arbitrary image region.
%    ROIFILL fills in a specified polygon in an intensity
%    image. It smoothly interpolates inward from the pixel values
%    on the boundary of the polygon by solving Laplace's
%    equation. ROIFILL can be used, for example, to "erase" small
%    objects in an image.
% 
%    J = ROIFILL(I,C,R) fills in the polygon specified by C and R,
%    which are equal-length vectors containing the row-column
%    coordinates of the pixels on vertices of the polygon. The
%    k-th vertex is the pixel (R(k),C(k)).
% 
%    J = ROIFILL(I) displays the image I on the screen and lets
%    you specify the polygon using the mouse. If you omit I,
%    ROIFILL operates on the image in the current axes. Use normal
%    button clicks to add vertices to the polygon. Pressing
%    <BACKSPACE> or <DELETE> removes the previously selected
%    vertex. A shift-click, right-click, or double-click adds a
%    final vertex to the selection and then starts the fill;
%    pressing <RETURN> finishes the selection without adding a
%    vertex.
% 
%    J = ROIFILL(I,BW) uses BW (a binary image the same size as I)
%    as a mask. ROIFILL fills in the regions in I corresponding to
%    the nonzero pixels in BW. If there are multiple regions,
%    ROIFILL performs the interpolation on each region
%    independently.
% 
%    [J,BW] = ROIFILL(...) returns the binary mask used to
%    determine which pixels in I get filled. BW is a binary image
%    the same size as I with 1's for pixels corresponding to the
%    interpolated region of I and 0's elsewhere.
% 
%    J = ROIFILL(x,y,I,xi,yi) uses the vectors x and y to
%    establish a nondefault spatial coordinate system. xi and yi
%    are equal-length vectors that specify polygon vertices as
%    locations in this coordinate system.
% 
%    [x,y,J,BW,xi,yi] = ROIFILL(...) returns the XData and YData
%    in x and y; the output image in J; the mask image in BW; and
%    the polygon coordinates in xi and yi. xi and yi are empty if
%    the ROIFILL(I,BW) form is used.
% 
%    If ROIFILL is called with no output arguments, the resulting
%    image is displayed in a new figure.
% 
%    Class Support
%    -------------
%    The input image I can be of class uint8, uint16, or double.
%    The binary mask BW can be of class double or uint8. 
%    The output image J is of the same class as I. All other 
%    inputs and outputs are of class double.
% 
%    Example
%    -------
%        I = imread('eight.tif');
%        c = [222 272 300 270 221 194];
%        r = [21 21 75 121 121 75];
%        J = roifill(I,c,r);
%        imshow(I), figure, imshow(J)
% 
%    

function roifilt2
%MATLAB Tour Partial Function Help:  img_con
%
% ROIFILT2 Filter region of interest.
%    J = ROIFILT2(H,I,BW) filters the data in I with the 2-D
%    linear filter H. BW is a binary image the same size as I that
%    is used as a mask for filtering. ROIFILT2 returns an image
%    that consists of filtered values for pixels in locations
%    where BW contains 1's, and unfiltered values for pixels in 
%    locations where BW contains 0's. For this syntax, ROIFILT2
%    calls FILTER2 to implement the filter.
% 
%    J = ROIFILT2(I,BW,FUN) processes the data in I using the
%    function FUN. The result J contains computed values for
%    pixels in locations where BW contains 1's, and the actual
%    values in I for pixels in locations where BW contains 0's.
% 
%    FUN can be a string containing the name of a function, a
%    string containing an expression, or an inline function
%    object. FUN should take a matrix as a single argument and
%    return a matrix of the same size:
% 
%        y = FUN(x)
% 
%    J = ROIFILT2(I,BW,FUN,P1,P2,...) passes the additional
%    parameters P1,P2,..., to FUN.
% 
%    Class Support
%    -------------
%    For the syntax that includes a filter H, the input image can
%    be of class uint8, uint16, or double, and the output array J 
%    is of class double. For the syntax that includes a function, 
%    I can be of any class supported by FUN, and the class of J 
%    depends on the class of the output from FUN.
% 
%    Example
%    -------
%        I = imread('eight.tif');
%        c = [222 272 300 270 221 194];
%        r = [21 21 75 121 121 75];
%        BW = roipoly(I,c,r);
%        h = fspecial('unsharp');
%        J = roifilt2(h,I,BW);
%        imshow(I), figure, imshow(J)
% 
%    

function roipoly
%MATLAB Tour Partial Function Help:  img_con
%
% ROIPOLY Select polygonal region of interest.
%    Use ROIPOLY to select a polygonal region of interest within
%    an image. ROIPOLY returns a binary image that you can use as
%    a mask for masked filtering.
% 
%    BW = ROIPOLY(I,C,R) returns the region of interest selected
%    by the polygon described by vectors C and R. BW is a binary
%    image the same size as I with 0's outside the region of
%    interest and 1's inside.
% 
%    BW = ROIPOLY(I) displays the image I on the screen and lets
%    you specify the polygon using the mouse. If you omit I,
%    ROIPOLY operates on the image in the current axes. Use normal
%    button clicks to add vertices to the polygon. Pressing
%    <BACKSPACE> or <DELETE> removes the previously selected
%    vertex. A shift-click, right-click, or double-click adds a
%    final vertex to the selection and then starts the fill;
%    pressing <RETURN> finishes the selection without adding a
%    vertex.
% 
%    BW = ROIPOLY(x,y,I,xi,yi) uses the vectors x and y to
%    establish a nondefault spatial coordinate system. xi and yi
%    are equal-length vectors that specify polygon vertices as
%    locations in this coordinate system.
% 
%    [BW,xi,yi] = ROIPOLY(...) returns the polygon coordinates in
%    xi and yi. Note that ROIPOLY always produces a closed
%    polygon. If the points specified describe a closed polygon
%    (i.e., if the last pair of coordinates is identical to the
%    first pair), the length of xi and yi is equal to the number
%    of points specified. If the points specified do not describe
%    a closed polygon, ROIPOLY adds a final point having the same
%    coordinates as the first point. (In this case the length of
%    xi and yi is one greater than the number of points
%    specified.)
% 
%    [x,y,BW,xi,yi] = ROIPOLY(...) returns the XData and YData in
%    x and y; the mask image in BW; and the polygon coordinates in
%    xi and yi.
% 
%    If ROIPOLY is called with no output arguments, the resulting
%    image is displayed in a new figure.
% 
%    Class Support
%    -------------
%    The input image I can be of class uint8, uint16, or double. 
%    The output image BW is of class uint8. All other inputs and 
%    outputs are of class double.
% 
%    Remarks
%    -------
%    For any of the ROIPOLY syntaxes, you can replace the input
%    image I with two arguments, M and N, that specify the row and
%    column dimensions of an arbitrary image. If you specify M and
%    N with an interactive form of ROIPOLY, an M-by-N black image
%    is displayed, and you use the mouse to specify a polygon with
%    this image.
% 
%    Example
%    -------
%        I = imread('eight.tif');
%        c = [222 272 300 270 221 194];
%        r = [21 21 75 121 121 75];
%        BW = roipoly(I,c,r);
%        imshow(I), figure, imshow(BW)
% 
%    

function brighten
%MATLAB Tour Partial Function Help:  img_con
%
% BRIGHTEN Brighten or darken color map.
%    BRIGHTEN(BETA) replaces the current color map with a brighter
%    or darker map involving essentially the same colors.  The map is
%    brighter if 0 < BETA <= 1 and darker if -1 <= BETA < 0.
% 
%    BRIGHTEN(BETA), followed by BRIGHTEN(-BETA) restores the
%    original map.
%    
%    MAP = BRIGHTEN(BETA) returns a brighter or darker version of the
%    color map currently being used without changing the display.
% 
%    NEWMAP = BRIGHTEN(MAP,BETA) returns a brighter or darker version
%    of the specified color map without changing the display.
% 
%    BRIGHTEN(FIG,BETA) brightens all the objects in the figure FIG.

function cmpermute
%MATLAB Tour Partial Function Help:  img_con
%
% CMPERMUTE Rearrange colors in colormap.
%    [Y,NEWMAP] = CMPERMUTE(X,MAP) randomly reorders the colors in
%    MAP to produce a new colormap NEWMAP. CMPERMUTE also
%    modifies the values in X to maintain correspondence between
%    the indices and the colormap, and returns the result in
%    Y. The image Y and associated colormap NEWMAP produce the
%    same image as X and MAP.
% 
%    [Y,NEWMAP] = CMPERMUTE(X,MAP,INDEX) uses an ordering matrix
%    (such as the second output of SORT) to define the order of
%    colors in the new colormap.
% 
%    For example, to order a colormap by luminance, use:
% 
%       ntsc = rgb2ntsc(map);
%       [dum,index] = sort(ntsc(:,1));
%       [Y,newmap] = cmpermute(X,map,index);
% 
%    Class Support
%    -------------
%    The input image X can be of class uint8 or double. Y is
%    returned as an array of the same class as X.
% 
%    Example
%    -------
%    This example orders a colormap by luminance
% 
%        load trees
%        ntsc = rgb2ntsc(map);
%        [dum,index] = sort(ntsc(:,1));
%        [Y,newmap] = cmpermute(X,map,index);
%        imshow(X,map), figure, imshow(Y,newmap)
% 
%    

function cmunique
%MATLAB Tour Partial Function Help:  img_con
%
% CMUNIQUE Find unique colormap colors and corresponding image.
%    [Y,NEWMAP] = CMUNIQUE(X,MAP) returns the indexed image Y and 
%    associated colormap NEWMAP that produce the same image as
%    (X,MAP) but with the smallest possible colormap. CMUNIQUE
%    removes duplicate rows from the colormap and adjusts the
%    indices in the image matrix accordingly.
% 
%    [Y,NEWMAP] = CMUNIQUE(RGB) converts the truecolor image RGB
%    to the indexed image Y and its associated colormap
%    NEWMAP. NEWMAP is the smallest possible colormap for the
%    image, containing one entry for each unique color in
%    RGB. (Note that NEWMAP may be very large, as much as P-by-3
%    where P is the number of pixels in RGB.) 
% 
%    [Y,NEWMAP] = CMUNIQUE(I) converts the intensity image I to an
%    indexed image Y and its associated colormap NEWMAP. NEWMAP is
%    the smallest possible colormap for the image, containing one
%    entry for each unique intensity level in I. 
% 
%    Class Support
%    -------------
%    The input image can be of class uint8, uint16, or double. 
%    The class of the output image Y is uint8 if the length of 
%    NEWMAP is less than or equal to 256. If the length of 
%    NEWMAP is greater than 256, Y is of class double.
% 
%    

function colormap
%MATLAB Tour Partial Function Help:  img_con
%
% COLORMAP Color look-up table.
%    COLORMAP(MAP) sets the current figure's colormap to MAP.
%    COLORMAP('default') sets the current figure's colormap to
%    the root's default, whose setting is JET.
%    MAP = COLORMAP retrieves the current colormap. The values
%    are in the range from 0 to 1.
% 
%    A color map matrix may have any number of rows, but it must have
%    exactly 3 columns.  Each row is interpreted as a color, with the
%    first element specifying the intensity of red light, the second 
%    green, and the third blue.  Color intensity can be specified on the
%    interval 0.0 to 1.0.
%    For example, [0 0 0] is black, [1 1 1] is white, 
%    [1 0 0] is pure red, [.5 .5 .5] is gray, and
%    [127/255 1 212/255] is aquamarine.
%    
%    Graphics objects that use pseudocolor  -- SURFACE and PATCH objects,
%    which are created by the functions MESH, SURF, and PCOLOR -- map
%    a color matrix, C, whose values are in the range [Cmin, Cmax],
%    to an array of indices, k, in the range [1, m].
%    The values of Cmin and Cmax are either min(min(C)) and max(max(C)),
%    or are specified by CAXIS.  The mapping is linear, with Cmin
%    mapping to index 1 and Cmax mapping to index m.  The indices are
%    then used with the colormap to determine the color associated
%    with each matrix element.  See CAXIS for details.
%  
%    Type HELP GRAPH3D to see a number of useful colormaps.
% 
%    COLORMAP is an M-file that sets the Colormap property of the current
%    figure.
% 
%    

function imapprox
%MATLAB Tour Partial Function Help:  img_con
%
% IMAPPROX Approximate indexed image by one with fewer colors.
%    [Y,NEWMAP] = IMAPPROX(X,MAP,N) approximates the colors in the
%    indexed image X and associated colormap MAP by using minimum
%    variance quantization. IMAPPROX returns indexed image Y with
%    colormap NEWMAP, which has at most N colors.
% 
%    [Y,NEWMAP] = IMAPPROX(X,MAP,TOL) approximates the colors in X
%    and MAP through uniform quantization. NEWMAP contains at most
%    (FLOOR(1/TOL)+1)^3 colors.  TOL must be between 0 and 1.0.
% 
%    Y = IMAPPROX(X,MAP,NEWMAP) approximates the colors in MAP by
%    using colormap mapping to find the colors in NEWMAP that best
%    match the colors in MAP.
% 
%    Y = IMAPPROX(...,DITHER_OPTION) enables or disables
%    dithering. DITHER_OPTION is a string that can have one of
%    these values:
% 
%        'dither'   dithers, if necessary, to achieve better color
%                   resolution at the expense of spatial
%                   resolution (default)
% 
%        'nodither' maps each color in the original image to the
%                   closest color in the new map. No dithering is
%                   performed.
% 
%    Class Support
%    -------------
%    The input image X can be of class uint8, uint16, or double. 
%    The output image Y is of class uint8 if the length of NEWMAP 
%    is less than or equal to 256. If the length of NEWMAP is 
%    greater than 256, X is of class double.
% 
%    

function rgbplot
%MATLAB Tour Partial Function Help:  img_con
%
% RGBPLOT Plot color map.
%    RGBPLOT(MAP) plots a color map, i.e. an m-by-3 matrix which
%    is appropriate input for COLORMAP. The three columns of the
%    colormap matrix are plotted in red, green, and blue lines.
% 
%    

function hsv2rgb
%MATLAB Tour Partial Function Help:  img_con
%
% HSV2RGB Convert hue-saturation-value colors to red-green-blue.
%    M = HSV2RGB(H) converts an HSV color map to an RGB color map.
%    Each map is a matrix with any number of rows, exactly three columns,
%    and elements in the interval 0 to 1.  The columns of the input matrix,
%    H, represent hue, saturation and value, respectively.  The columns of
%    the resulting output matrix, M, represent intensity of red, blue and
%    green, respectively.
% 
%    RGB = HSV2RGB(HSV) converts the HSV image HSV (3-D array) to the
%    equivalent RGB image RGB (3-D array).
% 
%    As the hue varies from 0 to 1, the resulting color varies from
%    red, through yellow, green, cyan, blue and magenta, back to red.
%    When the saturation is 0, the colors are unsaturated; they are
%    simply shades of gray.  When the saturation is 1, the colors are
%    fully saturated; they contain no white component.  As the value
%    varies from 0 to 1, the brightness increases.
% 
%    The colormap HSV is hsv2rgb([h s v]) where h is a linear ramp
%    from 0 to 1 and both s and v are all 1's.
% 
%    

function ntsc2rgb
%MATLAB Tour Partial Function Help:  img_con
%
% NTSC2RGB Convert NTSC values to RGB color space.
%    RGBMAP = NTSC2RGB(YIQMAP) converts the M-by-3 NTSC
%    (television) values in the colormap YIQMAP to RGB color
%    space. If YIQMAP is M-by-3 and contains the NTSC luminance
%    (Y) and chrominance (I and Q) color components as columns,
%    then RGBMAP is an M-by-3 matrix that contains the red, green,
%    and blue values equivalent to those colors.  Both RGBMAP and
%    YIQMAP contain intensities in the range 0.0 to 1.0. The
%    intensity 0.0 corresponds to the absence of the component,
%    while the intensity 1.0 corresponds to full saturation of the
%    component.
% 
%    RGB = NTSC2RGB(YIQ) converts the NTSC image YIQ to the
%    equivalent truecolor image RGB.
% 
%    Class Support
%    -------------
%    The input image or colormap must be of class double. The
%    output is of class double.
% 
%    

function rgb2hsv
%MATLAB Tour Partial Function Help:  img_con
%
% RGB2HSV Convert red-green-blue colors to hue-saturation-value.
%    H = RGB2HSV(M) converts an RGB color map to an HSV color map.
%    Each map is a matrix with any number of rows, exactly three columns,
%    and elements in the interval 0 to 1.  The columns of the input matrix,
%    M, represent intensity of red, blue and green, respectively.  The
%    columns of the resulting output matrix, H, represent hue, saturation
%    and color value, respectively.
% 
%    HSV = RGB2HSV(RGB) converts the RGB image RGB (3-D array) to the
%    equivalent HSV image HSV (3-D array).
% 
%    CLASS SUPPORT
%    -------------
%    If the input is an RGB image, it can be of class uint8, uint16, or 
%    double; the output image is of class double.  If the input is a 
%    colormap, the input and output colormaps are both of class double.
%  
%    

function rgb2ntsc
%MATLAB Tour Partial Function Help:  img_con
%
% RGB2NTSC Convert RGB values to NTSC colorspace.
%    YIQMAP = RGB2NTSC(RGBMAP) converts the M-by-3 RGB values in
%    RGBMAP to NTSC colorspace. YIQMAP is an M-by-3 matrix that
%    contains the NTSC luminance (Y) and chrominance (I and Q)
%    color components as columns that are equivalent to the colors
%    in the RGB colormap.
% 
%    YIQ = RGB2NTSC(RGB) converts the truecolor image RGB to the
%    equivalent NTSC image YIQ.
% 
%    Class Support
%    -------------
%    If the input is an RGB image, it can be of class uint8,
%    uint16 or double; the output image is of class double. If 
%    the input is a colormap, the input and output colormaps 
%    are both of class double.
% 
%    

function rgb2ycbcr
%MATLAB Tour Partial Function Help:  img_con
%
% RGB2YCBCR Convert RGB values to YCBCR color space.
%    YCBCRMAP = RGB2YCBCR(RGBMAP) converts the RGB values in RGBMAP to
%    the YCBCR color space.  YCBCRMAP is a M-by-3 matrix that contains
%    the YCBCR luminance (Y) and chrominance (Cb and Cr) color values as
%    columns.  Each row represents the equivalent color to the
%    corresponding row in the RGB colormap.
% 
%    YCBCR = RGB2YCBCR(RGB) converts the truecolor image RGB to the
%    equivalent image in the YCBCR color space.
% 
%    Class Support
%    -------------
%    If the input is an RGB image, it can be of class uint8, uint16,
%    or double; the output image is of the same class as the input 
%    image.  If the input is a colormap, the input and output colormaps 
%    are both of class double.
% 
%    

function ycbcr2rgb
%MATLAB Tour Partial Function Help:  img_con
%
% YCBCR2RGB Convert YCbCr values to RGB color space.
%    RGBMAP = YCBCR2RGB(YCBCRMAP) converts the YCbCr values in the
%    colormap YCBCRMAP to the RGB color space. If YCBCRMAP is M-by-3 and
%    contains the YCbCr luminance (Y) and chrominance (Cb and Cr) color
%    values as columns, then RGBMAP is an M-by-3 matrix that contains
%    the red, green, and blue values equivalent to those colors.
% 
%    RGB = YCBCR2RGB(YCBCR) converts the YCbCr image to the equivalent
%    truecolor image RGB.
% 
%    Class Support
%    -------------
%    If the input is a YCbCr image, it can be of class uint8, uint16,
%    or double; the output image is of the same class as the input 
%    image.  If the input is a colormap, the input and output 
%    colormaps are both of class double.
% 
%    

function dither
%MATLAB Tour Partial Function Help:  img_con
%
% DITHER Convert image using dithering.
%    X = DITHER(RGB,MAP) creates an indexed image approximation of
%    the RGB image in the array RGB by dithering the colors in
%    colormap MAP.
% 
%    X = DITHER(RGB,MAP,Qm,Qe) creates an indexed image from RGB,
%    specifying the parameters Qm and Qe. Qm specifies the number
%    of quantization bits to use along each color axis for the
%    inverse color map, and Qe specifies the number of
%    quantization bits to use for the color space error
%    calculations.  If Qe < Qm, dithering cannot be performed and
%    an undithered indexed image is returned in X.  If you omit
%    these parameters, DITHER uses the default values Qm = 5, 
%    Qe = 8.
% 
%    BW = DITHER(I) converts the intensity image in the matrix I
%    to the binary image BW by dithering.
% 
%    Class Support
%    -------------
%    The input image (RGB or I) can be of class uint8, uint16, or
%    double. All other input arguments must be of class
%    double. The output image (X or BW) is of class uint8 if it is
%    a binary image or if it an indexed image with 256 or fewer
%    colors; otherwise its class is double.
% 
%    

function gray2ind
%MATLAB Tour Partial Function Help:  img_con
%
% GRAY2IND Convert intensity image to indexed image.
%    GRAY2IND scales, then rounds, an intensity image to produce
%    an equivalent indexed image.
% 
%    [X,MAP] = GRAY2IND(I,N) converts the intensity image I to an
%    indexed image X with colormap GRAY(N). If N is omitted, it
%    defaults to 64.
% 
%    Class Support
%    -------------
%    The input image I can be of class uint8, uint16, or double. 
%    The class of the output image X is uint8 if the colormap 
%    length is less than or equal to 256. If the colormap length 
%    is greater than256, X is of class double.
% 
%    

function grayslice
%MATLAB Tour Partial Function Help:  img_con
%
% GRAYSLICE Create indexed image from intensity image by thresholding.
%    X=GRAYSLICE(I,N) thresholds the intensity image I using
%    threshold values 1/n, 2/n, ..., (n-1)/n, returning an indexed
%    image in X.
% 
%    X=GRAYSLICE(I,V), where V is a vector of values between 0 and
%    1, thresholds I using the values of V as thresholds,
%    returning an indexed image in X.
% 
%    You can view the thresholded image using IMSHOW(X,MAP) with a
%    colormap of appropriate length.
% 
%    Class Support
%    -------------
%    The input image I can be of class uint8, uint16, or double. 
%    Note that the threshold values are always between 0 and 1, 
%    even if I is of class uint8 or uint16. In this case, each 
%    threshold value is multiplied by 255 or 65535 to determine 
%    the actual threshold to use.
% 
%    The class of the output image X depends on the number of
%    threshold values, as specified by N or length(V). If the
%    number of threshold values is less than 256, then X is of
%    class uint8, and the values in X range from 0 to N or
%    length(V). If the number of threshold values is 256 or
%    greater, X is of class double, and the values in X range from
%    1 to N+1 or length(V)+1.
% 
%    Example
%    -------
%    Use multilevel thresholding to enhance the intelligibility of
%    an astronomical image.
% 
%        I = imread('ngc4024m.tif');
%        X = grayslice(I,16);
%        imshow(I), figure, imshow(X,hot(16))
% 
%    

function im2bw
%MATLAB Tour Partial Function Help:  img_con
%
% IM2BW Convert image to binary image by thresholding.
%    IM2BW produces binary images from indexed, intensity, or RGB
%    images. To do this, it converts the input image to grayscale
%    format (if it is not already an intensity image), and then
%    converts this grayscale image to binary by thresholding. The
%    output binary image BW has values of 0 (black) for all pixels
%    in the input image with luminance less than LEVEL and 1
%    (white) for all other pixels. (Note that you specify LEVEL in
%    the range [0,1], regardless of the class of the input image.)
%   
%    BW = IM2BW(I,LEVEL) converts the intensity image I to black
%    and white.
% 
%    BW = IM2BW(X,MAP,LEVEL) converts the indexed image X with
%    colormap MAP to black and white.
% 
%    BW = IM2BW(RGB,LEVEL) converts the RGB image RGB to black and
%    white.
% 
%    Class Support
%    -------------
%    The input image can be of class uint8, uint16, or double. 
%    The output image BW is of class uint8.
% 
%    Example
%    -------
%    load trees
%    BW = im2bw(X,map,0.4);
%    imshow(X,map), figure, imshow(BW)
% 
%    

function im2double
%MATLAB Tour Partial Function Help:  img_con
%
% IM2DOUBLE Convert image to double precision.
%    IM2DOUBLE takes an image as input, and returns an image of
%    class double.  If the input image is of class double, the
%    output image is identical to it.  If the input image is of
%    class uint8 or uint16, im2double returns the equivalent 
%    image of class double, rescaling or offsetting the data 
%    as necessary.
% 
%    I2 = IM2DOUBLE(I1) converts the intensity image I1 to double
%    precision, rescaling the data if necessary.
% 
%    RGB2 = IM2DOUBLE(RGB1) converts the truecolor image RGB1 to
%    double precision, rescaling the data if necessary.
% 
%    BW2 = IM2DOUBLE(BW1) converts the binary image BW1 to double
%    precision.
% 
%    X2 = IM2DOUBLE(X1,'indexed') converts the indexed image X1 to
%    double precision, offsetting the data if necessary.
%  
%    

function im2uint8
%MATLAB Tour Partial Function Help:  img_con
%
% IM2UINT8 Convert image to eight-bit unsigned integers.
%    IM2UINT8 takes an image as input, and returns an image of
%    class uint8.  If the input image is of class uint8, the
%    output image is identical to it.  If the input image is of
%    class double or uint16 , im2uint8 returns the equivalent
%    image of class uint8, rescaling or offsetting the data as
%    necessary.
% 
%    I2 = IM2UINT8(I1) converts the intensity image I1 to uint8,
%    rescaling the data if necessary.
% 
%    RGB2 = IM2UINT8(RGB1) converts the truecolor image RGB1 to
%    uint8, rescaling the data if necessary.
% 
%    BW2 = IM2UINT8(BW1) converts the binary image BW1 to uint8.
% 
%    X2 = IM2UINT8(X1,'indexed') converts the indexed image X1 to
%    uint8, offsetting the data if necessary. Note that it is
%    not always possible to convert an indexed image to
%    uint8. If X1 is double, then the maximum value of X1 must
%    be 256 or less.  If X1 is uint16, the maximum value of X1
%    must be 255 or less.
% 
%    

function im2uint16
%MATLAB Tour Partial Function Help:  img_con
%
% IM2UINT16 Convert image to sixteen-bit unsigned integers.
%    IM2UINT16 takes an image as input, and returns an image of
%    class uint16.  If the input image is of class uint16, the
%    output image is identical to it.  If the input image is of
%    class double or uint8, IM2UINT16 returns the equivalent
%    image of class uint16, rescaling or offsetting the data as
%    necessary.
% 
%    I2 = IM2UINT16(I1) converts the intensity image I1 to uint16,
%    rescaling the data if necessary.
% 
%    RGB2 = IM2UINT16(RGB1) converts the truecolor image RGB1 to
%    uint16, rescaling the data if necessary.
% 
%    X2 = IM2UINT16(X1,'indexed') converts the indexed image X1 to
%    uint16, offsetting the data if necessary.  If X1 is double,
%    then the maximum value of X1 must be 65536 or less.
% 
%    

function ind2gray
%MATLAB Tour Partial Function Help:  img_con
%
% IND2GRAY Convert indexed image to intensity image.
%    I = IND2GRAY(X,MAP) converts the image X with colormap MAP
%    to an intensity image I. IND2GRAY removes the hue and
%    saturation information while retaining the luminance.
% 
%    Class Support
%    -------------
%    X can be of class uint8, uint16, or double. I is of class 
%    double.
% 
%    Example
%    -------
%        load trees
%        I = ind2gray(X,map);
%        imshow(X,map), figure, imshow(I)
% 
%    

function ind2rgb
%MATLAB Tour Partial Function Help:  img_con
%
% IND2RGB Convert indexed image to RGB image.
%    RGB = IND2RGB(X,MAP) converts the matrix X and corresponding
%    colormap MAP to RGB (truecolor) format.
% 
%    Class Support
%    -------------
%    X can be of class uint8, uint16, or double. RGB is an 
%    M-by-N-by-3 array of class double.
% 
%    

function isbw
%MATLAB Tour Partial Function Help:  img_con
%
% ISBW Return true for binary image.
%    FLAG = ISBW(A) returns 1 if A is a binary image and 0
%    otherwise.
% 
%    ISBW uses these criteria to decide if A is a binary image:
% 
%    - if A is of class double, all values must be either 0 or 1,
%      and the number of dimensions of A must be 2.
% 
%    - If A is of class uint8, its logical flag must be on, and
%      the number of dimensions of A must be 2.
% 
%    - If A is of class uint16, it is not a binary image. (The
%      toolbox does not support uint16 binary images.)
% 
%    Note that a four-dimensional array that contains multiple
%    binary images returns 0, not 1.
% 
%    Class Support
%    -------------
%    A can be of class uint8, uint16, or double.
% 
%    

function isgray
%MATLAB Tour Partial Function Help:  img_con
%
% ISGRAY Return true for intensity image.
%    FLAG = ISGRAY(A) returns 1 if A is a grayscale intensity
%    image and 0 otherwise.
% 
%    ISGRAY uses these criteria to decide if A is an intensity
%    image:
% 
%    - If A is of class double, all values must be in the range
%      [0,1], and the number of dimensions of A must be 2.
% 
%    - If A is of class uint8 or uint16, the number of 
%      dimensions of A must be 2.
% 
%    Class Support
%    -------------
%    A can be of class uint8, uint16, or double.
% 
%    

function isind
%MATLAB Tour Partial Function Help:  img_con
%
% ISIND Return true for indexed image.
%    FLAG = ISIND(A) returns 1 if A is an indexed image and 0
%    otherwise. 
% 
%    ISIND uses these criteria to determine if A is an indexed
%    image:
% 
%    - If A is of class double, all values in A must be integers
%      greater than or equal to 1, and the number of dimensions of
%      A must be 2.
% 
%    - If A is of class uint8, its logical flag must be off, and
%      the number of dimensions of A must be 2.
%  
%    - If A is of class uint16, the number of dimensions must be
%      2.
% 
%    Note that a four-dimensional array that contains multiple
%    indexed images returns 0, not 1.
% 
%    Class Support
%    -------------
%    A can be of class uint8, uint16, or double.
% 
%    

function isrgb
%MATLAB Tour Partial Function Help:  img_con
%
% ISRGB Return true for RGB image.
%    FLAG = ISRGB(A) returns 1 if A is an RGB truecolor image and
%    0 otherwise.
% 
%    ISRGB uses these criteria to determine if A is an RGB image:
% 
%    - If A is of class double, all values must be in the range
%      [0,1], and A must be M-by-N-by-3.
% 
%    - If A is of class uint8 or uint16, A must be M-by-N-by-3.
% 
%    Note that a four-dimensional array that contains multiple RGB
%    images returns 0, not 1.
% 
%    Class Support
%    -------------
%    A can be of class uint8, uint16, or double.
% 
%    

function mat2gray
%MATLAB Tour Partial Function Help:  img_con
%
% MAT2GRAY Convert matrix to intensity image.
%    I = MAT2GRAY(A,[AMIN AMAX]) converts the matrix A to the
%    intensity image I.  The returned matrix I contains values in 
%    the range 0.0 (black) to 1.0 (full intensity or white).
%    AMIN and AMAX are the values in A that correspond to 0.0 and
%    1.0 in I.
% 
%    I = MAT2GRAY(A) sets the values of AMIN and AMAX to the
%    minimum and maximum values in A.
% 
%    Class Support
%    -------------
%    The input array A and the output image I are of class
%    double.
% 
%    Example
%    -------
%        I = imread('rice.tif');
%        J = filter2(fspecial('sobel'), I);
%        K = mat2gray(J);
%        imshow(I), figure, imshow(K)
% 
%    

function rgb2gray
%MATLAB Tour Partial Function Help:  img_con
%
% RGB2GRAY Convert RGB image or colormap to grayscale.
%    RGB2GRAY converts RGB images to grayscale by eliminating the
%    hue and saturation information while retaining the
%    luminance.
% 
%    I = RGB2GRAY(RGB) converts the truecolor image RGB to the
%    grayscale intensity image I.
% 
%    NEWMAP = RGB2GRAY(MAP) returns a grayscale colormap
%    equivalent to MAP.
% 
%    Class Support
%    -------------
%    If the input is an RGB image, it can be of class uint8, 
%    uint16 or double; the output image I is of the same class 
%    as the input image. If the input is a colormap, the input 
%    and output colormaps are both of class double.
% 
%    

function rgb2ind
%MATLAB Tour Partial Function Help:  img_con
%
% RGB2IND Convert RGB image to indexed image.
%    RGB2IND converts RGB images to indexed images using one of
%    three different methods: uniform quantization, minimum
%    variance quantization, and colormap approximation. RGB2IND
%    dithers the image unless you specify 'nodither' for
%    DITHER_OPTION.
% 
%    [X,MAP] = RGB2IND(RGB,N) converts the RGB image to an indexed
%    image X using minimum variance quantization. MAP contains at
%    most N colors.
% 
%    X = RGB2IND(RGB,MAP) converts the RGB image to an indexed
%    image X with colormap MAP by matching colors in RGB with the
%    nearest color in the colormap MAP.
% 
%    [X,MAP] = RGB2IND(RGB,TOL) converts the RGB image to an
%    indexed image X using uniform quantization. MAP contains at
%    most (FLOOR(1/TOL)+1)^3 colors. TOL must be between 0.0 and
%    1.0.
% 
%    [...] = RGB2IND(...,DITHER_OPTION) enables or disables
%    dithering. DITHER_OPTION is a string that can have one of
%    these values:
% 
%        'dither'   dithers, if necessary, to achieve better color
%                   resolution at the expense of spatial
%                   resolution (default)
% 
%        'nodither' maps each color in the original image to the
%                   closest color in the new map. No dithering is
%                   performed.
% 
%    Class Support
%    -------------
%    The input image can be of class uint8, uint16, or
%    double. The output image is of class uint8 if the length
%    of MAP is less than or equal to 256, or double otherwise.
% 
%    Example
%    -------
%        RGB = imread('flowers.tif');
%        [X,map] = rgb2ind(RGB,128);
%        imshow(X,map)
% 
%    

function iptgetpref
%MATLAB Tour Partial Function Help:  img_con
%
% IPTGETPREF Get Image Processing Toolbox preference.
%    VALUE = IPTGETPREF(PREFNAME) returns the value of the Image
%    Processing Toolbox preference specified by the string
%    PREFNAME.  Valid preference names are 'ImshowBorder' and
%    'ImshowAxesVisible'.  Preference names are case insensitive
%    and can be abbreviated.
% 
%    IPTGETPREF without an input argument displays the current
%    setting of all Image Processing Toolbox preferences.
% 
%    Example
%    -------
%        value = iptgetpref('ImshowAxesVisible')
% 
%    

function iptsetpref
%MATLAB Tour Partial Function Help:  img_con
%
% IPTSETPREF Set Image Processing Toolbox preference.
%    IPTSETPREF(PREFNAME,VALUE) sets the Image Processing Toolbox
%    preference specified by the string PREFNAME to VALUE. The
%    setting persists until the end of the current MATLAB session,
%    or until you change the setting. (To make the value persist
%    between sessions, put the command in your startup.m file.)
% 
%    Preference names are case insensitive and can be
%    abbreviated.
% 
%    The following preference values can be set:
% 
%    'ImshowBorder'        'loose' (default) or 'tight'
% 
%         If 'ImshowBorder' is 'loose', IMSHOW displays images
%         with a border between the image and the edges of the
%         figure window, thus leaving room for axes labels,
%         titles, etc. If 'ImshowBorder' is 'tight', then IMSHOW
%         adjusts the figure size so that the image entirely fills
%         the figure. (However, there may still be a border if the
%         image is very small, or if there are other objects
%         besides the image and its axes in the figure.)
% 
%    'ImshowAxesVisible'   'on' or 'off' (default)
% 
%         If 'ImshowAxesVisible' is 'on', IMSHOW displays images
%         with the axes box and tick labels.  If
%         'ImShowAxesVisible' is 'off', IMSHOW displays images
%         without the axes box and tick labels.
% 
%    'ImshowTruesize'      'auto' (default) or 'manual'
% 
%         If 'ImshowTruesize' is 'manual', IMSHOW does not call
%         TRUESIZE. If 'ImshowTruesize' is 'auto', IMSHOW
%         automatically decides whether to call TRUESIZE. (IMSHOW
%         calls TRUESIZE if there will be no other objects in the
%         resulting figure besides the image and it axes.) You can
%         override this setting for an individual display by
%         specifying the DISPLAY_OPTION argument to IMSHOW, or you
%         can call TRUESIZE manually after displaying the image.
% 
%    'TruesizeWarning'     'on' (default) or 'off'
% 
%         If 'TruesizeWarning' is 'on', TRUESIZE displays a
%         warning if the image is too large to fit on the
%         screen. If 'TruesizeWarning' is 'off', TRUESIZE does not
%         display the warning. Note that this preference applies
%         even when you call TRUESIZE indirectly, such as through
%         IMSHOW.
% 
%    IPTSETPREF(PREFNAME) displays the valid values for PREFNAME.
% 
%    Example
%    -------
%        iptsetpref('ImshowBorder', 'tight')
% 
%    

function dctdemo
%MATLAB Tour Partial Function Help:  img_con
%
% DCTDEMO 2-D DCT image compression demo.
%                                                                          
%    This demo lets you explore image compression using the 2-D
%    discrete cosine transform (DCT).  The original image is 
%    transformed in 8-by-8 blocks and then inverse transformed in 
%    8-by-8 blocks to create the reconstructed image.  The inverse 
%    DCT is performed using the subset of DCT coefficients that 
%    are shown in white.  The error image (the difference between
%    the original and reconstructed image) is also displayed.
%                                                                        
%    Use the slider to select a subset of the DCT coefficients and then 
%    press the "Apply" button to produce the corresponding reconstructed  
%    image.  The DCT coefficients with small variance are discarded   
%    first, as they have the least effect on the reconstruction. 
%    Try to find out how few coefficients are needed to create a
%    reasonable approximation to the original.                  
%                                                       
%    

function edgedemo
%MATLAB Tour Partial Function Help:  img_con
%
% EDGEDEMO Edge detection demo.
%    This demo uses the EDGE function to apply different edge detection
%    methods to a variety of images.  Use the pop-up menus to select an
%    image and an edge detection method.  You can control the parameters
%    for the different methods by setting the values in the middle frame
%    at the bottom of the figure.  (The set of parameters differs
%    depending on the method you choose.)  Press the "Apply" button to
%    calculate the edge map using the specified method and parameters.
% 
%    For the Sobel, Prewitt, and Roberts methods, the EDGE function
%    finds edges by thresholding the gradient.  For the Laplacian of
%    Gaussian method, EDGE thresholds the slope of the zero crossings
%    after filtering the image with a LoG filter.  For the Canny method,
%    EDGE thresholds the gradient using the derivative of a Gaussian
%    filter.
% 
%    By default, the EDGE function automatically computes the threshold
%    to use.  To specify a different threshold manually (in order to
%    detect more or fewer edges), click the radio button next to the
%    edit box in the middle frame and enter the value in the text field.
%    If you are using the Canny method, two thresholds are used:  the
%    high threshold is the value you specify, and the low threshold is
%    0.4 times the high threshold.
% 
%    For the Sobel and Prewitt methods, you can choose to detect
%    horizontal edges, vertical edges, or both.
% 
%    For the Laplacian of Gaussian and Canny methods, you can specify
%    sigma, the parameter that controls the spread of the Gaussian
%    function.  The size of the filter is set automatically by EDGE,
%    based on the value of sigma.
% 
%    

function firdemo
%MATLAB Tour Partial Function Help:  img_con
%
% FIRDEMO 2-D FIR filtering and filter design demo.
%                   
%    This demo lets you explore 2-D Finite Impulse Response (FIR) 
%    filters.  By changing the cut-off frequency and filter order   
%    you can design your own filter.  The designed filter's 
%    coefficients and frequency response are shown in the two 
%    axes at the bottom of the figure.  The filter is designed 
%    using the method specified by the selected radio button.
%                                          
%    Press the "Apply Filter" button to apply the filter to the 
%    original image and display the results.
%                                        
%    Use the top menu to select from a number of possible images.
%    The next menu controls whether a highpass or lowpass filter 
%    is designed.  The third menu lets you choose among various 
%    window functions.  The window functions are used only if 
%    FWIND1 or FWIND2 is chosen as the design method.
%                                        
%    You can change the cutoff frequency or filter order by 
%    editing the numbers displayed.  Only odd-sized orders and 
%    cutoff frequencies between 0.0 and 1.0 are valid for this 
%    demo.   
%                                          
%    

function imadjdemo
%MATLAB Tour Partial Function Help:  img_con
%
% IMADJDEMO Intensity adjustment and histogram equalization demo.
%  
%    This demo enables you to explore the effects of adjusting intensity
%    values and applying gamma correction to images.   It also enables 
%    you to perform histogram equalization, which modifies the image so 
%    that its histogram is approximately flat.  The demo displays the 
%    histograms of the original and modified images.
%  
%    Choose from a number of sample images using the menu in the upper 
%    left corner.  The "Operations" menu on the right enables you to
%    choose between histogram equalization and intensity adjustment.   
% 
%    When you select "Histogram Equalization", the histogram of the original 
%    image is equalized and the resulting image and histogram are displayed.   
%    The intensity transformation calculated in the equalization routine is 
%    shown in the transformation axes.  The x-axis represents input pixel 
%    intensity and the y-axis represents output pixel intensity.
% 
%    When you select "Intensity Adjustment", a number of other controls
%    appear.  These controls enable you to increase and decrease the 
%    brightness, contrast, and gamma correction.  You can specify gamma 
%    explicitly using the edit box under the transformation axes.  You can  
%    also make any adjustment you want directly using the controls on the 
%    transformation curve.  The red and green control points directly set 
%    the parameters which are passed to the IMADJUST command.  The yellow  
%    point enables you to graphically adjust gamma.  Click on the blue line
%    and drag it to move all of the control points simultaneously.
%    
%    

function nrfiltdemo
%MATLAB Tour Partial Function Help:  img_con
%
% NRFILTDEMO Noise reduction filtering demo.
% 
%    This demo enables you to explore noise reduction in images using
%    linear and non-linear filtering techniques applied to several 
%    kinds of noise.
%    
%    The image on the left side of the figure window is the original
%    uncorrupted image.  Use the menu under the original image to 
%    select among a number of images.  
% 
%    The center image is the original image with noise added.  Use the 
%    menu below the center image to select among three different types 
%    of noise.  Edit the fields below the menu to specify parameters 
%    for the noise.  Press "Add Noise" to apply the noise.  
%    
%    The image on the right shows the result of applying a noise removal
%    filter to the center image.  Use the menus under the third image to
%    select the type of noise removal filter and the size of the 
%    neighborhood.  Press "Apply Filter" to filter the corrupted image.
% 
%    

function qtdemo
%MATLAB Tour Partial Function Help:  img_con
%
% QTDEMO Quadtree decomposition demo.
%    
%    Quadtree decomposition is an operation that subdivides an
%    image into blocks that contain "similar" pixels. Usually the
%    blocks are square, although sometimes they may be
%    rectangular.  For the purpose of this demo, pixels in a block
%    are said to be "similar" if the range of pixel values in the
%    block are not greater than some threshold.  Quadtree
%    decomposition is used in variety of image analysis and
%    compression applications. 
% 
%    In the demo window, try adjusting the threshold value for
%    different images.  A large threshold value results in fewer,
%    larger blocks, and the "Block means" image doesn't look very
%    much like the original.  A small threshold value results in
%    more, smaller blocks, and the "Block means" image looks more
%    like the original. 
% 
%    The function QTDECOMP works by successive refinement of
%    blocks.  For example, suppose the input image is 128-by-128.
%    QTDECOMP starts with a single 128-by-128 block.  If the
%    pixels in the block are not similar, QTDECOMP subdivides the
%    block into four 64-by-64 blocks. QTDECOMP then subdivides the
%    nonsimilar 64-by-64 block into 4 32-by-32 blocks, and so on.
% 
%    To see the successive refinement in action, check the
%    "Animated computation" box in the demo window, and then press
%    "Apply".
% 
%    QTDECOMP returns the quadtree decomposition as a sparse
%    matrix S, which is shown in the lower left of the demo
%    window.  Each nonzero element in S corresponds to the
%    upper-left corner of a block.  The value of the nonzero
%    element is the block size.  This representation lends itself
%    to further analysis.  For example, the following line shows
%    how to determine the locations of all 8-by-8 blocks in the
%    quadtree decomposition:
% 
%         [i,j] = find(S == 8);
% 
%    QTDECOMP has other options that are not shown in the demo.
%    For example, you can specify maximum and minimum block sizes,
%    and you can supply your own block similarity function.  The
%    functions QTSETBLK and QTGETBLK are used to set and get image
%    pixel values within blocks of a specified size.
% 
%    

function roidemo
%MATLAB Tour Partial Function Help:  img_con
%
% ROIDEMO Region-of-interest processing demo.
% 
%    This demo illustrates the use of region-of-interest (ROI)
%    operations for processing selected portions of images.
% 
%    Select an image from the menu on the left.  Move the pointer
%    over the image on the left; notice that the cursor changes to
%    a crosshair.  Click on points in the image to select vertices
%    of the region of interest. Select the final point with a
%    double-click, shift-click, or right-click. (You can also end
%    the selection without adding a vertex by pressing <enter> or
%    <return> on the keyboard.)  When you complete your selection,
%    the region will be displayed in the center as a binary image.  
% 
%    Select the operation to perform from the "Region of Interest
%    Operations" menu on the right, and press the "Apply" button.
%    The original image is filtered using the binary image as a
%    mask; the operation is applied only to the portion of the
%    original image which corresponds to the white area of the
%    mask.
%    
%    When you select a new image, you may notice that the ROI
%    operation has changed also.  The images all have appropriate
%    default operations associated with them, but you can
%    experiment with different operations for each image.  
% 
%    For example, the image called "Aluminum and Noise" is an
%    image of aluminum grains corrupted with salt & pepper noise.
%    The default operation is "Median Filter", because median
%    filtering is especially effective at removing this type of
%    noise.
% 
%    Another example is the "Blood" image, whose default operation
%    is "Boundary Interpolation".  This operation calls the
%    function ROIFILL, which smoothly interpolates within an
%    arbitrary region by solving Laplace's equation on the
%    interior of the region. Try selecting a polygon that entirely
%    surrounds one of the blood cells; this will effectively
%    remove the cell from the image.
% 
%    

function ipss001
%MATLAB Tour Partial Function Help:  img_con
%
% IPSS001 Region labeling of steel grains.
% 
%    This demo illustrates the use of double thresholding, feature based
%    logic, binary morphology, and connected components labeling to 
%    locate grain boundaries and label the grains in a microscope image
%    of steel.  
% 
%    

function ipss002
%MATLAB Tour Partial Function Help:  img_con
%
% IPSS002 Feature-based logic.
% 
%    This slideshow illustrates the use of BWSELECT to accomplish
%    a feature-based AND operation.  In feature-based AND, ON pixels
%    in one binary image are used to select objects (connected 
%    groups of ON pixels) in another object.  
% 
%    The first example shows two binary images, one containing dots 
%    and another containing a box.  The intersection of the ON 
%    pixels in the two images is used to select objects from the 
%    dots image.
% 
%    In the second example we want to select bacteria cells which
%    have bright granules in them.  The image is thresholded once
%    to segment the cells, and then it is filtered and thresholded 
%    again to segment the granules.  BWSELECT is then used to 
%    select cells which contain the bright granules.
% 
%    

function ipss003
%MATLAB Tour Partial Function Help:  img_con
%
% IPSS003 Correction of nonuniform illumination.
% 
%    This slideshow demonstrates a method for correcting nonuniform
%    illumination in an image of rice grains.  The background
%    brightness function is estimated by taking the minimum
%    of each 32-by-32 block and then resizing the result to be the  
%    same size as the image.  The background illumination is then 
%    subtracted from the original image and intensity adjustment 
%    is applied to the result.
% 
%    

function dct
%MATLAB Tour Partial Function Help:  img_con
%
% DCT  Discrete cosine transform.
% 
%    Y = DCT(X) returns the discrete cosine transform of X.
%    The vector Y is the same size as X and contains the
%    discrete cosine transform coefficients.
% 
%    Y = DCT(X,N) pads or truncates the vector X to length N 
%    before transforming.
% 
%    If X is a matrix, the DCT operation is applied to each
%    column.  This transform can be inverted using IDCT.
% 
%    

function idct
%MATLAB Tour Partial Function Help:  img_con
%
% IDCT Inverse discrete cosine transform.
% 
%    X = IDCT(Y) inverts the DCT transform, returning the
%    original vector if Y was obtained using Y = DCT(X).
% 
%    X = IDCT(Y,N) pads or truncates the vector Y to length N 
%    before transforming.
% 
%    If Y is a matrix, the IDCT operation is applied to
%    each column.
% 
%    

