oops, sorry, I wrote the wrong things (it's getting late : )

i'm actually erring on this

######### typdef ############

cdef class CvCapture:

    cdef c_highgui.CvCapture* thisptr

    # convienience functions

    def queryFrame(self):
    # get and return an IplImage from from a capture source
    # equivalent to img = cvQueryFrame(CvCapture* capture)
    # make sure to set capture width and height before calling this
        cdef c_cxcore.IplImage* img
        cdef IplImage pyimg = IplImage()
        img = c_highgui.cvQueryFrame(self.thisptr)
        pyimg.thisptr = img
        return pyimg

    def __dealloc__(self):
        c_highgui.cvReleaseCapture(&self.thisptr)


def cvCreateCameraCapture(device):
    cdef c_highgui.CvCapture* cap = c_highgui.cvCreateCameraCapture(device)
    cdef CvCapture pycap = CvCapture()
    pycap.thisptr = cap
    return pycap

####################

python code

cam = cvCreateCameraCapture(0)
img = cam.queryFrame()
img.show()                                     <----- this works fine
img = cam.queryFrame()                <---------- I crash here


sorry for the confusion


Chris
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to