|
From: Toby C. <tco...@pl...> - 2006-05-08 23:12:23
|
Ive had a quick look at the player code and there isn't anything obvious that is going wrong, (i.e. doubling or halving values)... I would recommend going through the cmvision code in player and putting in a few debug statements, see if its detected wrong from the start or goes wrong halfway. Also double check what size the driver thinks the image is, as that could be a likely source of error... Toby Lucas Martins De Marchi wrote: > sorry, i didn't know about email size limit... so, removing images (here > they are: http://www.lti.pcs.usp.br/~lucas/psg/ ) > email: > > Explaining better... > > I'm using player 2.0.1 (with cmvision driver for blobfinder) and gazebo 0.6 > Here are my tests: > > test.world: > --------------------------------------------------------- > <?xml version="1.0"?> > <gz:world > xmlns:gz="http://playerstage.sourceforge.net/gazebo/xmlschema/#gz" > xmlns:model="http://playerstage.sourceforge.net/gazebo/xmlschema/#model > " > xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor > " > xmlns:window="http://playerstage.sourceforge.net/gazebo/xmlschema/#window > " > xmlns:param="http://playerstage.sourceforge.net/gazebo/xmlschema/#params > " xmlns:ui="http://playerstage.sourceforge.net/gazebo/xmlschema/#params"> > <model:LightSource> > <id>0</id> > <xyz>0 0 5</xyz> > <attenuation>0.1 0.25 0.0</attenuation> > </model:LightSource> > <model:LightSource> > <id>0</id> > <xyz>10 10 5</xyz> > <attenuation>0.3 0.4 0.0</attenuation> > </model:LightSource> > <model:LightSource> > <id>0</id> > <xyz>10 0 5</xyz> > <attenuation>0.3 0.25 0.0</attenuation> > </model:LightSource> > <model:LightSource> > <id>0</id> > <xyz>0 10 5</xyz> > <attenuation>0.3 0.25 0.0</attenuation> > </model:LightSource> > > <model:GroundPlane> > <id>ground1</id> > > <!--Bounding Box --> > <model:SimpleSolid> > <id>wall0</id> > <xyz> 5 0 0 </xyz> > <shape>box</shape> > <size>10 0.02 1.8</size> > </model:SimpleSolid> > <model:SimpleSolid> > <id>wall1</id> > <xyz> 0 5 0 </xyz> > <shape>box</shape> > <size>0.02 10 1.8</size> > </model:SimpleSolid> > <model:SimpleSolid> > <id>wall2</id> > <xyz> 5 10 0 </xyz> > <shape>box</shape> > <size>10 0.02 1.8</size> > </model:SimpleSolid> > <model:SimpleSolid> > <id>wall3</id> > <xyz> 10 5 0 </xyz> > <shape>box</shape> > <size>0.02 10 1.8</size> > </model:SimpleSolid> > > > > <!-- <textureFile>grid.ppm</textureFile> --> > </model:GroundPlane> > > <model:Pioneer2DX> > <id>robot1</id> > <xyz>1 1 0.234</xyz> > <rpy>0 0 45</rpy> > <model:MonoCam> > <id>cam0</id> > <xyz>0.1 0.0 0.0</xyz> > <rpy>0 -5 0</rpy> > </model:MonoCam> > > </model:Pioneer2DX> > > <!-- A simple object... ball --> > <model:SimpleSolid> > <xyz>3 3</xyz> > <color> 1 0 1 </color> > <shape>sphere</shape> > <size>.3</size> > <model:TruthWidget> > <id>posicao_bolinha</id> > </model:TruthWidget> > </model:SimpleSolid> > </gz:world> > --------------------------------------------------------- > > test.cfg: > --------------------------------------------------------- > driver > ( > name "gazebo" > provides ["simulation:0"] > plugin "libgazeboplugin" > server_id "default" > > ) > > driver > ( > name "gazebo" > provides ["camera:0"] > gz_id "cam0" > ) > > driver > ( > name "cmvision" > provides ["blobfinder:0"] > requires ["camera:0"] > colorfile "colors.txt" > ) > > --------------------------------------------------------- > > > colors.txt > --------------------------------------------------------- > [Colors] > (255, 0, 0) 0.000000 10 Red > > [Thresholds] > (25:106,135:202,137:221) > > --------------------------------------------------------- > > > Trying to run playercam I get some GTK errors related to this > playercam.c line: > 190: gdk_pixbuf_composite(blobbuf, > > g_pixbuf, > g_blobs[i].left, > g_blobs[i].top, > abs(g_blobs[i].right - g_blobs[i].left), > abs(g_blobs[i].top - g_blobs[i].bottom), > 1, 1, 1, 1, GDK_INTERP_NEAREST, 128); > > So, i've deleted it and put this: > printf("Number of blobs: %d\n Ret.: (%d,%d)(%d,%d)\nCentroid: > (%d,%d)\nArea: %d\n\n",(int)g_blob_count,(int)g_blobs[i].left, > (int)g_blobs[i].top, (int)g_blobs[i].right,(int)g_blobs[i].bottom, > (int)g_blobs[i].x,(int)g_blobs[i].y, (int)g_blobs[i].area); > > And now i'm getting this output: > > Number of blobs: 1 > Ret.: (143,157)(172,284) > Centroid: (151,148) > Area: 160 > > How you can see, this output is wrong!!! My image is only 320x240 and > it's reporting one point at (172,284) > Additionaly, Centroid is outside the blob!!! > > I've made sometime ago a program to load an image file and run CMVision > in it. So, i've saved a frame in player, and, running my program, > CMVision (outside player) gives me: > > Number of blobs: 1 > Ret: (148;139)(172;161) > Centroid: (159,391083;149,856430) // Centroid, originally in > CMVision is float > Area: 404 > > Images in this email are which used in (out.ppm) and generated > (processed.png) by my program (it is... i think my old cmvision program > is working well...) > > > > Thnx > Lucas Martins De Marchi |