This repository was archived by the owner on Jul 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
This repository was archived by the owner on Jul 20, 2023. It is now read-only.
Rework JSON format for marker descriptors #25
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
PROBLEM
Currently marker descriptor usage looks like this:
- it contains a
nbTrackablesthat 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
nbTrackablesand use parser library (nlohmann) API to iterate over elements. If an order is needed, use a JSON array. - don't use
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. - 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
codefield 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"
}
}
}
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request