使用nodeitk進行特徵識別

來源:互聯網
上載者:User

標籤:影像處理   nodejs   

前言

今天,東莞,天氣晴。溫度33到27度。今天天氣晴。這段時間期末,事情比較多,也很久沒有更新部落格。前幾周終於把特徵識別完成,由於最近把國外的一些網站給屏蔽了,因此暫時只能重啟csdn寫文章。


本文對特徵識別的用法簡單描述。本文你將學會使用nodeitk,


- 使用DescriptorExtractor介面尋找關鍵點對應的特徵向量
- 使用BFMatcher匹配特徵向量
- 使用drawMatches繪製特徵匹配


原始碼

    var node_itk = require('./node-itk');    // 讀模數塊圖    var img_1 = node_itk.cv.imread( "./images/lena.jpg", node_itk.cv.CV_LOAD_IMAGE_GRAYSCALE );    // 讀取靶心圖表    var img_2 = node_itk.cv.imread( "./images/lena.jpg", node_itk.cv.CV_LOAD_IMAGE_GRAYSCALE );    minHessian = 400    // 設定特徵檢測方法    detector = new node_itk.cv.NodeOpenCVFeatureDetector("SURF")    detector.Set("hessianThreshold", minHessian)    keypoints_1 = detector.Detect( img_1 );    keypoints_2 = detector.Detect( img_2 );    // 擷取特徵描述    extractor = new node_itk.cv.NodeOpenCVDescriptorExtractor("SURF");    descriptors_1 = extractor.Compute(img_1, keypoints_1)    descriptors_2 = extractor.Compute(img_2, keypoints_2)    // 設定匹配方法    matcher = new node_itk.cv.NodeOpenCVDescriptorMatcher("FlannBased");    matches = matcher.Match(descriptors_1, descriptors_2);    // 繪製匹配結果    img_matches = node_itk.cv.DrawMatches(img_1, keypoints_1, img_2, keypoints_2, matches);    node_itk.cv.NamedWindow( "match", node_itk.cv.CV_WINDOW_AUTOSIZE );    node_itk.cv.imshow( "match", img_matches );    c = node_itk.cv.WaitKey ( 0 );    if( c >= 0 ) { return -1; }

結果

小結


nodeitk是由本人獨立開發的基於nodejs影像處理工具。它包含基本的影像處理、視頻處理還包含其它特徵匹配功能。有關它的早前介紹請參見連結。待續。

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.