ViewerXREdgeCompareAPI¶
Interface ViewerXREdgeCompareAPIExperimental
interface ViewerXREdgeCompareAPI {
changeXREdgeCompare(
properties: XREdgeCompareProperties,
): XREdgeCompareProperties;
getXREdgeCompareProperties(): XREdgeCompareProperties;
requestXRAutoDetectScores(nodeIDs: number[]): Promise<XRAutoDetectScore[]>;
}
changeXREdgeCompare(
properties: XREdgeCompareProperties,
): XREdgeCompareProperties;
getXREdgeCompareProperties(): XREdgeCompareProperties;
requestXRAutoDetectScores(nodeIDs: number[]): Promise<XRAutoDetectScore[]>;
}
Hierarchy (View Summary)
- ViewerXREdgeCompareAPI
Methods
change XR Edge Compare
ExperimentalSets the specified properties.
Parameters
- properties: XREdgeCompareProperties
An object with all or a subset of properties to update.
Returns XREdgeCompareProperties
An object with the changed properties.
- properties: XREdgeCompareProperties
get XR Edge Compare Properties
ExperimentalReturns the currently set XR Edge Compare properties.
Returns XREdgeCompareProperties
The currently set properties.
request XR Auto Detect Scores
ExperimentalRequest 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 ContextAPI const myContext : ContextAPI = webvis.getContext( "example" ) // The node to request a result for const nodeID = 1; // Enable XR Edge Compare mode for node myContext.setProperty(nodeID, webvis.Property.COMPARISON_GROUP, webvis.ComparisonGroup.XR_EDGE); async function update() { // Request score const result = await myContext.getViewer().requestXRAutoDetectScores([nodeID]); // Check score value console.log(result[0].score > 0.5 ? "Positive" : "Negative"); // Re-request score twice per second as long as node is in XR Edge Compare mode if (result[0].details.edgeCompareEnabled) { setTimeout(update, 500); } } // Start loop update();Parameters
- nodeIDs: number[]
The nodeIDs to process.
Returns Promise<XRAutoDetectScore[]>
- A promise containing a list of auto detect score results.
- nodeIDs: number[]
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: