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
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
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
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,