ValueError could not broadcast input array from shape 360 270 3 into shape 360 280 3

0 votes

I tried to crop my face from a photo using cv2 module in python. But I got this below error.

ValueError                                Traceback (most recent call last)
<ipython-input-23-6fa3f8830675> in <module>
      3 photo1 = photo[100:460,200:480].copy()
      4 photo2 = photo[140:500,780:1050].copy()
----> 5 photo[100:460,200:480]=photo2
      6 photo[140:500,780:1050]=photo1
      7 cv2.imshow('My Photo',photo)
ValueError: could not broadcast input array from shape (360,270,3) into shape (360,280,3)

How can I solve this error?

Thank You

Apr 9, 2020 in Python by akhtar
• 38,230 points
19,729 views

1 answer to this question.

0 votes

Hi@akhtar,

In the above error it shows could not broadcast input array from shape (360,270,3) into shape (360,280,3), means you are tying to exchange your crop sections but they are not in same dimension. So please make sure that the dimensions are same.

Hope this will help.

Thank You

answered Apr 9, 2020 by MD
• 95,440 points

Related Questions In Python

0 votes
1 answer
0 votes
1 answer

ValueError: could not broadcast input array from shape (4,1) into shape (4)

Hey @Giorgio, You can try this hope this ...READ MORE

answered Feb 18, 2020 in Python by Gitika
• 65,910 points
9,910 views
0 votes
0 answers

ValueError: could not broadcast input array from shape (224,224,9) into shape (224,224)

img_shape = 224 test_data = [] test_labels = [] for ...READ MORE

Nov 6, 2020 in Python by Eyosiyas
• 120 points
1,423 views
+1 vote
0 answers

ValueError: operands could not be broadcast together with shapes (3,) (1000,)

This is the part of my code, why ...READ MORE

May 17, 2020 in Python by anonymous
• 220 points

edited May 18, 2020 by Gitika 5,990 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,060 views
0 votes
1 answer
+1 vote
0 answers

ValueError: could not broadcast input array from shape (2) into shape (5)

I was implementing gillespie algorithm and when ...READ MORE

Dec 23, 2019 in Python by anonymous
• 130 points

reshown Jan 13, 2020 by Kalgi 3,674 views
+1 vote
1 answer

ImportError: DLL load failed: The specified module could not be found.

Hi@akhtar, You may get this error if you ...READ MORE

answered Jun 22, 2020 in Python by MD
• 95,440 points
9,377 views
+1 vote
1 answer

WindowsError: [Error 126] The specified module could not be found.

Hi@akhtar, You can download the shapely module in ...READ MORE

answered Jul 13, 2020 in Python by MD
• 95,440 points
1,087 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP