Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

Rework JSON format for marker descriptors #25

Open
jim-bcom opened this issue Jun 13, 2023 · 0 comments
Open

Rework JSON format for marker descriptors #25

jim-bcom opened this issue Jun 13, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@jim-bcom
Copy link
Contributor

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"
		}
	}
}
@jim-bcom jim-bcom added the enhancement New feature or request label Jun 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant