Using hierarchy in findContours () in OpenCV?

The hierarchy returned by findContours has the following form: hierarchy[idx][{0,1,2,3}]={next contour (same level), previous contour (same level), child contour, parent contour} CV_RETR_CCOMP, returns a hierarchy of outer contours and holes. This means elements 2 and 3 of hierarchy[idx] have at most one of these not equal to -1: that is, each element has either no … Read more

Video Stabilization with OpenCV

I can suggest one of the following solutions: Using local high level features: OpenCV includes SURF, so: for each frame, extract SURF features. Then build feature Kd-Tree (also in OpenCV), then match each two consecutive frames to find pairs of corresponding features. Feed those pairs into cvFindHomography to compute the homography between those frames. Warp … Read more

Sift implementation with OpenCV 2.2

Below is a minimal example: #include <opencv/cv.h> #include <opencv/highgui.h> int main(int argc, const char* argv[]) { const cv::Mat input = cv::imread(“input.jpg”, 0); //Load as grayscale cv::SiftFeatureDetector detector; std::vector<cv::KeyPoint> keypoints; detector.detect(input, keypoints); // Add results to image and save. cv::Mat output; cv::drawKeypoints(input, keypoints, output); cv::imwrite(“sift_result.jpg”, output); return 0; } Tested on OpenCV 2.3

OpenCV / SURF How to generate a image hash / fingerprint / signature out of the descriptors?

The feature data you mention (position, laplacian, size, orientation, hessian) is insufficient for your purpose (these are actually the less relevant parts of the descriptor if you want to do matching). The data you want to look at are the “descriptors” (the 4th argument): void cvExtractSURF(const CvArr* image, const CvArr* mask, CvSeq** keypoints, CvSeq** descriptors, … Read more