Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public LinkedHashMap<Integer, Integer> createConfigurationXml (Cursor c)
- {
- LinkedHashMap<Integer, Integer> cosMarkerRelation = new LinkedHashMap<Integer, Integer>();
- String sensorID = "ArBusterSensor";
- String maxObjectsToDetectPerFrame = "5";
- String maxObjectsToTrackInParallel = "5";
- String xmlHeader = "<?xml version='1.0' encoding='UTF-8'?><TrackingData> <Sensors> <Sensor subtype='FAST' type='FeatureBasedSensorSource'> <SensorID>"+sensorID+"</SensorID> <Parameters> <MaxObjectsToDetectPerFrame>"+maxObjectsToDetectPerFrame+"</MaxObjectsToDetectPerFrame> <MaxObjectsToTrackInParallel>"+maxObjectsToTrackInParallel+"</MaxObjectsToTrackInParallel> </Parameters>";
- String xmlMiddle = "</Sensor> </Sensors> <Connections> ";
- String xmlFooter = "</Connections></TrackingData>";
- String xmlMarkerHeader = "";
- String xmlMarkerConfiguration = "";
- int i=1;
- c.moveToFirst();
- do
- {
- xmlMarkerHeader += "<SensorCOS> <SensorCosID>"+c.getString(c.getColumnIndex("marker_id"))+"</SensorCosID> <Parameters> <SimilarityThreshold>0.7</SimilarityThreshold> <ReferenceImage HeightMM='200' WidthMM='200'>"+c.getString(c.getColumnIndex("marker_name"))+"</ReferenceImage> </Parameters> </SensorCOS>";
- xmlMarkerConfiguration += "<COS> <Name>"+c.getString(c.getColumnIndex("marker_id"))+"</Name> <Fuser type='SmoothingFuser'> <Parameters> <AlphaRotation>0.5</AlphaRotation> <AlphaTranslation>0.8</AlphaTranslation> <GammaRotation>0.5</GammaRotation> <GammaTranslation>0.8</GammaTranslation> <KeepPoseForNumberOfFrames>0</KeepPoseForNumberOfFrames> </Parameters> </Fuser> <SensorSource trigger='1'> <SensorID>"+sensorID+"</SensorID> <SensorCosID>"+c.getString(c.getColumnIndex("marker_id"))+"</SensorCosID> <HandEyeCalibration> <TranslationOffset> <x>0</x> <y>0</y> <z>0</z> </TranslationOffset> <RotationOffset> <x>0</x> <y>0</y> <z>0</z> <w>1</w> </RotationOffset> </HandEyeCalibration> <COSOffset> <TranslationOffset> <x>0</x> <y>0</y> <z>0</z> </TranslationOffset> <RotationOffset> <x>0</x> <y>0</y> <z>0</z> <w>1</w> </RotationOffset> </COSOffset> </SensorSource> </COS>";
- cosMarkerRelation.put(i, c.getInt(c.getColumnIndex("animation_id")));
- i++;
- }while(c.moveToNext());
- String fullXml = xmlHeader+xmlMarkerHeader+xmlMiddle+xmlMarkerConfiguration+xmlFooter;
- writeToFile(fullXml, xmlFilePath, xmlFileName);
- return cosMarkerRelation;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement