Issue
//here img is a image or 6x10 size
def splitBoxes(img):
cols= np.hsplit(img,6)
for c in cols:
rows = np.vsplit(c,10) // Problem in this line. error showing here.
cv2.imshow('COL', c)
cv2.waitKey(0)
ERROR MESSAGE: array split does not result in an equal division
Solution
I got my answer. For vsplit or hsplit we have to keep one thing in our mind that is:
For image we have to take a perfect size of height or width which is a divisor of the number we want to split. For Example: np.vsplit(c,10) here "c" is a image, as I want to split this image vertically into 10 pieces so image must be multiplier of 10 as like 100, 200, 250... all are dividable by 10. Thats all. Same as hsplit either for image or array.
Answered By - AHM Rayhanuzzaman Roky
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.