Ask Your Question

OCR's profile - activity

2018-08-30 21:42:42 -0600 received badge  Famous Question (source)
2015-05-31 10:33:04 -0600 received badge  Notable Question (source)
2014-06-18 10:33:32 -0600 received badge  Popular Question (source)
2013-03-18 13:47:29 -0600 received badge  Student (source)
2012-11-04 23:58:51 -0600 received badge  Editor (source)
2012-11-04 15:04:00 -0600 received badge  Scholar (source)
2012-11-04 13:29:38 -0600 received badge  Supporter (source)
2012-11-04 13:22:38 -0600 received badge  Organizer (source)
2012-11-04 13:18:29 -0600 asked a question How to split cv2.imread to 3 separate mats

it is a newbie question, please, what's wrong with this code:

import cv2 
import cv2.cv as cv 

img = cv2.imread(fn)
cvImg = cv.fromarray(img)
#~ rgba = cv.CreateMat(cvImg.width, cvImg.height , cv.CV_8UC4)

sb = cv.CreateMat(cvImg.width, cvImg.height , cv.CV_8UC1)
sg = cv.CreateMat(cvImg.width, cvImg.height , cv.CV_8UC1)
sr = cv.CreateMat(cvImg.width, cvImg.height , cv.CV_8UC1)
sa = cv.CreateMat(cvImg.width, cvImg.height , cv.CV_8UC1)
cv.Split(cvImg,sb,sg,sr,sa)
"""
Traceback (most recent call last):
  File "squares2.py", line 188, in <module>
    cv.Split(cvImg,sb,sg,sr,sa)
cv2.error: dvec[j].size() == src.size()
"""