[NumPy-Tickets] [NumPy] #2036: Leak when mixing OpenCV GetMat and NumPy asarray

NumPy Trac numpy-tickets@scipy....
Thu Feb 2 12:58:42 CST 2012


#2036: Leak when mixing OpenCV GetMat and NumPy asarray
--------------------+-------------------------------------------------------
 Reporter:  r2d3    |       Owner:  somebody   
     Type:  defect  |      Status:  new        
 Priority:  normal  |   Milestone:  Unscheduled
Component:  Other   |     Version:  1.6.1      
 Keywords:          |  
--------------------+-------------------------------------------------------
 The following code leaks

 My profiling tool (Instruments on OSX) that OpenCV cvmat_array_struct
 allocated the memory. But I suspect asarray to keep a reference on it in
 some way.

 OSX 10.6
 Python 2.6
 Numpy 1.6.1
 OpenCV 2.3.1

 The leaking sample code :

 import cv
 import numpy as N

 while True:
     img = cv.CreateImage((800,600), 8, 1);
     numpy_Img = N.asarray(cv.GetMat(img))

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/2036>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list