① 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中,进行特征点提取并用红色的点进行标记,怎么计算标记点的个数
特征点提取不是自己写的代码吗?干嘛非计算标记的红点个数,代码内自己设立一个变量计数就行了