Video Stabilization Using Point Feature Matching
Filed under Computer Vision by Wang Kang on 05-10-2011
This article is taken from MathWorks ( Thanks MathWorks, its very nice article ):
-----------------------------------------
|
Machine Vision Box (Composed by Wangkang) | Computer Visition, Intelligent AlgorithmMachine Vision Box (Composed by Wangkang)Computer Visition, Intelligent Algorithm Video Stabilization Using Point Feature MatchingFiled under Computer Vision by Wang Kang on 05-10-2011This article is taken from MathWorks ( Thanks MathWorks, its very nice article ): -----------------------------------------
Predator :-) = ( Tracking + Learning + Detection )Filed under Computer Vision by Wang Kang on 12-07-2011Recently I found a nice single object tracker named Predator. Here’s the Introduce : —————————————————————————————————————————————————————————————————————————————- The Predator contains :
—————————————————————————————————————————————————————————————————————————————- Here’s examples : Point Cloud RenderingFiled under Computer Vision by Wang Kang on 10-07-2011This video is reference in OpenCV jp. Data set used in the program can be downloaded from here. This is a demo program to project the 2D image pixel to 3D space parallax image. ———————————————————————————————————————————— Step 1. Reading the stereo image, semi-global block matching ( SGBM ) to calculate the disparity image. Step 2. Re-projection to 3D space parallex image by Q-Matrix. Step 3. Project the image points from the 3D coordinate to new perspective. ————————————————————————————————————————————And you can find how to operate in here ———————————————————————————————————————————— [1] Makoto Ota, Norishige Fukushima, Tomohiro Yendo, Masayuki Tanimoto, Toshiaki Fujii, “Rectification of Pure Translation 2D Camera Array,” Proc. Of IWAIT2009, 0044, Jan. 2009. About Tracking (1)Filed under Computer Vision by Wang Kang on 06-01-2011Why human eye can tracking object ? What’s algorithm the human brain run? Let’s talk about this. 1 . Segmentation . Human can easily distinguish and tracking target different with background but hardly tracking target similar to background, for example, a polar bear on snow vs a a polar bear on grass, people wear camouflage uniform lying in the grass vs lying in the snow. 2. Motion detection. Do you feel dizzy when you staring at a waving stick ? People look a static background scene are more easily than watching a moving background scene, such as rotating car at playground can make people dizzy, the moving background scene need run complex motion detection algorithm on brain. Use OpenMP to let your program run faster(2) – Parallel SearchFiled under Computer Vision by Wang Kang on 30-12-2010If you wanna search data in a disorder dataset, you can divide dataset to a lots of blocks, and use each thread to seach each block, here is a example : Definition : Input : void **ppDataSet : A huge dataset which you wanna seach target data in it Input: int nLen : Dataset length Input: void *pTargetData : Target data (You wanna search it in dataset and return it location) Input: CompareFunc Comp : Compare data (Matching datas to obtain similarity) Output: vector<int> VLoc : Target data locatoin in dataset Sample Code: vector<int> ParallelSearchData( void** ppDataSet, int nLen, void* pTargetData, CompareFunc Comp ) { . int i, k; . int nCore = omp_get_num_procs(); . int nStep = nLen / Core; . vector<int> VLoc; #pragma omp parallel for . for ( k = 0 ; k < nCore ; k++ ) . { . int iBegin = k * nStep; // Each Processor Search Start Loc . int iEnd = (k+1) * nStep; // Each Processor Search End Loc . // Divide step cumulative may not accurate equal nLen (int type) . if ( k = kCore – 1 ) iEnd = nLen; . for ( i = iBegin ; i < iEnd ; i++ ) . { . // We assume confidence = 1.0 is target . if ( Comp( ppDataSet[i], pTargetData ) == 1.0 ) . VLoc.insert( i ); . } . } . return VLoc; } Use OpenMP to let your program run faster(1)Filed under Computer Vision by Wang Kang on 30-12-2010Nowadays, I encountered a problem when I designing a new real-time tracking algorithm in company, inevitable for loop and time-consuming operation make me upset, so I borrow a book from Lib and search multi-thread to solve this problem, now I find answer: here is example : int i; int iLoopTimes = 1000; void Job() CLOCK_START ////////////////////////////////////////////////////////////////////////// } Time Usage Compare: Test1 time = 628.708 ms (Double Double sections) See ? My friend. Solve Nonlinear function By Binary Divisive Procedure ( c++ code )Filed under Computer Vision by Wang Kang on 11-07-2010Here is the C++ Code Solve the Nonlinear function below Use the Binary Divisive Procedure #include <math.h> double TestEquation( double x ) while ( ( x <= UpperBound + StepWidth/2.0 )&&( SearchedRoot!=RootCount ) ) // Search root in Sub-interval while ( rootStatus == 0 ) if ( fabs(y0) < Eps ) // Here is a ROOT ! void SolveFunctionMain() int rootCount; cout<<”——— This is a program to solve Nonlinear function”<<endl; cout<<”——— The Nonlinear function is:”<<endl; rootCount = BinDivSearchRoot( LowerBound, UpperBound, StepWidth, Eps, x, m, mail ); cout<<”Solve Successfully!”<<endl; cout<<”The function has “<<rootCount<<” roots,they are:”<<endl; Happy New Year – The Tiger Year of China;-)Filed under Computer Vision by Wang Kang on 14-02-2010OpenCV memory leaking management in C/C++Filed under Computer Vision by Wang Kang on 25-12-2009If you’re new to OpenCV, you need to know exactly how to manage all the huge amounts of memory you’re using. C/C++ isn’t a garbage collected language (like Java), so you need to manually release memory as soon as its use is over. If you don’t, your program could use up hundreds of MBs of highly valuable RAM… and often even crash (out-of-memory errors?) It can be a daunting task to hunt exactly where memory needs to be released. So I’ve compiled this short list of places where you should look out for memory leaks. Create it, then Release it If you create something, make sure you release it before “returning”. This is probably the very first thing you should check when fixing memory leak problems with OpenCV. For example, if you do a cvCreateImage, make sure you do a cvReleaseImage. There are many things you can create. Here are some functions that “create” and their corresponding “release” functions cvCreateImage cvReleaseImage One warning though: If you create something and want to return it, don’t release it. Lets say a function that creates a checkerboard image and returns it. If you release the image before returning it, you’re freeing all memory that stores the image data. And when you try accessing memory that isn’t yours, you get a crash. Release returned structures This is the second thing you should check for. Often, once you return a structure (say, an image).. you forget about it. Multiple Memory Allocations This is the third thing you should check for: Allocating memory, and then changing the pointer itself. Here’s some example code: view plaincopy to clipboardprint? This function creates a memory leak. First, you allocate some memory for image . Then, you call the function CreateCheckerBoard. This function itself creates new memory. And image now points to this new memory. The memory created in the first step is lost forever. No variable points to it. A memory leak. To fix this, you need to modify the code like this: view plaincopy to clipboardprint? If you return a sequence, release its storage There are many instances where you use the CvSeq data structure. And often you might want to return this structure for further use. If you release its storage (a CvMemStorage structure) within the function itself, you’d free the memory where the sequence is stored. And then you’d try and access it in the calling function. Again, crash. A temporary fix would be to just erasing the cvReleaseMemStorage statement… but that would mean lots of memory. view plaincopy to clipboardprint? storage is a member of the CvMemStorage structure that always points to the memory where its stored. Again, this is just an example. There are more structures where a similar situation could arise. Dependence on other structures I quite recently discovered this memory leak. To explain this, I’ll use an example: Lets say you find out the contours of an image. OpenCV would return a “linked list” type structure calledCvSeq . You decide to access the third element of this linked list. OpenCV returns a pointer to the third element. All going great till this moment. Now you decide to save all the points of this contour (the third element) in a data structure of your own. Since this is an array of points, you do something like: view plaincopy to clipboardprint? You set the pointer to equal to the thirdcontour . This is the bug. If you release the storage of the sequence (which you should), mystructure has a bad pointer. To fix this, allocate new memory to mystructure->points and then copy contents of thirdcontour->points … something like this: view plaincopy to clipboardprint? This creates new memory for your structure and then copies each element there. Once you’ve done this, you can release the storage of the sequence without fear. [Original source from: LiquidMetal , all rights reserved by original authors] Dose Colorspace Transformation make any difference on skin detection?Filed under Computer Vision by Wang Kang on 05-12-2009I hope to find some rules that skin detection can benifited form the colorspace,Now I’m researching,If you know some about that,Please contact me |
|||