33 #ifndef DOXYGEN_SHOULD_SKIP_THIS
35 #import "ViewController.h"
37 #import <visp3/visp.h>
40 @interface ViewController ()
43 @implementation ViewController
44 #pragma mark - Example of a function that uses ViSP
45 - (void)processViSPHomography{
47 std::vector<vpPoint> oP(4), aP(4), bP(4);
50 oP[0].setWorldCoordinates( -L,-L, 0);
51 oP[1].setWorldCoordinates(2*L,-L, 0);
52 oP[2].setWorldCoordinates( L, 3*L, 0);
53 oP[3].setWorldCoordinates( -L, 4*L, 0);
60 std::vector<double> xa(4), ya(4), xb(4), yb(4);
62 for(
int i=0 ; i < 4; i++){
64 xa[i] = oP[i].get_x();
65 ya[i] = oP[i].get_y();
67 xb[i] = oP[i].get_x();
68 yb[i] = oP[i].get_y();
76 std::cout <<
"Homography:\n" << aHb << std::endl;
85 std::cout <<
"atb: " << atb.
t() << std::endl;
93 std::cout <<
"Ground truth:" << std::endl;
94 std::cout <<
" Point 3 in pixels in frame b: " << iPb << std::endl;
95 std::cout <<
" Point 3 in pixels in frame a: " << iPa << std::endl;
101 std::cout <<
"Estimation from homography:" << std::endl;
104 - (void)viewDidLoad {
107 [
self processViSPHomography];
109 - (void)didReceiveMemoryWarning {
110 [
super didReceiveMemoryWarning];