1

I need to stack two images with the same width to create a new image.

I currently have two images which are slices of the same image:

img is the name of the original image with shape (480, 640, 3)

    timestamp = img[:40, :200, :]
    variables = img[370:, :200, :]

I either want to stack these images somehow or slice the original image in such a way that I take the first 40 pixels and the last 90 pixels (as above)

Thanks in advance!

0

1 Answer 1

1

You can use np.vstack:

new_img = np.vstack([img[:40, :200, :], img[370:, :200, :]])
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.