Help for this page

Select Code to Download


  1. or download this
    # I assume you are using 2 different pdls, not rows of the same pdl as
    + you mentioned in your post
    # If it's just one pdl, 'dog' it
    ...
    # my $upper_edges = $indices + 1 != $indices->rotate(-1)
    
    # now slice and dice up your piddles knowing the regions you want.
    
  2. or download this
    use PDL::ImageND;
    my $edge_detector_kern = pdl [ -1, 1 ];
    my $upper_edges = convolveND( $mask, $edge_detector_kern );
    # where it is -1 is the upper edge of a region of zeroes
    # where it is 1 is the upper edge of a region of ones