2018-05-10 21:25:19 -0600 | received badge | ● Popular Question (source) |
2014-06-24 23:46:25 -0600 | commented question | Release external data pointer in Cv::Mat constructor Everytime I use delete dst_ptr the program crash |
2014-06-24 23:41:38 -0600 | asked a question | Release external data pointer in Cv::Mat constructor I have these following lines of code: These lines cause memory leak in my program. As document: Pointer to the user data. Matrix constructors that take data and step parameters do not allocate matrix data. Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. This operation is very efficient and can be used to process external data using OpenCV functions. The external data is not automatically deallocated, so you should take care of it So how can I release the external data? Indeed it's the |
2014-06-24 00:52:18 -0600 | commented answer | Strange memory leak using CvMat structure Thanks, got it. I fixed by remove all of the CvMat var, and assign dst_ptr = arr0.data The source of leak is the cvConvertImage, it fill data to dst var but never free it |
2014-06-23 23:49:03 -0600 | commented answer | Strange memory leak using CvMat structure OK I fixed it. Btw, does opencv pass Mat as ref or value? Function such as cv::resize(src, dst, size) will creates a local copy or does operation on src? |
2014-06-23 04:30:40 -0600 | commented answer | Strange memory leak using CvMat structure I think that the program still used data of the dst / dst_ptr / image when the call to functioni cvShowImageHWND() is done because when I tried to release their data, the program crash. Am I correct? |
2014-06-23 01:29:57 -0600 | commented answer | Strange memory leak using CvMat structure I tried to modify the display function so as to be able to display opencv processed image in the MFC/Win32 windows. I know CvMat and IplImage were deprecated but I can't find other solution. The problem here is the data pointed by the CvMat *image var is somewhat retained outside the scope of the function (because when I tried to release the data, the program will raise error). Pls correct me if I were wrong or tell me how to deal with the problem :( |
2014-06-22 22:41:13 -0600 | received badge | ● Editor (source) |
2014-06-22 22:39:47 -0600 | asked a question | Strange memory leak using CvMat structure I've tried to modify the cvShowImageHWND in opencv/modules/highgui/src/window_w32.cpp in order to show image by a HWND window specified instead of using window name. My modified one worked well until I relized it's memory leak. I found that the line cvConvertImage() causes the leak and try to prevent it from leaking memory. Can anyone help me? Actually I tried to use smart pointer cv::Ptr<cvmat> to wrap it but it raises error whenever program goes out of cvShowImageHWND scope, I guess that the data is retained for displaying after the function cvShowImageHWND done, but if I didn't free the memory, my program memory keeps increasing roughly 4MB each loop. Please show me a hint or tell me what should I do |
2014-06-11 22:39:52 -0600 | commented answer | Win32 GUI application using OpenCV lib I know it works but the call to cvNameWindow leaves a blink window (show a gray one and immediately disappear after that). How can I fix that? |
2014-06-10 21:51:09 -0600 | commented answer | Win32 GUI application using OpenCV lib The technique used SW_HIDE flag left a blink window. How can I fix that? |
2014-06-10 20:53:44 -0600 | commented answer | Win32 GUI application using OpenCV lib Thanks for your answer. But I want to build a win32 API based application, it will have openCV as a processor for images / video frames and the win32 will take the openCV's output as input and display it to the screen. Or some functions like cvShowImage() which can take a HWND as a parameter to specify which windows I want to display the images. I found one at opencv/sources/modules/highgui/src/window_win32 but I don't know how to include / call that function |
2014-06-09 23:21:22 -0600 | commented question | Win32 GUI application using OpenCV lib Can someone help me please. The image display by cvShowImage() or imshow() always create a new windows instead of old one. I tried getWindowName() of the old window, then pass to cvShowImage / imshow but it create a new one with same title. ZZ |
2014-06-09 05:12:12 -0600 | asked a question | Win32 GUI application using OpenCV lib Dear all, I'm building a media player app using Win32 GUI (The win32 application). I have stuck at displaying images / video on win32 (which considered easy when dealing with win32 console as we can use built-in function of OpenCV highgui). After days of searching google, I found that win32 accept bitmap image and using draw tool, device context to display image. So how do I use processed data in OpenCV (Mat, IplImage object) as input for win32 application? Please give me an example / instructions / link of how to do it. Thanks in advance. |