Table des matières

ueye

USB Ueye camera 2230-C (Imasys distributor, order n° L82729 of 22.02.2008)

appli ueyegrab modifiée pour le nouveau driver: /home/bvandepo/Desktop/ueye/ueyegrabtemp2

./ueyegrab a 10 im
./ueyegrab c 10 im

l'appli ne debayeurise plus avec le nouveau driver, refuse de sauver les images

doc faite pour l'ancien driver: https://intranet.laas.fr/intranet/robots/wiki/Manta/uEyeSoftware

la diode verte sur la ueye doit etre allumée pour pouvoir acquerir des images, sinon lancer:

sudo /etc/init.d/ueyeusbdrc start

pour regler la camera, utiliser la gui

ueyedemo

les sources sont dans /usr/src/ids/ueyedemo il y a un probleme avec l'enregistrement des images… copie en /home/bvandepo/Desktop/ueye/ueye_demo3.9b pour pouvoir arranger: c'est la fonction suivante qui déconne en ligne 937 de mainview.cpp : ret = is_SaveImageEx (m_hCamera, (char*)fileName.latin1 (), fileformat, fileparam);-

    
    
    modif pour sauver  images en séquences:
     //BVDP
      int ret;
        int fileformat = IS_IMG_PNG;
        int fileparam = 0;
        static unsigned int cpt=0;
        char chaine[1000];
        sprintf(chaine,"/home/bvandepo/Desktop/ueye/ueye_demo3.9b/im%04d.png",cpt);
        QString fileName=chaine;
        cpt++;
        ret = is_SaveImageEx (m_hCamera, (char*)fileName.latin1 (), fileformat, fileparam);
          if (ret != IS_SUCCESS)
          {
              QMessageBox::critical(this, "Error!", QString("Saving image failed with code %1!").arg(ret), QMessageBox::Ok, 0);
          }
    
    

soft avec gui modifiée pour sauver des sequences sur hd, à compiler avec kdevelop

borderouge:/home/bvandepo/Desktop/ueye/ueye_demo3/src

je n'arrive plus à la compiler, car elle utilise des vieux headers de QT3, il faudra plutot récuperer mes modifs et les appliquer à la nouvelle appli démo de ueye.

anciennement:

sudo rm /usr/lib/libueye_api.so.1
sudo rm /usr/lib/libueye_api.so
sudo ln -s /usr/lib/libueye_api.so.1.0.0 /usr/lib/libueye_api.so.1
sudo ln -s /usr/lib/libueye_api.so.1.0.0 /usr/lib/libueye_api.so

artag

copie du robotpkg dans /home/bvandepo/Desktop/monArtToolkit/

regarder le fichier INSTALL: choix config build debug ou release dans

/home/bvandepo/Desktop/monArtToolkit/build/linux/options.pro

ajouter une variable d'environnement dans le project→build ARTKP : /home/bvandepo/Desktop/monArtToolkit/sample/simple/src

marqueurs standard dans /home/bvandepo/robotpkg/image/artoolkitplus/work.borderouge.laas.fr/id-markers/simple/std-border

pour les imprimer, d'abord les agrandir sans interpolation

 convert SimpleStd_100.png -scale 10000% SimpleStd_100-resize1000.png

gdhe: http://www.openrobots.org/wiki/gdhe/

nouvelle version, je n'ai pas encore testé

http://studierstube.icg.tugraz.at/download.php

hard

astec: http://www.asctec.de/manuals-2/

mini pci express sur pelican: http://en.wikipedia.org/wiki/PCI_Express#PCI_Express_Mini_Card

usb3 sur pci express: http://www.google.fr/products/catalog?q=mini+pci+express&hl=fr&client=firefox-a&hs=yQu&rls=org.mozilla:en-US:official&prmd=imvns&biw=1280&bih=801&um=1&ie=UTF-8&tbm=shop&cid=2374725182668316881&sa=X&ei=Iz3OTvDDDYT64QS_ha1K&ved=0CIgBEPMCMAk

ssd pci express: http://www.google.fr/products/catalog?q=mini+pci+express&hl=fr&client=firefox-a&hs=yQu&rls=org.mozilla:en-US:official&prmd=imvns&biw=1280&bih=801&um=1&ie=UTF-8&tbm=shop&cid=7075561405103046470&sa=X&ei=Iz3OTvDDDYT64QS_ha1K&ved=0CIQBEPMCMAg

ssd: http://www.presence-pc.com/actualite/msata-minicard-42369/

camera D5M: http://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&No=281

sig integration: https://wiki.laas.fr/robots/microCameras

https://wiki.laas.fr/robots/SigIntegration

carte terrasic: http://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&CategoryNo=139&No=593&PartNo=2

ftdi usb2: http://www.ftdichip.com/Products/ICs/FT2232H.htm

http://www.logicbricks.com/Solutions/Surround-View-DA-System/logiVIEW-SVK-Hardware-Platform.aspx

commandes triggers

http://sine.ni.com/nips/cds/view/p/lang/en/nid/209914

http://sine.ni.com/nips/cds/view/p/lang/en/nid/14155

http://sine.ni.com/nips/cds/view/p/lang/en/nid/208820

http://sine.ni.com/nips/cds/view/p/lang/en/nid/208809

autres cameras

usb global shutter:

http://www.elvitec.fr/modules/produit2/f-usb%20couleur-165.php

http://pixhawk.ethz.ch/wiki/electronics/camera

mt9v034: http://www.matrix-vision.com/camera-industrielle-usb-2.0-mvbluefox.html

http://matrix-vision.com/manuals/mvBlueFOX/mvBF_page_introduction.html

liste usb: http://www.directindustry.fr/fabricant-industriel/camera-usb-82079.html

liste gige: http://www.directindustry.fr/fabricant-industriel/camera-gige-80958.html

librairies

eigen

http://eigen.tuxfamily.org/index.php?title=Main_Page

http://bitbucket.org/eigen/eigen/get/3.0.3.tar.bz2

sudo cp -r Eigen /usr/include
cmake demos
make

résolution d'un systeme d'équations linéaires: http://eigen.tuxfamily.org/dox-devel/TutorialAdvancedLinearAlgebra.html

utilisation de svd: http://forum.kde.org/viewtopic.php?f=74&t=62175

paparazzi qt

shiva@shiva:~/paparazzi/paparazziqt$ find .. | grep .*\.h$ >>listh
shiva@shiva:~/paparazzi/paparazziqt$ find .. | grep .*\.c$ >>listc

http://www.gnu.org/software/sed/manual/sed.html#Examples

artag 2013

————————————————————————————————- autre version du driver nécessaire pour ma version de programme

~/ueye3.9/uEye_Linux_3.90_32Bit>

sudo sh ./ueyesdk-setup-3.90-usb-i686.gz.run
sudo /etc/init.d/ueyeusbdrc start

programme dans

~/Desktop/ueye/ueye_demo3.9b> nécessite Eigen

sudo cp -r ~/Desktop/ueye/eigen-eigen-3.0.3/Eigen /usr/include/

nécessite gdhe pour faire l'affichage de la pose 3D (peut être pas obligatoire)


probleme avec les fichier de calibrage distorsion_ueye_640.cal il faut remplacer les points par des virgules (regler locale??) → c'est bon!

http://stackoverflow.com/questions/13489940/stupid-bug-with-fscanf-comma-instead-of-point

@user1773603 And probably broke everything else. The (almost) first line in any console application written in C++ should be std::locale::global( std::locale( “” ) );; in C, this would be setlocale( LC_ALL, “” );

NE MARCHE PAS!!!!

IL faut faire:

      std::setlocale(LC_ALL, "en_US.UTF-8");

utiliser ueyedemo pour graber des images pour l'étalonnage: cp /home/bvandepo/Desktop/ueye/ueye_demo3.9b/im*.pgm

cat /home/bvandepo/Desktop/ueye/ueye_demo3.9b/distortion_ueye_640.cal cp /home/bvandepo/Desktop/ueye/ueye_demo3.9b/distortion_ueye_640.cal distortion_ueye_640.cal.sav gedit distortion_ueye_640.cal

cp -r ~/Desktop/ueye/calib/ueye640 ~/Desktop/ueye/calib/ueye640_42 cp /home/bvandepo/Desktop/ueye/ueye_demo3.9b/im*.pgm ~/Desktop/ueye/calib/ueye640_42/TOOLBOX_calib_TP2007

cd ~/Desktop/ueye/calib/ueye640_42/TOOLBOX_calib_TP2007 rm Calib_Results.mat sinon probleme à l'enregistrement plus tard matlab cd ~/Desktop/ueye/calib/ueye640_42/TOOLBOX_calib_TP2007 calib_gui script pour sauver au format .cal d'artag: je part de saving_calib_ascii.m → saving_calib_artag.m cp saving_calib_ascii.m saving_calib_artag.m format de fichier: http://handheldar.icg.tugraz.at/artoolkitplus.php http://www.vision.caltech.edu/bouguetj/calib_doc/htmls/parameters.html avant la calib, est_dist=[ 1 1 0 0 0 ]' pour avoir uniquement la distorsion radiale à degré 2, pour les autres paramètres, l'ordre n'est pas le même… ARToolKitPlus_CamCal_Rev02 640 480 369,46127 220,13294 655,30253 652,92494 -0,44156 0,21704 0,00060 -0,00032 0,00000 0,0 0 ——————————————————– save_name = 'Calib_Results.cal'; fprintf(1,'Generating the artoolkit %s file containing the intrinsic and extrinsic parameters…\n',save_name) fid = fopen([ save_name ],'wt'); 640 480 369,46127 220,13294 655,30253 652,92494 -0,44156 0,21704 0,00060 -0,00032 0,00000 0,0 0 descriptif du format: http://handheldar.icg.tugraz.at/artoolkitplus.php fprintf(fid,'ARToolKitPlus_CamCal_Rev02\n'); fprintf(fid,'%d %d ',nx,ny); fprintf(fid,'%5.15f %5.15f ',cc); fprintf(fid,'%5.15f %5.15f ',fc); fprintf(fid,'%5.15f %5.15f %5.15f %5.15f %5.15f ',kc); fprintf(fid,'0.0 '); fprintf(fid,'0 '); %%nbiter fprintf(fid,'\n'); fclose(fid); ——————————————————– ARToolKitPlus_CamCal_Rev02 752 480 380.586510739687810 212.040391386264446 726.305644381821253 728.322368265565387 -0.428831350163733 0.180648056392733 0.004417931387798 0.002052143842308 0.0000000000000000 0 il faut remplacer . par , et ajouter un zero ARToolKitPlus_CamCal_Rev02 752 480 380,586510739687810 212,040391386264446 726,305644381821253 728,322368265565387 -0,428831350163733 0,180648056392733 0,004417931387798 0,002052143842308 0,0000000000000000 0 0 cp ~/Desktop/ueye/calib/ueye640_42/TOOLBOX_calib_TP2007/Calib_Results.cal ~/Desktop/ueye/ueye_demo3.9b/ AFFICHER L'IMAGE RECTIFIEE (sans distorsion) :~/openrobots/include/ARToolKitPlus> grep -nRi disto * Tracker.h:98: / Set to true to try loading camera undistortion table from a cache file Tracker.h:100: * On slow platforms (e.g. Smartphone) creation of the undistortion lookup-table Tracker.h:182: / Changes the undistortion mode Tracker.h:185: * artoolkit's standard undistortion method is used. Tracker.h:187: virtual void setUndistortionMode(UNDIST_MODE nMode) = 0; TrackerImpl.h:209: / Changes the undistortion mode TrackerImpl.h:212: * artoolkit's standard undistortion method is used. TrackerImpl.h:214: virtual void setUndistortionMode(UNDIST_MODE nMode); TrackerImpl.h:459: void buildUndistO2ITable(Camera* pCam); TrackerImpl.h:617: camera distortion addon by Daniel TrackerImpl.h:620: unsigned int *undistO2ITable; TrackerImpl.h:8976: if the camera parameters change, the undistortion LUT has to be rebuilt. TrackerImpl.h:8979: if(undistO2ITable && (arImXsize!=pCam→xsize || arImYsize!=pCam→ysize)) TrackerImpl.h:8981: artkp_Free(undistO2ITable); TrackerImpl.h:8982: undistO2ITable = NULL; TrackerImpl.h:10181: Included ../../src/core/paramDistortion.cxx TrackerImpl.h:10217: * $Id: paramDistortion.cxx 172 2006-07-25 14:05:47Z daniel $ TrackerImpl.h:10290: if(!undistO2ITable) TrackerImpl.h:10291: buildUndistO2ITable(pCam); TrackerImpl.h:10295: fixedToFloat(undistO2ITable[x+y*arImXsize], *ix,*iy); TrackerImpl.h:10301:AR_TEMPL_TRACKER::buildUndistO2ITable(Camera* pCam) TrackerImpl.h:10320: if(undistO2ITable) TrackerImpl.h:10321: delete undistO2ITable; TrackerImpl.h:10322: artkp_Free(undistO2ITable); TrackerImpl.h:10324: undistO2ITable = new unsigned int [arImXsize*arImYsize]; TrackerImpl.h:10325: undistO2ITable = artkp_Alloc<unsigned int>(arImXsize*arImYsize); TrackerImpl.h:10331: size_t numBytes = fread(undistO2ITable, 1, arImXsize*arImYsize*sizeof(unsigned int), fp); TrackerImpl.h:10348: undistO2ITable[x+y*arImXsize] = fixed; TrackerImpl.h:10355: fwrite(undistO2ITable, 1, arImXsize*arImYsize*sizeof(unsigned int), fp); TrackerImpl.h:10382: End of ../../src/core/paramDistortion.cxx TrackerImpl.h:10694: printf(“Distotion factor = %f %f %f %f\n”, param→dist_factor[0], TrackerImpl.h:12214: undistortion addon by Daniel TrackerImpl.h:12217: undistO2ITable = NULL; TrackerImpl.h:12279: if(undistO2ITable) TrackerImpl.h:12280: artkp_Free(undistO2ITable); TrackerImpl.h:12281: undistO2ITable = NULL; TrackerImpl.h:12409: buildUndistO2ITable(arCamera); TrackerImpl.h:12559:AR_TEMPL_TRACKER::setUndistortionMode(UNDIST_MODE nMode) TrackerImpl.h:12875: requirements for the lens undistortion table (undistO2ITable) TrackerMultiMarkerImpl.h:143: void setUndistortionMode(UNDIST_MODE nMode) { AR_TEMPL_TRACKER::setUndistortionMode(nMode); } TrackerSingleMarkerImpl.h:141: void setUndistortionMode(UNDIST_MODE nMode) { AR_TEMPL_TRACKER::setUndistortionMode(nMode); } borderouge:~/openrobots/include/ARToolKitPlus>

TrackerImpl.h:

namespace ARToolKitPlus {

AR_TEMPL_FUNC int AR_TEMPL_TRACKER::arInitCparam(Camera *pCam) {

// if the camera parameters change, the undistortion LUT has to be rebuilt.
// (this is done automatically in arParamObserv2Ideal_LUT or arParamIdeal2Observ_LUT)
undistMode = UNDIST_STD;
undistO2ITable = NULL;

:~/openrobots/include/ARToolKitPlus> grep -nRi arParamObserv2Ideal_LUT *

TrackerImpl.h:449: int arParamObserv2Ideal_LUT(Camera* pCam, ARFloat ox, ARFloat oy, ARFloat *ix, ARFloat *iy); TrackerImpl.h:8977: (this is done automatically in arParamObserv2Ideal_LUT or arParamIdeal2Observ_LUT) TrackerImpl.h:10288:AR_TEMPL_TRACKER::arParamObserv2Ideal_LUT(Camera* pCam, ARFloat ox, ARFloat oy, ARFloat *ix, ARFloat *iy) TrackerImpl.h:12575: arParamObserv2Ideal_func = &AR_TEMPL_TRACKER::arParamObserv2Ideal_LUT; TrackerImpl.h:10288: AR_TEMPL_FUNC int AR_TEMPL_TRACKER::arParamObserv2Ideal_LUT(Camera* pCam, ARFloat ox, ARFloat oy, ARFloat *ix, ARFloat *iy) { if(!undistO2ITable) buildUndistO2ITable(pCam); int x=(int)ox, y=(int)oy; fixedToFloat(undistO2ITable[x+y*arImXsize], *ix,*iy); return 0; } j'ai changé : tracker→setUndistortionMode(ARToolKitPlus::UNDIST_LUT); en tracker→setUndistortionMode(ARToolKitPlus::UNDIST_STD); A LA FIN j'ai carrement mis en NONE et ca marche pas moins bien___!!!!!!!!! le choix regle une fonction parmi plusieurs: ARPARAM_UNDIST_FUNC arParamObserv2Ideal_func; AR_TEMPL_FUNC void AR_TEMPL_TRACKER::setUndistortionMode(UNDIST_MODE nMode) { undistMode = nMode; switch(undistMode) { case UNDIST_NONE: arParamObserv2Ideal_func = &AR_TEMPL_TRACKER::arParamObserv2Ideal_none; arParamIdeal2Observ_func = arParamIdeal2Observ_none;

	break;
case UNDIST_STD:
	arParamObserv2Ideal_func = &AR_TEMPL_TRACKER::arParamObserv2Ideal_std;
	//arParamIdeal2Observ_func = arParamIdeal2Observ_std;
	break;
case UNDIST_LUT:
	arParamObserv2Ideal_func = &AR_TEMPL_TRACKER::arParamObserv2Ideal_LUT;
	//arParamIdeal2Observ_func = arParamIdeal2Observ_LUT;
	break;
}

}

int arParamObserv2Ideal_none(Camera* pCam, ARFloat ox, ARFloat oy, ARFloat *ix, ARFloat *iy);
int arParamObserv2Ideal_LUT(Camera* pCam, ARFloat ox, ARFloat oy, ARFloat *ix, ARFloat *iy);
int arParamObserv2Ideal_std(Camera* pCam, ARFloat ox, ARFloat oy, ARFloat *ix, ARFloat *iy);
int arParamIdeal2Observ_std(Camera* pCam, ARFloat ix, ARFloat iy, ARFloat *ox, ARFloat *oy);

AR_TEMPL_FUNC int AR_TEMPL_TRACKER::arParamObserv2Ideal_std(Camera* pCam, ARFloat ox, ARFloat oy, ARFloat *ix, ARFloat *iy) {

pCam->observ2Ideal(ox,oy,ix,iy);
return(0);

}

AR_TEMPL_FUNC int AR_TEMPL_TRACKER::arParamIdeal2Observ_std(Camera* pCam, ARFloat ix, ARFloat iy, ARFloat *ox, ARFloat *oy) {

pCam->ideal2Observ(ix,iy,ox,oy);
return(0);

}

AR_TEMPL_FUNC int AR_TEMPL_TRACKER::arParamObserv2Ideal_none(Camera* pCam, ARFloat ox, ARFloat oy, ARFloat *ix, ARFloat *iy) {

return(0); }

AR_TEMPL_FUNC int AR_TEMPL_TRACKER::arParamObserv2Ideal_LUT(Camera* pCam, ARFloat ox, ARFloat oy, ARFloat *ix, ARFloat *iy) {

if(!undistO2ITable)
	buildUndistO2ITable(pCam);
int x=(int)ox, y=(int)oy;
fixedToFloat(undistO2ITable[x+y*arImXsize], *ix,*iy);
return 0;

}

AR_TEMPL_FUNC void AR_TEMPL_TRACKER::buildUndistO2ITable(Camera* pCam) {

int x,y;
ARFloat cx,cy, ox,oy;
unsigned int fixed;
char* cachename = NULL;
bool loaded = false;
if(loadCachedUndist)
{
	assert(pCam->getFileName());
	cachename = new char[strlen(pCam->getFileName())+5];
	strcpy(cachename, pCam->getFileName());
	strcat(cachename, ".LUT");
}
// we have to take care here when using a memory manager that can not free memory
// (usually this lookup table should only be built once - unless we change camera resolution)
//
if(undistO2ITable)
	//delete undistO2ITable;
	artkp_Free(undistO2ITable);
//undistO2ITable = new unsigned int [arImXsize*arImYsize];
undistO2ITable = artkp_Alloc<unsigned int>(arImXsize*arImYsize);
if(loadCachedUndist)
{
	if(FILE* fp = fopen(cachename, "rb"))
	{
		size_t numBytes = fread(undistO2ITable, 1, arImXsize*arImYsize*sizeof(unsigned int), fp);
		fclose(fp);
		if(numBytes == arImXsize*arImYsize*sizeof(unsigned int))
			loaded = true;
	}
}
if(!loaded)
{
	for(x=0; x<arImXsize; x++)
	{
		for(y=0; y<arImYsize; y++)
		{
			arParamObserv2Ideal_std(pCam, (ARFloat)x, (ARFloat)y, &cx, &cy);
			floatToFixed(cx,cy, fixed);
			fixedToFloat(fixed, ox,oy);
			undistO2ITable[x+y*arImXsize] = fixed;
		}
	}
	if(loadCachedUndist)
		if(FILE* fp = fopen(cachename, "wb"))
		{
			fwrite(undistO2ITable, 1, arImXsize*arImYsize*sizeof(unsigned int), fp);
			fclose(fp);
		}
}
delete cachename;

}

AR_TEMPL_FUNC int AR_TEMPL_TRACKER::arParamObserv2Ideal(Camera *pCam, ARFloat ox, ARFloat oy, ARFloat *ix, ARFloat *iy) {

pCam->observ2Ideal(ox,oy,ix,iy);
return(0);

}

AR_TEMPL_FUNC int AR_TEMPL_TRACKER::arParamIdeal2Observ(Camera *pCam, ARFloat ix, ARFloat iy, ARFloat *ox, ARFloat *oy) {

pCam->ideal2Observ(ix,iy,ox,oy);
return(0);

}

organisation des parametres de artoolkit

ligne 11251 de TrackerImpl.h

void CameraAdvImpl:: observ2Ideal(ARFloat ox, ARFloat oy, ARFloat *ix, ARFloat *iy) {

if(undist_iterations <= 0)
{
	*ix = ox;
	*iy = oy;
}
else
{
	const ARFloat xd[2] = { (ox - cc[0]) / fc[0], (oy - cc[1]) / fc[1] };
	const ARFloat k1 = kc[0];
	const ARFloat k2 = kc[1];
	const ARFloat k3 = kc[4];
	const ARFloat p1 = kc[2];
	const ARFloat p2 = kc[3];
ARFloat x[2] = { xd[0], xd[1] };
	for(int kk=0; kk<undist_iterations; kk++)
	{
		const ARFloat x0_sq = (x[0]*x[0]);
		const ARFloat x1_sq = (x[1]*x[1]);
		const ARFloat x0_x1 = (x[0]*x[1]);
		const ARFloat r_2 = x0_sq + x1_sq;
		const ARFloat r_2_sq = (r_2 * r_2);
		const ARFloat k_radial =  1 + k1 * r_2 + k2 * (r_2_sq) + k3 * (r_2*r_2_sq);
		const ARFloat delta_x[2] = {   2*p1*x0_x1 + p2*(r_2 + 2*x0_sq),
			p1 * (r_2 + 2*x1_sq) + 2*p2*x0_x1   };
		x[0] = xd[0] - delta_x[0];
		x[1] = xd[1] - delta_x[1];
		x[0] /= k_radial;
		x[1] /= k_radial;
	}

}

dans mainview.cpp

 float patternWidth=10;   //regle la taille du tag en mm
  static ARToolKitPlus::TrackerSingleMarker *tracker ;

l65 de CameraAdvImpl.h, je commente le protected pour rendre les param de camera accessible de l'exterieur non c'est la merde…

je fais une fonction avec les paramètres en dur, a changer plus tard

toImg(float * xp11,float * yp11) { float cc[2]; float fc[2]; cc[0]=386.900347574709258; cc[1]=226.702053834467705; fc[0]=735.391491383619950; fc[1]=736.881605234999142; *xp11=(*xp11*fc[0])+cc[0]; *yp11=(*yp11*fc[1])+cc[1]; }

l309 de TrackerSingleMarkerImpl.h

  // find best visible marker
  int j, k = -1;
  for(j = 0; j < marker_num; j++)
      if(marker_info[j].id!=-1 && (nPattern==-1 || nPattern==marker_info[j].id))

nPattern=-1 …

/// calculates the transformation matrix
/**
 *	pass the image as RGBX (32-bits) in 320x240 pixels.
 *  if nPattern is not -1 then only this pattern is accepted
 *  otherwise any found pattern will be used.
 */
virtual int calc(const unsigned char* nImage, int nPattern=-1, bool nUpdateMatrix=true,
		 ARMarkerInfo** nMarker_info=NULL, int* nNumMarkers=NULL);