利用visual assist X为VS2012自动添加注释
Author: buptlijun
Date: 2013.12.8
Position: Beijing, China
KeyWords: 福昕,pdf,快捷键
越来越喜欢最新版本的福昕pdf viewer了,"铅笔"、"朗读"等功能尤其喜欢,最近在学习VS快捷键的同时就想到,在阅读pdf时,频繁的点击切换注释方法大大降低了效率,因此找了一下福昕注释快捷键的设置方案,并设置了一个适合自己的快捷键方案。如下图所示
It doesn't matter if cvReleaseImage is before cvWaitKey?
I change the order of cvReleaseImage and cvWaitKey, and it does work too.
#include "stdafx.h" int main(int argc, char** argv) { cvNamedWindow("testWindow",0); IplImage *img=cvLoadImage("E:/lena.jpg"); cvShowImage("testWindow",img); Sleep(10); cvReleaseImage(&img); cvWaitKey(0); cvDestroyWindow("testWindow"); return 0; }
If We use cvShowImage function, The image wouldn't be shown on the window until cvWaiKey is called.
I got this problem when I displayed a video sequence. It's interesting that the window showed nothing without cvWaitKey, while when I stepped into the program, I could see the image correctly with the tool Image Watch ,The following code could directly show that:
I'm trying to use visual leak detecor to detect memory leak caused by OpenCV programs.
A simple testing program is:
#include "stdafx.h" #include <vld.h> int main(int argc, char** argv) { IplImage *img=cvLoadImage("E:/lena.jpg"); char *pBuf = new char[200]; return 0; }
It's obviously that there are two memory leaks, while the result shows:
if I comment the 7th line, then the result is:
So, it seems that Visual Leak Detector doesn't work with OpenCV(at least OpenCV1.0)
http://www.codeproject.com/Articles/9815/Visual-Leak-Detector-Enhanced-Memory-Leak-Detectio may give us some information.
I guess the reason is that VLD haven't traced the memory of OpenCV functions.