HYRY
unread,Jun 22, 2010, 6:07:43 PM6/22/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ctypes-opencv
Here is the code:
--------------------------
img = cv.imread("fruits.jpg")
img2 = img.clone()
storage = cv.createMemStorage()
result = cv.pyrSegmentation(img, img2, storage, 4, 200, 20)
--------------------------
the result is a CvSeq object:
In [2]: result
Out[2]: <pyopencv.pyopencvext.CvSeq object at 0x01A75C38>
I think result.first is the first element of this sequence:
In [4]: result.first
Out[4]: <pyopencv.pyopencvext.CvSeqBlock object at 0x02D05A08>
Searching for attributes of it:
In [5]: obj = result.first
In [6]: obj.
obj.__class__ obj.__module__ obj.__weakref__
obj.__delattr__ obj.__new__ obj.count
obj.__dict__ obj.__reduce__ obj.data
obj.__doc__ obj.__reduce_ex__ obj.next
obj.__format__ obj.__repr__ obj.prev
obj.__getattribute__ obj.__setattr__ obj.start_index
obj.__hash__ obj.__sizeof__ obj.this
obj.__init__ obj.__str__
obj.__instance_size__ obj.__subclasshook__
It looks obj.data is the information I need, but I can't access it:
In [10]: obj.data
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
TypeError: No to_python (by-value) converter found for C++ type:
signed char