Skip to content

Error with For loop and matrix multiplication in PYTHON #21389

Discussion options

You must be logged in to vote

The shape of the image gets inversed when read as an array. 

I later found that out by printing the shapes of images and image arrays. 

@ramkarumugam wrote:

ValueErrorTraceback (most recent call last)
<ipython-input-35-1ecd9c5afb6f>in<module> 19print(right_temp.size) 20print(coordinates_left,coordinates_right)—> 21same,h,w=if_same(left_temp,right_temp) 22#plt.figure(figsize=[h,w]) 23#plt.imshow(out1)<ipython-input-33-27346e0a4cef>inif_same(left_temp, right_temp) 32image1=left_temp_np[0:h][0:w] 33image2=right_temp_np[j:h+j][i:w+i]—> 34same=mse(image1,image2) 35print(“loop 1 i: %s j: %s image1: %s image2: %s”%(i,j,image1.size,image2.size)) 36print(same)<ipython-input-34-3ff65825a155>inms…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants