Skip to content

Value error #1

@ceylanbagci

Description

@ceylanbagci

Hi;
My images can not make mask on this line can you help me please.
`---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
in
7 if name == 'main':
8 try:
----> 9 main()
10 except IndexError:
11 print ("Please input two source images: ")

in main()
2 img1 = cv2.imread('data/Rainier1.png')
3 img2 = cv2.imread('data/Rainier2.png')
----> 4 final=Image_Stitching().blending(img1,img2)
5 cv2.imwrite('panorama.jpg', final)
6

in blending(self, img1, img2)
53
54 panorama1 = np.zeros((height_panorama, width_panorama, 3))
---> 55 mask1 = self.create_mask(img1,img2,version='left_image')
56 panorama1[0:img1.shape[0], 0:img1.shape[1], :] = img1
57 panorama1 *= mask1

in create_mask(self, img1, img2, version)
37 mask = np.zeros((height_panorama, width_panorama))
38 if version== 'left_image':
---> 39 mask[:, barrier - offset:barrier + offset ] = np.tile(np.linspace(1, 0, 2 * offset ).T, (height_panorama, 1))
40 mask[:, :barrier - offset] = 1
41 else:

ValueError: could not broadcast input array from shape (388,800) into shape (388,0)`
Images link:

https://drive.google.com/drive/folders/1nyWK45IjSofDFvkWRkJqtYx3Gn1n6QSp?usp=sharing

Thank you then.

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