2016-11-03 2 views
0

이 코드 (소스)를 사용하여 opencv의 기본 행렬을 찾고 싶습니다.함수의 오류 OpenCV의 findFundamentalMat

#include <iostream> 
using namespace std; 

#include <opencv2/opencv.hpp> 
using namespace cv;  
int point_count = 100; 
     vector<Point2f> points1(point_count); 
     vector<Point2f> points2(point_count); 

     // initialize the points here ... */ 
     for(int i = 0; i < point_count; i++) 
     { 
      points1[i] = Point2f(10.0f, 20.0f); 
      points2[i] = Point2f(0.3f, 40.0f); 
     } 

     Mat fundamental_matrix = 
     findFundamentalMat(points1, points2, FM_RANSAC, 3, 0.99); 

하지만이

undefined reference to `cv::findFundamentalMat(cv::_InputArray const&, cv::_InputArray const&, int, double, double, cv::_OutputArray const&)' 

처럼 findFundamentalMat에 오류가 발생하고 내가 잘못 뭐하는 거지 지적 내가 OpenCV의 새로운 오전으로 감사 설명하십시오.

답변

0

링커 오류입니다. 링커 라이브러리에 calib3d을 포함시켜야합니다.

+0

includeded calib3d는 오류 치명적인 오류가있어 해당 파일이나 디렉토리 – Rahul

+0

OS가 당신을에 없다? 어떤 컴파일러를 사용합니까? –

+0

우분투 16.04 리눅스 4.4.0-42 제네릭, 나는 PKG-설정의 일식 – Rahul

1

Windows 사용자의 경우 findFundamentalMat 함수를 사용하려면 calib3d.hpp을 포함시켜야합니다. calib3d :

#include "opencv2/calib3d/calib3d.hpp"