PROBLEM
Currently marker descriptor usage looks like this:
https://github.com/SolarFramework/Sample-Relocalization/blob/master/SolARPipeline_RelocalizationMarker/tests/SolARPipelineTest_RelocalizationMarker/markers.json
- it contains a
nbTrackables that needs to be in sync with the file content
- URLs are given to fiducial markers whereas this field is not used, it's only intended to be used by image markers (or is it?)
- a naming convention for JSON object is mandatory to enforce an ordered list of the elements, e.g.
trackable 1
- markers type are not human readable, but consists in numbers
The parser is here:
https://github.com/SolarFramework/SolARModuleTools/blob/develop/src/SolARWorldGraphLoader.cpp
SUGGESTION
- get rid of
nbTrackables and use parser library (nlohmann) API to iterate over elements. If an order is needed, use a JSON array.
- don't use
url field to store a human readable Fiducial marker name. Instead, with the previous suggestion, the naming convention of elements is no longer required, and marker elements can be given names. url could be use optionnally to point to a image representing the marker, so that a user have a preview of it (easier to see than mentally parsing the pattern) and print it to test the pipeline.
- use human readable names for marker types (ex: "FIDUCIAL", "IMAGE", QRCODE", ...)
- Nice to have: a JSON schema to validate the files. This would prevent user from adding a
code field to a fiducial marker description for example.
With this modification, the previous file could go from looking like this:
{
"nbTrackables": 2,
"trackable 0":{
"type": 1,
"data":{
"url": "FiducialMarkerA",
"transform3D": [...],
"size": {...},
"pattern": [...]
}
},
"trackable 1":{
"type": 2,
"data":{
"url": "ImageMarker1.png",
"transform3D": [...],
"size": {...},
}
}
"trackable 2":{
"type": 3,
"data":{
"url": "QRCode1",
"transform3D": [...],
"size": {...},
"code": "QRCode1"
}
}
}
to this:
{
"FiducialMarkerA":{
"type": "FIDUCIAL",
"data":{
"url": "http://foo.com/FiducialMarkerA.png", // optional? (Get preview, be able to print it)
"transform3D": [...],
"size": {...},
"pattern": [...]
}
},
"ImageMarker1":{
"type": IMAGE,
"data":{
"url": "http://foo.com/ImageMarker1.png", // must exist
"transform3D": [...],
"size": {...},
}
}
"QrCode1":{
"type": QRCODE,
"data":{
"url": "http://foo.com/QrCode1.png)", // optional? (Get preview, be able to print it)
"transform3D": [...],
"size": {...},
"code": "QRCode1"
}
}
}
PROBLEM
Currently marker descriptor usage looks like this:
https://github.com/SolarFramework/Sample-Relocalization/blob/master/SolARPipeline_RelocalizationMarker/tests/SolARPipelineTest_RelocalizationMarker/markers.json
nbTrackablesthat needs to be in sync with the file contenttrackable 1The parser is here:
https://github.com/SolarFramework/SolARModuleTools/blob/develop/src/SolARWorldGraphLoader.cpp
SUGGESTION
nbTrackablesand use parser library (nlohmann) API to iterate over elements. If an order is needed, use a JSON array.urlfield to store a human readable Fiducial marker name. Instead, with the previous suggestion, the naming convention of elements is no longer required, and marker elements can be given names.urlcould be use optionnally to point to a image representing the marker, so that a user have a preview of it (easier to see than mentally parsing thepattern) and print it to test the pipeline.codefield to a fiducial marker description for example.With this modification, the previous file could go from looking like this:
to this: