① SIFT演算法提取特徵點,怎樣得到正確的特徵點空間坐標,網上實現的程序里loc(i,1),loc(i,2)說是特徵點的坐標
為了更加准確,大衛勞氏推薦用了subpixel也就是子像素坐標,
但是這里的話你直接取整形就是了。
有warning能通了不就行了?
② 如何調用vlfeat工具箱中的的vl
將vlfeat安裝來好之後,將其添加進matlab的set path中,自直接調用即可,img=imread('img.jpg');img1=rgb2gray(img);img2=im2single(img1);f=vl_sift(img2)
這里f是一個[x,y,s,th]的向量矩陣,x,y表示興趣點的中心位置,s表示興趣點的尺度大小,th是其梯度方向。
其他還有諸如[f,d]=vl_sift(img2)的調用方式,其中d表示128維的特徵向量,具體看help vl_sift,上面說的很詳細。
③ vlfeat中的sift特徵提取能用openmp並行實現么
vlfeat中的sift特徵提取能用openmp並行實現
將vlfeat安裝好之後,將其添加進matlab的set path中,直接調用即可版,img=imread('img.jpg');img1=rgb2gray(img);img2=im2single(img1);f=vl_sift(img2)
這里權f是一個[x,y,s,th]的向量矩陣,x,y表示興趣點的中心位置,s表示興趣點的尺度大小,th是其梯度方向。
其他還有諸如[f,d]=vl_sift(img2)的調用方式,其中d表示128維的特徵向量,具體看help vl_sift,上面說的很詳細。
④ MATLAB編程實現特徵點提取
是試用一下find函數
⑤ matlab opencv 特徵點提取與匹配問題
你先找找看,如果找不到,可以試著每次只對1/4圖像提取特徵點,然後把四部分特徵點集合在一起匹配,這樣可以做到盡量均勻
⑥ 如何用OPENCV編程提取特徵點,要符合visualSFM的格式
整個項目的結構圖:
編寫DetectFaceDemo.java,代碼如下:
[java] view
plainprint?
package com.njupt.zhb.test;
import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.core.MatOfRect;
import org.opencv.core.Point;
import org.opencv.core.Rect;
import org.opencv.core.Scalar;
import org.opencv.highgui.Highgui;
import org.opencv.objdetect.CascadeClassifier;
//
// Detects faces in an image, draws boxes around them, and writes the results
// to "faceDetection.png".
//
public class DetectFaceDemo {
public void run() {
System.out.println("\nRunning DetectFaceDemo");
System.out.println(getClass().getResource("lbpcascade_frontalface.xml").getPath());
// Create a face detector from the cascade file in the resources
// directory.
//CascadeClassifier faceDetector = new CascadeClassifier(getClass().getResource("lbpcascade_frontalface.xml").getPath());
//Mat image = Highgui.imread(getClass().getResource("lena.png").getPath());
//注意:源程序的路徑會多列印一個『/』,因此總是出現如下錯誤
/*
* Detected 0 faces Writing faceDetection.png libpng warning: Image
* width is zero in IHDR libpng warning: Image height is zero in IHDR
* libpng error: Invalid IHDR data
*/
//因此,我們將第一個字元去掉
String xmlfilePath=getClass().getResource("lbpcascade_frontalface.xml").getPath().substring(1);
CascadeClassifier faceDetector = new CascadeClassifier(xmlfilePath);
Mat image = Highgui.imread(getClass().getResource("we.jpg").getPath().substring(1));
// Detect faces in the image.
// MatOfRect is a special container class for Rect.
MatOfRect faceDetections = new MatOfRect();
faceDetector.detectMultiScale(image, faceDetections);
System.out.println(String.format("Detected %s faces", faceDetections.toArray().length));
// Draw a bounding box around each face.
for (Rect rect : faceDetections.toArray()) {
Core.rectangle(image, new Point(rect.x, rect.y), new Point(rect.x + rect.width, rect.y + rect.height), new Scalar(0, 255, 0));
}
// Save the visualized detection.
String filename = "faceDetection.png";
System.out.println(String.format("Writing %s", filename));
Highgui.imwrite(filename, image);
}
}
package com.njupt.zhb.test;
import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.core.MatOfRect;
import org.opencv.core.Point;
import org.opencv.core.Rect;
import org.opencv.core.Scalar;
import org.opencv.highgui.Highgui;
import org.opencv.objdetect.CascadeClassifier;
//
// Detects faces in an image, draws boxes around them, and writes the results
// to "faceDetection.png".
//
public class DetectFaceDemo {
public void run() {
System.out.println("\nRunning DetectFaceDemo");
System.out.println(getClass().getResource("lbpcascade_frontalface.xml").getPath());
// Create a face detector from the cascade file in the resources
// directory.
//CascadeClassifier faceDetector = new CascadeClassifier(getClass().getResource("lbpcascade_frontalface.xml").getPath());
//Mat image = Highgui.imread(getClass().getResource("lena.png").getPath());
//注意:源程序的路徑會多列印一個『/』,因此總是出現如下錯誤
/*
* Detected 0 faces Writing faceDetection.png libpng warning: Image
* width is zero in IHDR libpng warning: Image height is zero in IHDR
* libpng error: Invalid IHDR data
*/
//因此,我們將第一個字元去掉
String xmlfilePath=getClass().getResource("lbpcascade_frontalface.xml").getPath().substring(1);
CascadeClassifier faceDetector = new CascadeClassifier(xmlfilePath);
Mat image = Highgui.imread(getClass().getResource("we.jpg").getPath().substring(1));
// Detect faces in the image.
// MatOfRect is a special container class for Rect.
MatOfRect faceDetections = new MatOfRect();
faceDetector.detectMultiScale(image, faceDetections);
System.out.println(String.format("Detected %s faces", faceDetections.toArray().length));
// Draw a bounding box around each face.
for (Rect rect : faceDetections.toArray()) {
Core.rectangle(image, new Point(rect.x, rect.y), new Point(rect.x + rect.width, rect.y + rect.height), new Scalar(0, 255, 0));
}
// Save the visualized detection.
String filename = "faceDetection.png";
System.out.println(String.format("Writing %s", filename));
Highgui.imwrite(filename, image);
}
}
3.編寫測試類:
[java] view
plainprint?
package com.njupt.zhb.test;
public class TestMain {
public static void main(String[] args) {
System.out.println("Hello, OpenCV");
// Load the native library.
System.loadLibrary("opencv_java246");
new DetectFaceDemo().run();
}
}
//運行結果:
//Hello, OpenCV
//
//Running DetectFaceDemo
///E:/eclipse_Jee/workspace/JavaOpenCV246/bin/com/njupt/zhb/test/lbpcascade_frontalface.xml
//Detected 8 faces
//Writing faceDetection.png
package com.njupt.zhb.test;
public class TestMain {
public static void main(String[] args) {
System.out.println("Hello, OpenCV");
// Load the native library.
System.loadLibrary("opencv_java246");
new DetectFaceDemo().run();
}
}
//運行結果:
//Hello, OpenCV
//
//Running DetectFaceDemo
///E:/eclipse_Jee/workspace/JavaOpenCV246/bin/com/njupt/zhb/test/lbpcascade_frontalface.xml
//Detected 8 faces
//Writing faceDetection.png
⑦ matlab 中有自動提取圖像特徵點的函數嗎
n
⑧ 如何調用工具箱中的vlfeat的vl
將vlfeat安裝好之後,將其添加進matlab的set path中,直接調用即可,img=imread('img.jpg');img1=rgb2gray(img);img2=im2single(img1);f=vl_sift(img2)
這里f是一個[x,y,s,th]的向量矩陣,x,y表示興趣點內的中容心位置,s表示興趣點的尺度大小,th是其梯度方向。
其他還有諸如[f,d]=vl_sift(img2)的調用方式,其中d表示128維的特徵向量,具體看help vl_sift,上面說的很詳細。
⑨ 在MATLAB中,進行特徵點提取並用紅色的點進行標記,怎麼計算標記點的個數
特徵點提取不是自己寫的代碼嗎?幹嘛非計算標記的紅點個數,代碼內自己設立一個變數計數就行了