提交 bdee519a 编写于 作者: U Umut Karakulak

npm build

上级 ca12d5a1
...@@ -2479,6 +2479,11 @@ ARjs.Context = THREEx.ArToolkitContext = function (parameters) { ...@@ -2479,6 +2479,11 @@ ARjs.Context = THREEx.ArToolkitContext = function (parameters) {
// the patternRatio inside the artoolkit marker - artoolkit only // the patternRatio inside the artoolkit marker - artoolkit only
patternRatio: 0.5, patternRatio: 0.5,
// Labeling mode for markers - ['black_region', 'white_region']
// black_region: Black bordered markers on a white background, white_region: White bordered markers on a black background
labelingMode: 'black_region',
// enable image smoothing or not for canvas copy - default to true // enable image smoothing or not for canvas copy - default to true
// https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/imageSmoothingEnabled // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/imageSmoothingEnabled
imageSmoothingEnabled: false, imageSmoothingEnabled: false,
...@@ -2486,6 +2491,7 @@ ARjs.Context = THREEx.ArToolkitContext = function (parameters) { ...@@ -2486,6 +2491,7 @@ ARjs.Context = THREEx.ArToolkitContext = function (parameters) {
// parameters sanity check // parameters sanity check
console.assert(['artoolkit', 'aruco'].indexOf(this.parameters.trackingBackend) !== -1, 'invalid parameter trackingBackend', this.parameters.trackingBackend) console.assert(['artoolkit', 'aruco'].indexOf(this.parameters.trackingBackend) !== -1, 'invalid parameter trackingBackend', this.parameters.trackingBackend)
console.assert(['color', 'color_and_matrix', 'mono', 'mono_and_matrix'].indexOf(this.parameters.detectionMode) !== -1, 'invalid parameter detectionMode', this.parameters.detectionMode) console.assert(['color', 'color_and_matrix', 'mono', 'mono_and_matrix'].indexOf(this.parameters.detectionMode) !== -1, 'invalid parameter detectionMode', this.parameters.detectionMode)
console.assert(["black_region", "white_region"].indexOf(this.parameters.labelingMode) !== -1, "invalid parameter labelingMode", this.parameters.labelingMode);
this.arController = null; this.arController = null;
this.arucoContext = null; this.arucoContext = null;
...@@ -2684,6 +2690,16 @@ ARjs.Context.prototype._initArtoolkit = function (onCompleted) { ...@@ -2684,6 +2690,16 @@ ARjs.Context.prototype._initArtoolkit = function (onCompleted) {
// set the patternRatio for artoolkit // set the patternRatio for artoolkit
arController.setPattRatio(_this.parameters.patternRatio); arController.setPattRatio(_this.parameters.patternRatio);
// set the labelingMode for artoolkit
var labelingModeTypes = {
"black_region": artoolkit.AR_LABELING_BLACK_REGION,
"white_region": artoolkit.AR_LABELING_WHITE_REGION
}
var labelingModeType = labelingModeTypes[_this.parameters.labelingMode];
console.assert(labelingModeType !== undefined);
arController.setLabelingMode(labelingModeType);
// set thresholding in artoolkit // set thresholding in artoolkit
// this seems to be the default // this seems to be the default
// arController.setThresholdMode(artoolkit.AR_LABELING_THRESH_MODE_MANUAL) // arController.setThresholdMode(artoolkit.AR_LABELING_THRESH_MODE_MANUAL)
...@@ -2819,6 +2835,7 @@ ARjs.Profile.prototype.reset = function () { ...@@ -2819,6 +2835,7 @@ ARjs.Profile.prototype.reset = function () {
this.contextParameters = { this.contextParameters = {
cameraParametersUrl: THREEx.ArToolkitContext.baseURL + '../data/data/camera_para.dat', cameraParametersUrl: THREEx.ArToolkitContext.baseURL + '../data/data/camera_para.dat',
detectionMode: 'mono', detectionMode: 'mono',
labelingMode: "black_region"
} }
this.defaultMarkerParameters = { this.defaultMarkerParameters = {
type: 'pattern', type: 'pattern',
...@@ -2878,10 +2895,12 @@ ARjs.Profile.prototype.defaultMarker = function (trackingBackend) { ...@@ -2878,10 +2895,12 @@ ARjs.Profile.prototype.defaultMarker = function (trackingBackend) {
this.contextParameters.detectionMode = 'mono' this.contextParameters.detectionMode = 'mono'
this.defaultMarkerParameters.type = 'pattern' this.defaultMarkerParameters.type = 'pattern'
this.defaultMarkerParameters.patternUrl = THREEx.ArToolkitContext.baseURL + '../data/data/patt.hiro' this.defaultMarkerParameters.patternUrl = THREEx.ArToolkitContext.baseURL + '../data/data/patt.hiro'
this.contextParameters.labelingMode = "black_region"
} else if (trackingBackend === 'aruco') { } else if (trackingBackend === 'aruco') {
this.contextParameters.detectionMode = 'mono' this.contextParameters.detectionMode = 'mono'
this.defaultMarkerParameters.type = 'barcode' this.defaultMarkerParameters.type = 'barcode'
this.defaultMarkerParameters.barcodeValue = 1001 this.defaultMarkerParameters.barcodeValue = 1001
this.contextParameters.labelingMode = "black_region"
} else console.assert(false) } else console.assert(false)
return this return this
...@@ -6049,6 +6068,10 @@ AFRAME.registerSystem('arjs', { ...@@ -6049,6 +6068,10 @@ AFRAME.registerSystem('arjs', {
type: 'number', type: 'number',
default: -1, default: -1,
}, },
labelingMode: {
type: 'string',
default: '',
},
cameraParametersUrl: { cameraParametersUrl: {
type: 'string', type: 'string',
default: '', default: '',
...@@ -6124,6 +6147,7 @@ AFRAME.registerSystem('arjs', { ...@@ -6124,6 +6147,7 @@ AFRAME.registerSystem('arjs', {
if (this.data.detectionMode !== '') arProfile.contextParameters.detectionMode = this.data.detectionMode if (this.data.detectionMode !== '') arProfile.contextParameters.detectionMode = this.data.detectionMode
if (this.data.matrixCodeType !== '') arProfile.contextParameters.matrixCodeType = this.data.matrixCodeType if (this.data.matrixCodeType !== '') arProfile.contextParameters.matrixCodeType = this.data.matrixCodeType
if (this.data.patternRatio !== -1) arProfile.contextParameters.patternRatio = this.data.patternRatio if (this.data.patternRatio !== -1) arProfile.contextParameters.patternRatio = this.data.patternRatio
if (this.data.labelingMode !== '') arProfile.contextParameters.labelingMode = this.data.labelingMode
if (this.data.cameraParametersUrl !== '') arProfile.contextParameters.cameraParametersUrl = this.data.cameraParametersUrl if (this.data.cameraParametersUrl !== '') arProfile.contextParameters.cameraParametersUrl = this.data.cameraParametersUrl
if (this.data.maxDetectionRate !== -1) arProfile.contextParameters.maxDetectionRate = this.data.maxDetectionRate if (this.data.maxDetectionRate !== -1) arProfile.contextParameters.maxDetectionRate = this.data.maxDetectionRate
if (this.data.canvasWidth !== -1) arProfile.contextParameters.canvasWidth = this.data.canvasWidth if (this.data.canvasWidth !== -1) arProfile.contextParameters.canvasWidth = this.data.canvasWidth
......
此差异已折叠。
...@@ -2479,6 +2479,11 @@ ARjs.Context = THREEx.ArToolkitContext = function (parameters) { ...@@ -2479,6 +2479,11 @@ ARjs.Context = THREEx.ArToolkitContext = function (parameters) {
// the patternRatio inside the artoolkit marker - artoolkit only // the patternRatio inside the artoolkit marker - artoolkit only
patternRatio: 0.5, patternRatio: 0.5,
// Labeling mode for markers - ['black_region', 'white_region']
// black_region: Black bordered markers on a white background, white_region: White bordered markers on a black background
labelingMode: 'black_region',
// enable image smoothing or not for canvas copy - default to true // enable image smoothing or not for canvas copy - default to true
// https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/imageSmoothingEnabled // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/imageSmoothingEnabled
imageSmoothingEnabled: false, imageSmoothingEnabled: false,
...@@ -2486,6 +2491,7 @@ ARjs.Context = THREEx.ArToolkitContext = function (parameters) { ...@@ -2486,6 +2491,7 @@ ARjs.Context = THREEx.ArToolkitContext = function (parameters) {
// parameters sanity check // parameters sanity check
console.assert(['artoolkit', 'aruco'].indexOf(this.parameters.trackingBackend) !== -1, 'invalid parameter trackingBackend', this.parameters.trackingBackend) console.assert(['artoolkit', 'aruco'].indexOf(this.parameters.trackingBackend) !== -1, 'invalid parameter trackingBackend', this.parameters.trackingBackend)
console.assert(['color', 'color_and_matrix', 'mono', 'mono_and_matrix'].indexOf(this.parameters.detectionMode) !== -1, 'invalid parameter detectionMode', this.parameters.detectionMode) console.assert(['color', 'color_and_matrix', 'mono', 'mono_and_matrix'].indexOf(this.parameters.detectionMode) !== -1, 'invalid parameter detectionMode', this.parameters.detectionMode)
console.assert(["black_region", "white_region"].indexOf(this.parameters.labelingMode) !== -1, "invalid parameter labelingMode", this.parameters.labelingMode);
this.arController = null; this.arController = null;
this.arucoContext = null; this.arucoContext = null;
...@@ -2684,6 +2690,16 @@ ARjs.Context.prototype._initArtoolkit = function (onCompleted) { ...@@ -2684,6 +2690,16 @@ ARjs.Context.prototype._initArtoolkit = function (onCompleted) {
// set the patternRatio for artoolkit // set the patternRatio for artoolkit
arController.setPattRatio(_this.parameters.patternRatio); arController.setPattRatio(_this.parameters.patternRatio);
// set the labelingMode for artoolkit
var labelingModeTypes = {
"black_region": artoolkit.AR_LABELING_BLACK_REGION,
"white_region": artoolkit.AR_LABELING_WHITE_REGION
}
var labelingModeType = labelingModeTypes[_this.parameters.labelingMode];
console.assert(labelingModeType !== undefined);
arController.setLabelingMode(labelingModeType);
// set thresholding in artoolkit // set thresholding in artoolkit
// this seems to be the default // this seems to be the default
// arController.setThresholdMode(artoolkit.AR_LABELING_THRESH_MODE_MANUAL) // arController.setThresholdMode(artoolkit.AR_LABELING_THRESH_MODE_MANUAL)
...@@ -2819,6 +2835,7 @@ ARjs.Profile.prototype.reset = function () { ...@@ -2819,6 +2835,7 @@ ARjs.Profile.prototype.reset = function () {
this.contextParameters = { this.contextParameters = {
cameraParametersUrl: THREEx.ArToolkitContext.baseURL + '../data/data/camera_para.dat', cameraParametersUrl: THREEx.ArToolkitContext.baseURL + '../data/data/camera_para.dat',
detectionMode: 'mono', detectionMode: 'mono',
labelingMode: "black_region"
} }
this.defaultMarkerParameters = { this.defaultMarkerParameters = {
type: 'pattern', type: 'pattern',
...@@ -2878,10 +2895,12 @@ ARjs.Profile.prototype.defaultMarker = function (trackingBackend) { ...@@ -2878,10 +2895,12 @@ ARjs.Profile.prototype.defaultMarker = function (trackingBackend) {
this.contextParameters.detectionMode = 'mono' this.contextParameters.detectionMode = 'mono'
this.defaultMarkerParameters.type = 'pattern' this.defaultMarkerParameters.type = 'pattern'
this.defaultMarkerParameters.patternUrl = THREEx.ArToolkitContext.baseURL + '../data/data/patt.hiro' this.defaultMarkerParameters.patternUrl = THREEx.ArToolkitContext.baseURL + '../data/data/patt.hiro'
this.contextParameters.labelingMode = "black_region"
} else if (trackingBackend === 'aruco') { } else if (trackingBackend === 'aruco') {
this.contextParameters.detectionMode = 'mono' this.contextParameters.detectionMode = 'mono'
this.defaultMarkerParameters.type = 'barcode' this.defaultMarkerParameters.type = 'barcode'
this.defaultMarkerParameters.barcodeValue = 1001 this.defaultMarkerParameters.barcodeValue = 1001
this.contextParameters.labelingMode = "black_region"
} else console.assert(false) } else console.assert(false)
return this return this
......
...@@ -2479,6 +2479,11 @@ ARjs.Context = THREEx.ArToolkitContext = function (parameters) { ...@@ -2479,6 +2479,11 @@ ARjs.Context = THREEx.ArToolkitContext = function (parameters) {
// the patternRatio inside the artoolkit marker - artoolkit only // the patternRatio inside the artoolkit marker - artoolkit only
patternRatio: 0.5, patternRatio: 0.5,
// Labeling mode for markers - ['black_region', 'white_region']
// black_region: Black bordered markers on a white background, white_region: White bordered markers on a black background
labelingMode: 'black_region',
// enable image smoothing or not for canvas copy - default to true // enable image smoothing or not for canvas copy - default to true
// https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/imageSmoothingEnabled // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/imageSmoothingEnabled
imageSmoothingEnabled: false, imageSmoothingEnabled: false,
...@@ -2486,6 +2491,7 @@ ARjs.Context = THREEx.ArToolkitContext = function (parameters) { ...@@ -2486,6 +2491,7 @@ ARjs.Context = THREEx.ArToolkitContext = function (parameters) {
// parameters sanity check // parameters sanity check
console.assert(['artoolkit', 'aruco'].indexOf(this.parameters.trackingBackend) !== -1, 'invalid parameter trackingBackend', this.parameters.trackingBackend) console.assert(['artoolkit', 'aruco'].indexOf(this.parameters.trackingBackend) !== -1, 'invalid parameter trackingBackend', this.parameters.trackingBackend)
console.assert(['color', 'color_and_matrix', 'mono', 'mono_and_matrix'].indexOf(this.parameters.detectionMode) !== -1, 'invalid parameter detectionMode', this.parameters.detectionMode) console.assert(['color', 'color_and_matrix', 'mono', 'mono_and_matrix'].indexOf(this.parameters.detectionMode) !== -1, 'invalid parameter detectionMode', this.parameters.detectionMode)
console.assert(["black_region", "white_region"].indexOf(this.parameters.labelingMode) !== -1, "invalid parameter labelingMode", this.parameters.labelingMode);
this.arController = null; this.arController = null;
this.arucoContext = null; this.arucoContext = null;
...@@ -2684,6 +2690,16 @@ ARjs.Context.prototype._initArtoolkit = function (onCompleted) { ...@@ -2684,6 +2690,16 @@ ARjs.Context.prototype._initArtoolkit = function (onCompleted) {
// set the patternRatio for artoolkit // set the patternRatio for artoolkit
arController.setPattRatio(_this.parameters.patternRatio); arController.setPattRatio(_this.parameters.patternRatio);
// set the labelingMode for artoolkit
var labelingModeTypes = {
"black_region": artoolkit.AR_LABELING_BLACK_REGION,
"white_region": artoolkit.AR_LABELING_WHITE_REGION
}
var labelingModeType = labelingModeTypes[_this.parameters.labelingMode];
console.assert(labelingModeType !== undefined);
arController.setLabelingMode(labelingModeType);
// set thresholding in artoolkit // set thresholding in artoolkit
// this seems to be the default // this seems to be the default
// arController.setThresholdMode(artoolkit.AR_LABELING_THRESH_MODE_MANUAL) // arController.setThresholdMode(artoolkit.AR_LABELING_THRESH_MODE_MANUAL)
...@@ -2819,6 +2835,7 @@ ARjs.Profile.prototype.reset = function () { ...@@ -2819,6 +2835,7 @@ ARjs.Profile.prototype.reset = function () {
this.contextParameters = { this.contextParameters = {
cameraParametersUrl: THREEx.ArToolkitContext.baseURL + '../data/data/camera_para.dat', cameraParametersUrl: THREEx.ArToolkitContext.baseURL + '../data/data/camera_para.dat',
detectionMode: 'mono', detectionMode: 'mono',
labelingMode: "black_region"
} }
this.defaultMarkerParameters = { this.defaultMarkerParameters = {
type: 'pattern', type: 'pattern',
...@@ -2878,10 +2895,12 @@ ARjs.Profile.prototype.defaultMarker = function (trackingBackend) { ...@@ -2878,10 +2895,12 @@ ARjs.Profile.prototype.defaultMarker = function (trackingBackend) {
this.contextParameters.detectionMode = 'mono' this.contextParameters.detectionMode = 'mono'
this.defaultMarkerParameters.type = 'pattern' this.defaultMarkerParameters.type = 'pattern'
this.defaultMarkerParameters.patternUrl = THREEx.ArToolkitContext.baseURL + '../data/data/patt.hiro' this.defaultMarkerParameters.patternUrl = THREEx.ArToolkitContext.baseURL + '../data/data/patt.hiro'
this.contextParameters.labelingMode = "black_region"
} else if (trackingBackend === 'aruco') { } else if (trackingBackend === 'aruco') {
this.contextParameters.detectionMode = 'mono' this.contextParameters.detectionMode = 'mono'
this.defaultMarkerParameters.type = 'barcode' this.defaultMarkerParameters.type = 'barcode'
this.defaultMarkerParameters.barcodeValue = 1001 this.defaultMarkerParameters.barcodeValue = 1001
this.contextParameters.labelingMode = "black_region"
} else console.assert(false) } else console.assert(false)
return this return this
......
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册