The XR Edge Compare API allows to compare scene edges against edges generated from a camera image on a per-pixel basis.
The feature is running in realtime and only available with the local rendering setup.
Quick Start
Example
// Get an instance of the ContextAPIconstcontext = webvis.getContext()// Activate XR Edge Compare mode for one or more nodesconstnodeIDs = [1, 2, 3];context.setProperty(nodeIDs, webvis.Property.COMPARISON_GROUP, webvis.ComparisonGroup.XR_EDGE);// Get default viewerconstviewer = context.getViewer();// Adjust all or a subset of the XR Edge compare propertiesviewer.changeXREdgeCompare({mode:webvis.XREdgeCompareMode.SCENE_WITH_CAMERA,edgeDetectionThreshold:0.8,searchRadius:7});
Events
The ViewerXREdgeCompareAPI emits the following events:
Request scores caluclated based on the ratio of matching/non-matching pixels of the XR Edge Compare feature. Passed nodes must be in XR Edge Compare mode mode to produce a valid score. Multiple concurrent requests of this method are not allowed.
Example
// Get an instance of the ContextAPIconstmyContext : ContextAPI = webvis.getContext( "example" )// The node to request a result forconstnodeID = 1;// Enable XR Edge Compare mode for nodemyContext.setProperty(nodeID, webvis.Property.COMPARISON_GROUP, webvis.ComparisonGroup.XR_EDGE);asyncfunctionupdate() {// Request scoreconstresult = awaitmyContext.getViewer().requestXRAutoDetectScores([nodeID]);// Check score valueconsole.log(result[0].score > 0.5 ? "Positive" : "Negative");// Re-request score twice per second as long as node is in XR Edge Compare modeif (result[0].details.edgeCompareEnabled) {setTimeout(update, 500); }}// Start loopupdate();
InstanceGraphAPI
Overview
The XR Edge Compare API allows to compare scene edges against edges generated from a camera image on a per-pixel basis. The feature is running in realtime and only available with the local rendering setup.
Quick Start
Example
Events
The ViewerXREdgeCompareAPI emits the following events: