Skip to content

ValueError: could not broadcast input array from shape (455,337,3) into shape (455,159,3) #5

Description

@z-mahmud22

Hi @ndvinh98,

Thank you for sharing your work with the multiple image stitching. It is undoubtedly a commendable work.

I am trying to test your code to generate some panoramic images. I downloaded random images from google and then tested the code with those. It works for some images but doesn't work for others. For example I am using a set of 5 images which have the following shapes:

img1.shape: (818 692 3) 
img2.shape: (818 683 3)
img3.shape: (818 573 3)
img4.shape: (818 541 3)
img5.shape: (818 617 3)

and I get a resulting image with the following shape:
result.shape: (818 2299 3)

However, when I am using another image set of 4 images with the following shapes:

img1.shape: (455 343 3) 
img2.shape: (455 337 3)
img3.shape: (455 385 3)
img4.shape: (455 431 3)

I don't get any resulting image and instead I get the following error:

Traceback (most recent call last):
  File "/home/user/multi_stitch/stitch.py", line 133, in warpTwoImages
    dst_img_rz[t[1] : height_src + t[1], :width_dst] = dst_img
ValueError: could not broadcast input array from shape (455,337,3) into shape (455,159,3)

Looks like this issue was reported before here but apparently it doesn't seem to be related with python version as mentioned in this issue.

I was hoping if you could provide some help here. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions