Log in or register to post comments

config.xml size param unit definition?

April 7, 2011 - 6:51pm #1

Is there a way to explicitly define the units of the size param on the ImageTarget element in config.xml?

something like...


unit="mm" size="247 173" name="stones" />

Or are the units arbitrary - based on the division of the target region by the dimension values provided? And if so, does this also establish the scene unit?

This is the wording in the dev guide that I'm confused about..

Quote:

Target size

Target size is the actual size of the Image Target in 3D scene units. A developer must specify this in the config.xml file. The config.xml file is generated by the Target Management system, but it can be modified by the developer. By default, the Target Management system defines the size of an Image Target based on its size in pixels, which may not fit the 3D scene. The size parameter is very important, as the pose information returned during tracking will be in the same scale. For example, if your Image Target is 16 units wide, moving the camera from the left border of the target to the right border of the target will change the returned position by 16 units along the x-axis.

(x,y) - size of the target in scene units measured along the horizontal and vertical axes of the rectangular target.

The guide later states that the ImageTarget samples are defined in millimeters, which suggests that the unit is established by the dimension values provided.

Also the passage above implies that if no size param is defined, that the system will default to pixel units - is this accurate?

And lastly is there a copy of qcar_config.xsd around? I haven't been able to find a schema definition for config.xml.

Re: config.xml size param unit definition?

April 8, 2011 - 7:27am #3

I guess if the image you print out is 10cm across and you make the size in the config.xml 10 then 1 unit = 1 cm?

Re: config.xml size param unit definition?

April 8, 2011 - 5:48am #2

The units are arbitrary, as they typically are with OpenGL applications. You can decide whether a unit is a mm, cm, etc. This can matter when integrating with things like physics engines, but in general it's all relative.

The size parameter needs to be in the config.xml. When you download a fresh config file from the TMS (My Trackables) it comes with a default size based on the dimensions of the uploaded image. You can change this size, but be careful to stick with the same aspect ratio. If you change the size you may also need to change the near/far values of the projection matrix, you want the target to fit comfortably within the frustum the projection defines.

If your application uses multiple targets/markers, it can be important to use the real-world "print" measurements in the config file. Again, you can scale the values to whatever you'd like, but the relative size of the different targets should be reflected. This will assure that occlusion between objects on different targets works correctly.

Quote:

And lastly is there a copy of qcar_config.xsd around? I haven't been able to find a schema definition for config.xml.

This is a good question, let me ask.

- Kim

Log in or register to post comments