示例#1
0
		House1() {

			fileLeft = "/apps/workspaces/kiste_data/stereo/4/left.png";
			fileRight = "/apps/workspaces/kiste_data/stereo/4/right.png";
			imgLeft = ImageFactory::readPNG(fileLeft);
			imgRight = ImageFactory::readPNG(fileRight);

			MatchingSAD sad(imgLeft, imgRight, 15);
			Matching matcher;

			Point2i pl1(110,244);	Point2i pr1(198,296);		//pr1 = matcher.refine(sad, pl1, pr1);
			Point2i pl2(273,242);	Point2i pr2(309,249);		//pr2 = matcher.refine(sad, pl2, pr2);
			Point2i pl3(88,117);	Point2i pr3(129,121);		//pr3 = matcher.refine(sad, pl3, pr3);
			Point2i pl4(247,122);	Point2i pr4(244,89);		//pr4 = matcher.refine(sad, pl4, pr4);
			Point2i pl5(321,100);	Point2i pr5(320,50);		//pr5 = matcher.refine(sad, pl5, pr5);
			Point2i pl6(398,162);	Point2i pr6(428,125);		//pr6 = matcher.refine(sad, pl6, pr6);
			Point2i pl7(393,282);	Point2i pr7(424,273);		//pr7 = matcher.refine(sad, pl7, pr7);
			Point2i pl8(266,154);	Point2i pr8(278,132);		//pr8 = matcher.refine(sad, pl8, pr8);

			fm.addCorrespondence(pl1,	pr1);
			fm.addCorrespondence(pl2,	pr2);
			fm.addCorrespondence(pl3,	pr3);
			fm.addCorrespondence(pl4,	pr4);
			fm.addCorrespondence(pl5,	pr5);
			fm.addCorrespondence(pl6,	pr6);
			fm.addCorrespondence(pl7,	pr7);
			fm.addCorrespondence(pl8,	pr8);
			//fm.addCorrespondence(pl9,	pr9);

			fm.estimate();

		}
示例#2
0
		Metal1() {

			fileLeft = "/apps/workspaces/kiste_data/stereo/3/left.png";
			fileRight = "/apps/workspaces/kiste_data/stereo/3/right.png";
			imgLeft = ImageFactory::readPNG(fileLeft);
			imgRight = ImageFactory::readPNG(fileRight);

			MatchingSAD sad(imgLeft, imgRight, 15);
			Matching matcher;

			Point2i pl1(608,834);	Point2i pr1(400,873);		//pr1 = matcher.refine(sad, pl1, pr1);
			Point2i pl2(357,485);	Point2i pr2(292,470);		//pr2 = matcher.refine(sad, pl2, pr2);
			Point2i pl3(461,672);	Point2i pr3(294,678);		//pr3 = matcher.refine(sad, pl3, pr3);
			Point2i pl4(524,507);	Point2i pr4(410,523);		//pr4 = matcher.refine(sad, pl4, pr4);
			Point2i pl5(518,479);	Point2i pr5(440,493);		//pr5 = matcher.refine(sad, pl5, pr5);
			Point2i pl6(586,405);	Point2i pr6(476,431);		//pr6 = matcher.refine(sad, pl6, pr6);
			Point2i pl7(593,324);	Point2i pr7(532,349);		//pr7 = matcher.refine(sad, pl7, pr7);
			Point2i pl8(673,366);	Point2i pr8(596,405);		//pr8 = matcher.refine(sad, pl8, pr8);

			fm.addCorrespondence(pl1,	pr1);
			fm.addCorrespondence(pl2,	pr2);
			fm.addCorrespondence(pl3,	pr3);
			fm.addCorrespondence(pl4,	pr4);
			fm.addCorrespondence(pl5,	pr5);
			fm.addCorrespondence(pl6,	pr6);
			fm.addCorrespondence(pl7,	pr7);
			fm.addCorrespondence(pl8,	pr8);
			//fm.addCorrespondence(pl9,	pr9);

			fm.estimate();

		}
示例#3
0
		IDIS() {

			fileLeft = "/apps/workspaces/kiste_data/stereo/2/left.png";
			fileRight = "/apps/workspaces/kiste_data/stereo/2/right.png";
			imgLeft = ImageFactory::readPNG(fileLeft);
			imgRight = ImageFactory::readPNG(fileRight);

			MatchingSAD sad(imgLeft, imgRight, 15);
			Matching matcher;

			Point2i pl1(257,369);	Point2i pr1(98,367);		pr1 = matcher.refine(sad, pl1, pr1);
			Point2i pl2(261,579);	Point2i pr2(101,589);		pr2 = matcher.refine(sad, pl2, pr2);
			Point2i pl3(282,692);	Point2i pr3(121,708);		pr3 = matcher.refine(sad, pl3, pr3);
			Point2i pl4(657,673);	Point2i pr4(520,678);		pr4 = matcher.refine(sad, pl4, pr4);
			Point2i pl5(704,247);	Point2i pr5(569,247);		pr5 = matcher.refine(sad, pl5, pr5);
			Point2i pl6(816,641);	Point2i pr6(679,641);		pr6 = matcher.refine(sad, pl6, pr6);
			Point2i pl7(1113,503);	Point2i pr7(964,501);		pr7 = matcher.refine(sad, pl7, pr7);
			Point2i pl8(1025,472);	Point2i pr8(882,472);		pr8 = matcher.refine(sad, pl8, pr8);
			Point2i pl9(1096,345);	Point2i pr9(948,348);		pr9 = matcher.refine(sad, pl9, pr9);

			fm.addCorrespondence(pl1,	pr1);
			fm.addCorrespondence(pl2,	pr2);
			fm.addCorrespondence(pl3,	pr3);
			fm.addCorrespondence(pl4,	pr4);
			fm.addCorrespondence(pl5,	pr5);
			fm.addCorrespondence(pl6,	pr6);
			fm.addCorrespondence(pl7,	pr7);
			fm.addCorrespondence(pl8,	pr8);
			//fm.addCorrespondence(pl9,	pr9);

			fm.estimate();

		}
示例#4
0
		House3D() {

			fileLeft = "/apps/workspaces/kiste_data/stereo/5/left.png";
			fileRight = "/apps/workspaces/kiste_data/stereo/5/right.png";
			imgLeft = ImageFactory::readPNG(fileLeft);
			imgRight = ImageFactory::readPNG(fileRight);


//			imgLeft = Derivative::getX(imgLeft);
//			imgRight = Derivative::getX(imgRight);

//			Normalize::inplace(imgLeft);
//			Normalize::inplace(imgRight);

			MatchingSAD sad(imgLeft, imgRight, 15);
			Matching matcher;

			Point2i pl1(245,381);	Point2i pr1(176,366);		//pr1 = matcher.refine(sad, pl1, pr1);		// h1 lower left
			Point2i pl2(308,323);	Point2i pr2(312,323);		//pr2 = matcher.refine(sad, pl2, pr2);		// h1 lower right
			Point2i pl3(222,82);	Point2i pr3(246,82);		//pr3 = matcher.refine(sad, pl3, pr3);		// h1 upper right
			Point2i pl4(134,76);	Point2i pr4(101,78);		//pr4 = matcher.refine(sad, pl4, pr4);		// h1 upper left
			Point2i pl5(501,218);	Point2i pr5(416,228);		//pr5 = matcher.refine(sad, pl5, pr5);		// h1 mid left
			Point2i pl6(620,201);	Point2i pr6(625,219);		//pr6 = matcher.refine(sad, pl6, pr6);		// h1 mid right
			Point2i pl7(546,83);	Point2i pr7(570,78);		//pr7 = matcher.refine(sad, pl7, pr7);		// h1 upper right
			Point2i pl8(423,79);	Point2i pr8(378,77);		//pr8 = matcher.refine(sad, pl8, pr8);		// h1 upper left

			Point2i pl9(381,413);	Point2i pr9(319,420);		//pr8 = matcher.refine(sad, pl8, pr8);		// cube1a
			Point2i plA(153,322);	Point2i prA(68,299);		//pr8 = matcher.refine(sad, pl8, pr8);		// cube2
			Point2i plB(348,361);	Point2i prB(294,362);		//pr8 = matcher.refine(sad, pl8, pr8);		// cube1b


//			Point2i pl1(242,219);	Point2i pr1(171,212);		//pr1 = matcher.refine(sad, pl1, pr1);		// h1 lower left
//			Point2i pl2(307,194);	Point2i pr2(311,194);		//pr2 = matcher.refine(sad, pl2, pr2);		// h1 lower right
//			Point2i pl3(222,82);	Point2i pr3(246,82);		//pr3 = matcher.refine(sad, pl3, pr3);		// h1 upper right
//			Point2i pl4(134,76);	Point2i pr4(101,78);		//pr4 = matcher.refine(sad, pl4, pr4);		// h1 upper left
//			Point2i pl5(501,218);	Point2i pr5(416,228);		//pr5 = matcher.refine(sad, pl5, pr5);		// h1 lower left
//			Point2i pl6(620,201);	Point2i pr6(625,219);		//pr6 = matcher.refine(sad, pl6, pr6);		// h1 lower right
//			Point2i pl7(546,83);	Point2i pr7(570,78);		//pr7 = matcher.refine(sad, pl7, pr7);		// h1 upper right
//			Point2i pl8(423,79);	Point2i pr8(378,77);		//pr8 = matcher.refine(sad, pl8, pr8);		// h1 upper left

			fm.addCorrespondence(pl1,	pr1);
			fm.addCorrespondence(pl2,	pr2);
			fm.addCorrespondence(pl3,	pr3);
			fm.addCorrespondence(pl4,	pr4);
			fm.addCorrespondence(pl5,	pr5);
			fm.addCorrespondence(pl6,	pr6);
			fm.addCorrespondence(pl7,	pr7);
			fm.addCorrespondence(pl8,	pr8);
			fm.addCorrespondence(pl9,	pr9);

			fm.addCorrespondence(plA,	prA);
			fm.addCorrespondence(plB,	prB);

			fm.estimate();

		}
示例#5
0
		Garden() {

			fileLeft = getDataFile("stereo1.jpg");		// left image
			fileRight = getDataFile("stereo2.jpg");		// right image
			imgLeft = ImageFactory::readJPEG(fileLeft);
			imgRight = ImageFactory::readJPEG(fileRight);

			MatchingSAD sad(imgLeft, imgRight, 15);
			Matching matcher;

			// image1				// image2 (left of image1)	// refine the approximate matching positions
			Point2i pl1(85,53);		Point2i pr1(29,57);			pr1 = matcher.refine(sad, pl1, pr1);
			Point2i pl2(264,34);	Point2i pr2(209,36);		pr2 = matcher.refine(sad, pl2, pr2);
			Point2i pl3(362,32);	Point2i pr3(306,32);		pr3 = matcher.refine(sad, pl3, pr3);

			Point2i pl4(213,155);	Point2i pr4(155,159);		pr4 = matcher.refine(sad, pl4, pr4);

			Point2i pl5(96,209);	Point2i pr5(36,210);		pr5 = matcher.refine(sad, pl5, pr5);
			Point2i pl6(330,212);	Point2i pr6(269,211);		pr6 = matcher.refine(sad, pl6, pr6);
			Point2i pl7(276,241);	Point2i pr7(216,242);		pr7 = matcher.refine(sad, pl7, pr7);

			Point2i pl8(385,332);	Point2i pr8(321,328);		pr8 = matcher.refine(sad, pl8, pr8);
			Point2i pl9(180,389);	Point2i pr9(114,388);		pr9 = matcher.refine(sad, pl9, pr9);
			Point2i pl10(136,500);	Point2i pr10(67,500);		pr10 = matcher.refine(sad, pl10, pr10);

			fm.addCorrespondence(pl1,	pr1);
			fm.addCorrespondence(pl2,	pr2);
			fm.addCorrespondence(pl3,	pr3);

			fm.addCorrespondence(pl4,	pr4);

			fm.addCorrespondence(pl5,	pr5);
			fm.addCorrespondence(pl6,	pr6);
			fm.addCorrespondence(pl7,	pr7);
			fm.addCorrespondence(pl8,	pr8);
//			fm.addCorrespondence(pl9,	pr9);
//			fm.addCorrespondence(pl10,	pr10);

			fm.estimate();

		}
int main()
{
    Prueba pr0;

    mtk::Signal<> mySignal;

    std::cout << std::endl << "una conexión a uno     Tres conexiones a 2, mandamos un signal" << std::endl;
    mySignal.connect(&pr0, &Prueba::Recibio);
    mySignal.connect(&pr0, &Prueba::Recibio2);
    mySignal.connect(&pr0, &Prueba::Recibio2);
    mySignal.connect(&pr0, &Prueba::Recibio2);
    mySignal.emit();




    std::cout << std::endl << "Desconectamos un 2" << std::endl;
    bool result = mySignal.disconnect(&pr0, &Prueba::Recibio2);
    if (result)
        std::cout << std::endl << "Desconectamos un 2  OK" << std::endl;
    else
        std::cout << std::endl << "Desconectamos un 2  FAIL" << std::endl;
    mySignal.emit();


    std::cout << std::endl << "Desconectamos un 1" << std::endl;
    result = mySignal.disconnect(&pr0, &Prueba::Recibio);
    if (result)
        std::cout << std::endl << "Desconectamos un 1  OK" << std::endl;
    else
        std::cout << std::endl << "Desconectamos un 1  FAIL" << std::endl;
    mySignal.emit();


    std::cout << std::endl << "Desconectamos un 1" << std::endl;
    result = mySignal.disconnect(&pr0, &Prueba::Recibio);
    if (result)
        std::cout << std::endl << "Desconectamos un 1  OK" << std::endl;
    else
        std::cout << std::endl << "Desconectamos un 1  FAIL" << std::endl;
    mySignal();



    std::cout << std::endl << "desconectamos todo... y mandamos un mensaje nuevo";
    mySignal.disconnect_all();
    mySignal();



    //  pendiente la copia de signal
    //  falta meter el countPtr
//    Signal<> mySignal2;
//    mySignal2 = mySignal;

    //  pendiente que se desconecte cuando el receptor salga de ámbito
    //  delicado
    Prueba pr6(22);
    mySignal.connect(&pr6, &Prueba::Recibio);

    std::cout << std::endl << "Creamos otro recpetor temporal, conectamos a 1 mandamo señal";
    {
        Prueba pr1(23);

        mySignal.connect(&pr1, &Prueba::Recibio);
        mySignal();

    }
    std::cout << std::endl << "el últmo receptor temporal sale de ámbito";
    Prueba pr2(24);
    mySignal.connect(&pr2, &Prueba::Recibio);
    std::cout << std::endl << "acceso incorrecto a la memoria";
    std::cout << std::endl << "Sólo se debería escribir 1";
    mySignal();





    //mtk::Signal<> mySignal;
    //std::cout << std::endl << "Creamos un temporal 777 que sale de ámbito antes de poner mandar nada";

    {
        Prueba pr1(77);

        mySignal.connect(&pr1, &Prueba::Recibio);
        mySignal.connect(&pr1, &Prueba::Recibio);
        mySignal.emit();

    }
    Prueba pr22(88);
    mySignal.connect(&pr22, &Prueba::Recibio);
    mySignal();

    mySignal.disconnect(&pr22, &Prueba::Recibio);
    mySignal();



    Prueba2 prueba2;
    prueba2.Connect();
    prueba2.Signal();


    {
        //  conectamos dos signal al mismo receptor
        //  sacamos de ámbito a dicho receptor
        //  mandamos una signal
        //  tiene que recibirse
        //  esto generaba un error antes del 5 de julio de 2010

        Prueba pr;
        mtk::Signal<>  signalpr1;
        mtk::Signal<>  signalpr2;

        signalpr1.connect(&pr, &Prueba::Recibio);
        signalpr2.connect(&pr, &Prueba::Recibio);
        signalpr1.disconnect(&pr, &Prueba::Recibio);
        std::cout << "SE TIENE QUE RECIBIR..."  << std::endl;
        signalpr2.emit();
    }


    return 0;
}