cannot reshape array of size 1766016 into shape (50,1104,1104)

Viewed 28
    import cv2 as cv    
import numpy as np

image=cv.imread('C:/Users/achin/Downloads/cube.jpg')  
grayscale=cv.cvtColor(image,cv.COLOR_BGR2GRAY)  #Coverting to grayscale
(thresh, blackAndWhiteImage) = cv.threshold(grayscale, 127, 255, cv.THRESH_BINARY) 
image.reshape(50,1104,1104)#Image reshaping
(B,G,R)=cv.split(image)   #Splitting in RGB plane
merged=cv.merge([B, G, R])# Color image using R,G and B planes

cv.imshow('Red',R)  #Displaying all kind of images
cv.imshow('Green',G)
cv.imshow('Blue',B)
cv.imshow('Merged',merged)
cv.waitKey(0)

When doing this, it says "cannot reshape array of size 1766016 into shape (50,1104,1104)", how do i solve this issue.

0 Answers
Related