Preface
Today, the weather in Dongguan is fine. The temperature ranges from 33 to 27 degrees. The weather is fine today. At the end of this period, there were many things and the blog was not updated for a long time. The feature recognition was completed in the past few weeks. Some foreign websites have been blocked recently, so we can only restart csdn to write articles.
This document briefly describes the usage of feature recognition. In this article, you will learn to use nodeitk,
-Use the DescriptorExtractor interface to find the feature vectors corresponding to the key points
-Use BFMatcher to match a feature vector
-Draw Feature Matching Using drawMatches
Source code
Var node_itk = require ('. /node-itk '); // read the module diagram var img_1 = node_itk.cv.imread (". /images/lena.jpg ", node_itk.cv.CV_LOAD_IMAGE_GRAYSCALE); // read the target image var img_2 = node_itk.cv.imread (". /images/lena.jpg ", node_itk.cv.CV_LOAD_IMAGE_GRAYSCALE); minHessian = 400 // sets the Feature Detection Method detector = new node_itk.cv.NodeOpenCVFeatureDetector (" SURF ") detector. set ("hessianThreshold", minHessian) keypoints_1 = detector. detect (img_1); keypoints_2 = detector. detect (img_2); // obtain the feature description extractor = new node_itk.cv.NodeOpenCVDescriptorExtractor ("SURF"); descriptors_1 = extractor. compute (img_1, keypoints_1) descriptors_2 = extractor. compute (img_2, keypoints_2) // set the matching method matcher = new node_itk.cv.NodeOpenCVDescriptorMatcher ("FlannBased"); matches = matcher. match (descriptors_1, descriptors_2); // draw the matching result img_matches = equals (img_1, keypoints_1, img_2, keypoints_2, matches); node_itk.cv.NamedWindow ("match", matching ); node_itk.cv.imshow ("match", img_matches); c = node_itk.cv.WaitKey (0); if (c> = 0) {return-1 ;}
Result
Summary
Nodeitk is a self-developed image processing tool based on nodejs. It includes basic image processing, video processing, and other feature matching functions. For more information about it, see the link. To be continued.