- Gibt es schon Reaktionen auf den Sprachkurse?
- Ja, wir haben viele Hörerbriefe bekommen.
- Und was steht in den Briefen?
- Die kann ich doch nicht alle vorlesen. Das dauert viel zu lange.
- Nicht alle, aber einige - bitte!
- Ja, das interessiert mich auch.
- Na gut.
- Aber bitte, machen Sie es kurz!
- Hier habe ich einen Brief von Herrn Card aus Amerika - Moment. Mir gefallen die Abenteuer von Andreas - asl Portier im Hotel Europa.
- Mir auch
- s
- Und hier ist ein Brief von Angela aus Kolumbien. Sie schreibt, ' Ich bin so glücklick, weil ich die Grammatik studiert habe. Jetzt verstehe ich den Akkusativ - der war immer ...'
- Grammatik, Grammatik, Akkusativ - das ist ja langweilig! Schreiben die Hörer den nichts über mich?! Wie finden die Hörer mich, das will ich wissen!
- Kein Problem, Ex. Hier ist ein Brief aus England - da steht etwas über dich! ' The intruduction of Ex is a brilliant idea. '
- Das verstehe ich doch nicht! Was heißt das denn auf deutsch?
- Du bist eine brillante Idee!
- Idee? Wieso bin ich eine Idee? Ich bin ich!
- s
- Das hier ist noch ganz wichtig: Manche Hörer schreiben, daß sie Ex nicht so gut verstehen.
- Wir können ihr ja eine andere Stimme geben.
- Probieren wir es doch mal! Ex, sprich mal etwas!
- Ben dem Zauberwort sollte ich das Buch verlassen und ...
- Okay! Stop! Und noch einmal bitte!
- Ben dem Zauberwort sollte ich das Buch verlassen und ...
- Kann ihre Stimme nicht ganz normal bleiben?
- Nein - Ex ist ja eine besondere Person, ein weiblicher kobold, da braucht sie auch eine besondere Stimme.
- Das finde ich auch!
- Aber das ist ein technisches Problem. Das lösen wir später.
To Log Everything I find useful. If you find anything inappropriate, please contact cuijinqiang@gmail.com
Saturday, November 16, 2013
Das ist eine brilliante Idee
Teil 4 Lektion 1
Saturday, November 2, 2013
Finds an object pose from 3D-2D point correspondences
C++: bool solvePnP(InputArray objectPoints, InputArray imagePoints, InputArray cameraMatrix, InputArray distCoeffs, OutputArray rvec, OutputArray tvec, bool useExtrinsicGuess=false, int flags=ITERATIVE )
Parameters: - objectPoints – Array of object points in the object coordinate space, 3xN/Nx3 1-channel or 1xN/Nx1 3-channel, where N is the number of points. vector<Point3f> can be also passed here.
- imagePoints – Array of corresponding image points, 2xN/Nx2 1-channel or 1xN/Nx1 2-channel, where N is the number of points. vector<Point2f> can be also passed here.
- cameraMatrix – Input camera matrix
.
- distCoeffs – Input vector of distortion coefficients
of 4, 5, or 8 elements. If the vector is NULL/empty, the zero distortion coefficients are assumed.
- rvec – Output rotation vector (see Rodrigues() ) that, together with tvec , brings points from the model coordinate system to the camera coordinate system.
- tvec – Output translation vector.
- useExtrinsicGuess – If true (1), the function uses the provided rvec and tvec values as initial approximations of the rotation and translation vectors, respectively, and further optimizes them.
- flags –Method for solving a PnP problem:
- CV_ITERATIVE Iterative method is based on Levenberg-Marquardt optimization. In this case the function finds such a pose that minimizes reprojection error, that is the sum of squared distances between the observed projections imagePoints and the projected (using projectPoints() ) objectPoints .
- CV_P3P Method is based on the paper of X.S. Gao, X.-R. Hou, J. Tang, H.-F. Chang “Complete Solution Classification for the Perspective-Three-Point Problem”. In this case the function requires exactly four object and image points.
- CV_EPNP Method has been introduced by F.Moreno-Noguer, V.Lepetit and P.Fua in the paper “EPnP: Efficient Perspective-n-Point Camera Pose Estimation”.
The function estimates the object pose given a set of object points, their corresponding image projections, as well as the camera matrix and the distortion coefficients.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "opencv.hpp" | |
#include <iostream> | |
#include <string> | |
using namespace std; | |
using namespace cv; | |
vector<cv::Point2f> Generate2DPoints(); | |
vector<cv::Point3f> Generate3DPoints(); | |
int main() | |
{ | |
vector<cv::Point2f> imagePoints = Generate2DPoints(); | |
vector<cv::Point3f> objectPoints = Generate3DPoints(); | |
cout << "there are " << imagePoints.size() << " Image points and " << objectPoints.size() << " Object points" << endl; | |
Mat cameraMatrix(3,3, DataType<double>::type); | |
setIdentity(cameraMatrix); | |
cout<< " Camera matrix " <<endl<< cameraMatrix << endl; | |
Mat distCoeffs(4,1,DataType<double>::type); | |
distCoeffs.at<double>(0) = 0; | |
distCoeffs.at<double>(1) = 0; | |
distCoeffs.at<double>(2) = 0; | |
distCoeffs.at<double>(3) = 0; | |
cout<< " Camera distorsion matrix " <<endl<< distCoeffs << endl; | |
Mat rvec(3,1,DataType<double>::type); | |
Mat tvec(3,1,DataType<double>::type); | |
cv::solvePnP(objectPoints, imagePoints,cameraMatrix, distCoeffs, rvec, tvec); | |
cout << " rvec: " << rvec << endl; | |
cout << " tvec: " << tvec << endl; | |
std::vector<cv::Point2f> projectedPoints; | |
cv::projectPoints(objectPoints, rvec, tvec, cameraMatrix,distCoeffs, projectedPoints); | |
for(unsigned int i =0; i < projectedPoints.size(); i++) | |
{ | |
cout << "Image Points : " << imagePoints[i] << "projected to " << projectedPoints[i] <<endl; | |
} | |
waitKey(); | |
return 0; | |
} | |
std::vector<cv::Point2f> Generate2DPoints() | |
{ | |
std::vector<cv::Point2f> points; | |
float x,y; | |
x=282;y=274; | |
points.push_back(cv::Point2f(x,y)); | |
x=397;y=227; | |
points.push_back(cv::Point2f(x,y)); | |
x=577;y=271; | |
points.push_back(cv::Point2f(x,y)); | |
x=462;y=318; | |
points.push_back(cv::Point2f(x,y)); | |
x=270;y=479; | |
points.push_back(cv::Point2f(x,y)); | |
x=450;y=523; | |
points.push_back(cv::Point2f(x,y)); | |
x=566;y=475; | |
points.push_back(cv::Point2f(x,y)); | |
for(unsigned int i = 0; i < points.size(); ++i) | |
{ | |
std::cout << points[i] << std::endl; | |
} | |
return points; | |
} | |
std::vector<cv::Point3f> Generate3DPoints() | |
{ | |
std::vector<cv::Point3f> points; | |
float x,y,z; | |
x=.5;y=.5;z=-.5; | |
points.push_back(cv::Point3f(x,y,z)); | |
x=.5;y=.5;z=.5; | |
points.push_back(cv::Point3f(x,y,z)); | |
x=-.5;y=.5;z=.5; | |
points.push_back(cv::Point3f(x,y,z)); | |
x=-.5;y=.5;z=-.5; | |
points.push_back(cv::Point3f(x,y,z)); | |
x=.5;y=-.5;z=-.5; | |
points.push_back(cv::Point3f(x,y,z)); | |
x=-.5;y=-.5;z=-.5; | |
points.push_back(cv::Point3f(x,y,z)); | |
x=-.5;y=-.5;z=.5; | |
points.push_back(cv::Point3f(x,y,z)); | |
for(unsigned int i = 0; i < points.size(); ++i) | |
{ | |
std::cout << points[i] << std::endl; | |
} | |
return points; | |
} |
Subscribe to:
Posts (Atom)