NAME

PDL::Image2D - Miscellaneous 2D image processing functions


DESCRIPTION

  Miscellaneous 2D image processing functions - for want
  of anywhere else to put them


SYNOPSIS

 use PDL::Image2D;


FUNCTIONS


conv2d

  Signature: (a(m,n); kern(p,q); [o]b(m,n); int opt)


conv2d

2D convolution of an array with a kernel (smoothing)

 $new = conv2d $old, $kernel, {OPTIONS}

  perldl> $smoothed = conv2d $image, ones(3,3), {Boundary => Reflect}

 Boundary - controls what values are assumed for the image when kernel
            crosses its edge:
            => Default  - periodic boundary conditions (i.e. wrap around axis)
            => Reflect  - reflect at boundary
            => Truncate - truncate at boundary


med2d

  Signature: (a(m,n); kern(p,q); [o]b(m,n); int opt)


med2d

2D median-convolution of an array with a kernel (smoothing)

Note: only points in the kernel >0 are included in the median, other points are weighted by the kernel value (medianing lots of zeroes is rather pointless)

 $new = med2d $old, $kernel, {OPTIONS}

  perldl> $smoothed = med2d $image, ones(3,3), {Boundary => Reflect}

 Boundary - controls what values are assumed for the image when kernel
            crosses its edge:
            => Default  - periodic boundary conditions (i.e. wrap around axis)
            => Reflect  - reflect at boundary
            => Truncate - truncate at boundary


patch2d

  Signature: (a(m,n); int bad(m,n); [o]b(m,n))


patch2d

patch bad pixels out of 2D images,

$patched = patch2d $data, $bad;

$bad is a 2D mask array where 1=bad pixel 0=good pixel. Pixels are replaced by the average of their non-bad neighbours.


max2d_ind

  Signature: (a(m,n); [o]b(); int [o]c(); int[o]d())


max2d_ind

Return value/position of maximum value in 2D image

Contributed by Tim Jeness


centroid2d

  Signature: (im(m,n); x(); y(); box(); [o]xcen(); [o]ycen())


centroid2d

Refine a list of object positions in 2D image by centroiding in a box

$box is the full-width of the box, i.e. the window is +/- $box/2


cc8compt

  Signature: (a(m,n); [o]b(m,n))

Connected 8-component labeling of a binary image.

Connected 8-component labeling of 0,1 image - i.e. find seperate segmented objects and fill object pixels with object number

perldl> $segmented = cc8compt($image>$threshold);


AUTHORS

Copyright (C) Karl Glazebrook 1997 with additions by Robin Williams (rjrw@ast.leeds.ac.uk) and Tim Jeness (timj@jach.hawaii.edu) All rights reserved. There is no warranty. You are allowed to redistribute this software / documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this file is separated from the PDL distribution, the copyright notice should be included in the file.