Hey guys - we solved the issue - the problem was that my test image
had only two connected components - one of 0s and one of 1s - in the
help there was not mentioned that cc8compt numbers only the regions
with the 1s - leaving the 0s unchanched - i.e

from this ->
[
  [10000]
  [00011]
  [11000]
  [00001]
]
with cc8compt you get this ->
[
  [10000]
  [00022]
  [33000]
  [00004]
]
So additional simple tricks are needed to get the 0s numbered too
(differently from the 1s)

I suggest showing this example in the manual of the cc8compt function
- the way it is now is quite unclear...



2007/5/7, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
Send Perldl mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Perldl digest..."


Today's Topics:

   1. problem with the cc8compt routine from PDL::Image2D - need
      help (Vladimir Radulovski)
   2. Re: problem with the cc8compt routine from PDL::Image2D   -
      need      help (Jarle Brinchmann)


----------------------------------------------------------------------

Message: 1
Date: Sun, 6 May 2007 11:56:21 +0300
From: "Vladimir Radulovski" <[EMAIL PROTECTED]>
Subject: [Perldl] problem with the cc8compt routine from PDL::Image2D
        - need  help
To: [email protected]
Message-ID:
        <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hi al - here is Vladimir from Bulgaria.

Tell me has any of the pdl users done things with cc8compt - I do this:

perldl>$im = rpic "b.gif"  # the gif is a 2-colour

# after the rpic - I have a nice 20x20 piddle $im, but when i try

perldl> use PDL::Image2D  # it loads the module
perldl> $segmented = cc8compt ($im)

I get in $segmented THE SAME VALUES as in $im - it does copying - not
- numbering  the different connected components - HELP!



------------------------------

Message: 2
Date: Sun, 06 May 2007 11:03:06 +0100
From: Jarle Brinchmann <[EMAIL PROTECTED]>
Subject: Re: [Perldl] problem with the cc8compt routine from
        PDL::Image2D    - need  help
To: Vladimir Radulovski <[EMAIL PROTECTED]>
Cc: [email protected]
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hi Vladimir,

cc8compt works on a thresholded image, ie. one that has only values 0 or
1 (see also the documentation).

This means that you, depending on your needs, might have to do some
careful pre-processing. For gray-scale images with noise I would
normally first find the noise level, $sig, then create a thresholded
image as:

      $tim = $im > 3.0*$sig;

(say, this is not always a good way to do it of course! :), then you
threshold using:

      $label_im = cc8compt($tim);

That works fine. If you need to do thresholding based on colour values,
then you need to replace the simple > operation above with somewhat more
complex logic I'd assume.

                        Cheers,
                                J.


Vladimir Radulovski wrote:
> Hi al - here is Vladimir from Bulgaria.
>
> Tell me has any of the pdl users done things with cc8compt - I do this:
>
> perldl>$im = rpic "b.gif"  # the gif is a 2-colour
>
> # after the rpic - I have a nice 20x20 piddle $im, but when i try
>
> perldl> use PDL::Image2D  # it loads the module
> perldl> $segmented = cc8compt ($im)
>
> I get in $segmented THE SAME VALUES as in $im - it does copying - not
> - numbering  the different connected components - HELP!
>
> _______________________________________________
> Perldl mailing list
> [email protected]
> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl



------------------------------

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl


End of Perldl Digest, Vol 24, Issue 3
*************************************


_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to