Bounding box on clusters in a 2D list

Bengt Richter bokr at oz.net
Sun Apr 24 16:51:02 EDT 2005


On 24 Apr 2005 09:44:49 -0700, "superprad at gmail.com" <superprad at gmail.com> wrote:

>Richter,yes what I am looking for is for cluster with rectangular
>bounding boxes as you explained in the first figure.
>
Sorry, not your fault, but I'm still not clear on diagonal connection/separation.
E.g., (removing punctuation ;-) is this 3 boxes or do the top left and bottom right
connect at their touching corners and thus become bounded with a rectangle that then
also includes the little box at the top right?

      +-------+   +---+
    0 | 1   1 | 0 | 1 |
      |       |   +---+
    0 | 1   1 | 0   0
      +-------+?------+
    0   0   0 ? 1   1 |
              |       |
    0   0   0 | 0   1 |
              +-------+

      +-------+   +---+      +-------+???+---+       +---------------+  
    0 | 1   1 | 0 | 1 |    0 | 1   1 | 0 | 1 |     0 | 1   1   0   1 |  
      |       |   +---+      |       |   +---+       |               |  
    0 | 1   1 | 0   0      0 | 1   1 | 0   0 ?     0 | 1   1   0   0 |  
      +-------+?------+ =>   |       +-------+  =>   |               |  
    0   0   0 ? 1   1 |    0 | 0   0   1   1 |     0 | 0   0   1   1 |  
              |       |      |               |       |               |  
    0   0   0 | 0   1 |    0 | 0   0   0   1 |     0 | 0   0   0   1 |  
              +-------+      +---------------+       +---------------+  

And what about nested boxes?

   +-------------------+  
 0 | 1   1   1   1  1  |  
   |                   |  
 0 | 1   0   0   0  1  |  
   |       +---+       |  
 0 | 1   0 | 1 | 0  1  |  
   |       +---+       |  
 0 | 1   0   0   0  1  |  
   |                   |  
 0 | 1   1   1   1  1  |  
   +-------------------+  

Regards,
Bengt Richter



More information about the Python-list mailing list