Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
cqiang1993
AR.js
提交
bdee519a
A
AR.js
项目概览
cqiang1993
/
AR.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
AR.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
bdee519a
编写于
2月 09, 2020
作者:
U
Umut Karakulak
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
npm build
上级
ca12d5a1
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
65 addition
and
3 deletion
+65
-3
aframe/build/aframe-ar.js
aframe/build/aframe-ar.js
+24
-0
aframe/build/aframe-ar.min.js
aframe/build/aframe-ar.min.js
+1
-1
three.js/build/ar.js
three.js/build/ar.js
+19
-0
three.js/build/ar.lean.js
three.js/build/ar.lean.js
+19
-0
three.js/build/ar.lean.min.js
three.js/build/ar.lean.min.js
+1
-1
three.js/build/ar.min.js
three.js/build/ar.min.js
+1
-1
未找到文件。
aframe/build/aframe-ar.js
浏览文件 @
bdee519a
...
@@ -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
...
...
aframe/build/aframe-ar.min.js
浏览文件 @
bdee519a
此差异已折叠。
点击以展开。
three.js/build/ar.js
浏览文件 @
bdee519a
...
@@ -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
...
...
three.js/build/ar.lean.js
浏览文件 @
bdee519a
...
@@ -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
...
...
three.js/build/ar.lean.min.js
浏览文件 @
bdee519a
此差异已折叠。
点击以展开。
three.js/build/ar.min.js
浏览文件 @
bdee519a
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录