Ask Your Question

cv2.split() doesn't work beyond 512

asked 2013-05-20 11:02:11 -0500

Abid Rahman K gravatar image

Hi, I have an array of size (10,10,1000) and I want to split it into 1000 arrays of 10x10. So I used cv2.split() function for that. But it doesn't work.

So, on close examination, I saw that cv2.split() doesn't work for arrays with depth more than 512.

See below :

In [101]: j = np.arange(3*3*512).reshape((3,3,512)); k = cv2.split(j); print len(k)

In [102]: j = np.arange(3*3*513).reshape((3,3,513)); k = cv2.split(j); print len(k)

What is the problem here ? Is it a bug or is there anything else to do to make it work ?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-05-21 21:02:55 -0500

Abid Rahman K gravatar image

I got the answer here :

Open CV defines a maximum amount of channels with the variable CV_CN_MAX.

"The maximum possible number of channels is defined by the CV_CN_MAX constant, which is currently set to 512." You can read that here

edit flag offensive delete link more

Question Tools


Asked: 2013-05-20 11:02:11 -0500

Seen: 332 times

Last updated: May 21 '13