이것은 SIFT를위한 매우 간단한 코드입니다. 아주 이상한 설명 자야. 맞습니까?SIFT opencv2.3.1/2.4.3 둘다 매우 이상한 설명자를주는 것 .. 7., 29., 39., 11., 2.3.1 매우 이상한 설명자를내는 것
기술자 : 0, 7, 29, 39, 11, 0, 0, 0, 32, 30, 39, 52, 16 , 0., 1., 12., 38., 14.10, 20., 28., 93., 45., 37., 93., 3., 6., 11., 23., 107 ., 24., 80., 0., 2., 47., 53., 0., 1., 9., 8., 104., 85., 35., 41., 1.10. , 32., 19., 130., 73., 0., 0., 8., 76., 31., 42., 61.40., 10., 5.83., 130., 28., 31., 3., 0., 0., 0., 2, 12., 17., 60., 4., 0., 0., 0.31., 76 83, 130, 38, 10., 6., 15., 10., 16., 89., 19., 21., 16., 23. 130., 94. , 3., 1. ]
#include "stdafx.h"
#include <iostream>
#include <cv.h>
#include <highgui.h>
#include <C:\opencv243\include\opencv2\nonfree\features2d.hpp>
using namespace cv;
using namespace std;
int main(int argc, const char* argv[])
{
string path="matrices.xml";
FileStorage fs(path, FileStorage::WRITE);
cv::siftFeatureDetector detector;
cv::SiftDescriptorExtractor extractor;
cv::Mat descriptors_1;
std::vector<cv::KeyPoint> keypoints;
const cv::Mat input=cv::imread("image path",0);
detector.detect(input, keypoints);
extractor.compute(input, keypoints, descriptors_1);
fs <<"descriptor"<<descriptors_1;
fs.release();
return 0;
}
설명자에 대해 이상한 점은 무엇입니까? –
나는 훈련 목적을 위해 파일 (XML)에 디스크립터 (sift)를 저장하고 싶었으므로 나중에 사용할 수 있도록 서핑의 경우 부동 소수점 기술자를 원한다. – Vivek
sift.cpp의 주석은 구현이 OpenSift 구현을 기반으로한다고 언급합니다. OpenSift는 부동 소수점을 임계 값 512로 정수로 변환합니다. 나는 또한 왜 확신하지 못한다. – adikshit