2012-04-13 6 views
1

내가 안드로이드안드로이드 OpenCV의 목록 <KeyPoint>는

위해 OpenCV의에서 stereouncalibratedrectify 사용하기 위해 노력하고있어 매트하고 난 자바 매트 목록에서 변환 할 수있는 방법을 발견하지 못했지만, OpenCV의의 C++에서 우리는 매트를 만들 수 있습니다 벡터

에서이 내가했던 단계 :

내가 이해에서
//find fundamental matrix 
//srcmatchkey and dstmatchkey are List<Point> as required in findFundamentalMat function,  

they have been calculated using FLANN Matcher 


Cali3D.findFundamentalMat(srcMatchKey, dstMatchKey, Calib3d.FM_8POINT); 

//this is the strange part 

Calib3D.stereoRectifyUncalibrated(Mat points1,Mat,points1,Mat fundamentalMatrix,Mat H1,Mat H2) 

는, 매트 점 1과 매트 points2이 srcMatchKey 및 dstMatchKey로 만든 매트입니다 (또는 내가 ?? 잘못된 생각은, 만약 올바른 그것을하십시오 그것은 잘못되었습니다.) 그리고 매트 생성자가 없습니다. ccepted List 또는 C++의 벡터와 같은 무언가, 그리고 Mat C++가 있습니다.

그래서 질문은 안드로이드에 목록에서 매트를 만들 수있는 방법이 있습니까 ?? 당신의 도움을 주셔서 감사합니다 ...

답변

2

당신이 안드로이드 OpenCV의 2.3.1를 사용하는 경우, 매트에 목록을 변환 코드는 다음과 같습니다

List<Point> lp = null; 
    Mat mp = Converters.vector_Point_to_Mat(lp); 

또는 stereoRectifyUncalibrated()에 대해 이야기가 될 수 있습니다

Mat mp = Converters.vector_Point2d_to_Mat(lp); 

Android 용 OpenCV 2.4.beta (모두 최근 발행) List<T> 유형이 Native와 Java간에 앞뒤로 데이터를 복사하지 못하도록 MatOfT 유형으로 바뀌 었습니다.

+0

오, 고맙습니다. – euclid135