Re: Concatenating images (numpy arrays), but they look like HSV images

2009-07-10 Thread Sebastian Schabe
Robert Kern schrieb: Probably, you need to use zeros(..., dtype=uint8). When you use dtype=int, that will result in dtype=int arrays. I suspect that matplotlib is then interpreting that to mean that you want it to treat the input as scalar data (which it will pass through a colormap) rather th

Concatenating images (numpy arrays), but they look like HSV images

2009-07-09 Thread Sebastian Schabe
Hello everybody, I want to concatenate 2 numpy array which in fact are RGB images: def concat_images(im1,im2): rows1 = im1.shape[0] rows2 = im2.shape[0] if rows1 < rows2: im1 = concatenate((im1,zeros((rows2-rows1,im1.shape[1],3), int)), axis=0) elif rows1 > rows2: im2 = concat

Re: deleting certain entries in numpy array

2009-07-02 Thread Sebastian Schabe
Robert Kern schrieb: First, convert the pos array to integers, and just the columns with indices in them: ipos = pos[:,:2].astype(int) Now check the values in the mask corresponding to these positions: mask_values = mask[ipos[:,0], ipos[:,1]] Now extract the rows from the original pos ar

deleting certain entries in numpy array

2009-07-01 Thread Sebastian Schabe
Hello everybody, I'm new to python and numpy and have a little/special problem: I have an numpy array which is in fact a gray scale image mask, e.g.: mask = array([[ 0, 0, 0, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0,