Re: grouping array

2005-09-30 Thread Michael Spencer
[EMAIL PROTECTED] wrote: > fredrick's solutions seems to be more closer to what I was looking > for.But I am still not sure if that could be done without the use of > Image module. What do you mean by "closer to what I was looking for"? For the single test case you provided: > say x = [[2,2,0,0

Re: grouping array

2005-09-30 Thread pkilambi
fredrick's solutions seems to be more closer to what I was looking for.But I am still not sure if that could be done without the use of Image module. Also in your solution I cannot follow this [[1, 1, 2, 1, 2, 0], [2, 0, 0, 2, 0, 1], [1, 2, 2, 0, 2, 0], [0, 1, 0, 0, 0, 0], [2, 0, 0, 1,

Re: grouping array

2005-09-29 Thread Michael Spencer
[EMAIL PROTECTED] wrote: > hi if I have an array > > say x = [[2,2,0,0,1,1], > [1,1,0,0,1,1], > [1,1,0,0,1,1]] > I basically want to group regions that are non zero like I want to get > the coordinates of non zero regions..as (x1,y1,x2,y2) > [(0,0,2,1),(0,4,2,5)] which show the t

Re: grouping array

2005-09-29 Thread George Sakkis
<[EMAIL PROTECTED]> wrote: > hi if I have an array > > say x = [[2,2,0,0,1,1], > [1,1,0,0,1,1], > [1,1,0,0,1,1]] > I basically want to group regions that are non zero like I want to get > the coordinates of non zero regions..as (x1,y1,x2,y2) > [(0,0,2,1),(0,4,2,5)] which show the

Re: grouping array

2005-09-29 Thread pkilambi
1. why are you creating an Image object here? cant this be done by handling lists? 2. What exactly is getprojection doing? -- http://mail.python.org/mailman/listinfo/python-list

Re: grouping array

2005-09-29 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > hi if I have an array > > say x = [[2,2,0,0,1,1], > [1,1,0,0,1,1], > [1,1,0,0,1,1]] > I basically want to group regions that are non zero like I want to get > the coordinates of non zero regions..as (x1,y1,x2,y2) > [(0,0,2,1),(0,4,2,5)] which show the top

Re: grouping array

2005-09-29 Thread pkilambi
sure: basically I am looking for clustering of non zero groups in that 2D list...so in the above array the first non zero cluster is 2,2 in row 0, 1,1 in row 1 and 1,1 in row 1 so if we think of this as one group we have the first element of the group is at (0,0) in the list and last is at (2,1) in

Re: grouping array

2005-09-29 Thread Bill Mill
On 29 Sep 2005 10:01:40 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > hi if I have an array > > say x = [[2,2,0,0,1,1], > [1,1,0,0,1,1], > [1,1,0,0,1,1]] > I basically want to group regions that are non zero like I want to get > the coordinates of non zero regions..as (x1,

grouping array

2005-09-29 Thread pkilambi
hi if I have an array say x = [[2,2,0,0,1,1], [1,1,0,0,1,1], [1,1,0,0,1,1]] I basically want to group regions that are non zero like I want to get the coordinates of non zero regions..as (x1,y1,x2,y2) [(0,0,2,1),(0,4,2,5)] which show the top left(x1,y1) and bottom right(x2,y2) co