Skip to content

Commit 686a76e

Browse files
committed
feat(vision): 一些功能的更新
1 parent 7ed8707 commit 686a76e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+3961
-259
lines changed

miniprogram/app.json

+5
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,23 @@
7171
"pages/ar/visionkit-basic-v2/visionkit-basic-v2",
7272
"pages/ar/plane-ar/plane-ar",
7373
"pages/ar/plane-ar-v2/plane-ar-v2",
74+
"pages/ar/plane-ar-v2-marker/plane-ar-v2-marker",
75+
"pages/ar/plane-ar-v2-depth/plane-ar-v2-depth",
7476
"pages/ar/plane-ar-3dof/plane-ar-3dof",
7577
"pages/ar/2dmarker-ar/2dmarker-ar",
7678
"pages/ar/3dmarker-ar/3dmarker-ar",
7779
"pages/ar/osd-ar/osd-ar",
7880
"pages/ar/face-detect/face-detect",
7981
"pages/ar/body-detect/body-detect",
8082
"pages/ar/hand-detect/hand-detect",
83+
"pages/ar/depth-detect/depth-detect",
84+
"pages/ar/cameraBuffer-detect/cameraBuffer-detect",
8185
"pages/ar/ocr-detect/ocr-detect",
8286
"pages/ar/photo-ocr-detect/photo-ocr-detect",
8387
"pages/ar/photo-hand-detect/photo-hand-detect",
8488
"pages/ar/photo-body-detect/photo-body-detect",
8589
"pages/ar/photo-face-detect/photo-face-detect",
90+
"pages/ar/photo-depth-detect/photo-depth-detect",
8691
"pages/page/set-navigation-bar-title/set-navigation-bar-title",
8792
"pages/page/navigation-bar-loading/navigation-bar-loading",
8893
"pages/page/navigator/navigator",

miniprogram/packageAPI/pages/ar/2dmarker-ar/behavior.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ export default function getBehavior() {
3030
const pixelRatio = info.pixelRatio
3131
const calcSize = (width, height) => {
3232
console.log(`canvas size: width = ${width} , height = ${height}`)
33-
this.canvas.width = width * pixelRatio / 2
34-
this.canvas.height = height * pixelRatio / 2
33+
this.canvas.width = width * pixelRatio
34+
this.canvas.height = height * pixelRatio
3535
this.setData({
3636
width,
3737
height,
@@ -113,8 +113,8 @@ export default function getBehavior() {
113113

114114
const calcSize = (width, height, pixelRatio) => {
115115
console.log(`canvas size: width = ${width} , height = ${height}`)
116-
this.canvas.width = width * pixelRatio / 2
117-
this.canvas.height = height * pixelRatio / 2
116+
this.canvas.width = width * pixelRatio
117+
this.canvas.height = height * pixelRatio
118118
this.setData({
119119
width,
120120
height,
@@ -132,6 +132,7 @@ export default function getBehavior() {
132132
scene: gltf.scene,
133133
animations: gltf.animations,
134134
}
135+
console.log("模型加载完成")
135136
})
136137

137138
this.clock = new THREE.Clock()

miniprogram/packageAPI/pages/ar/3dmarker-ar/3dmarker-ar.js

+16-2
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,31 @@ Component({
7676
console.log("触发事件")
7777
console.log(e.detail)
7878
this.setData({
79-
imgUrl: e.detail.myChooseMapUrl
79+
imgUrl: e.detail.myChooseMapUrl,
80+
mapUrl: e.detail.myChooseMapUrl
8081
})
8182
},
83+
saveMap(){
84+
wx.openDocument({
85+
filePath: this.data.mapUrl,
86+
fileType: 'pdf',
87+
showMenu: true,
88+
success: function (res) {
89+
console.log('下载map至本地成功')
90+
}
91+
})
92+
},
8293
addMarker() {
8394
if (this.data.markerId) return
8495
const fs = wx.getFileSystemManager()
8596
// 此处如果为jpeg,则后缀名也需要改成对应后缀
8697
const filePath = `${wx.env.USER_DATA_PATH}/model.map`
98+
console.log("filePath is:", filePath)
8799
//const filePath = `${wx.env.USER_DATA_PATH}/marker-ar.jpeg`
88100
const download = callback => wx.downloadFile({
89101
// 此处设置为识别的3d对象的map地址
90-
url: 'http://dldir1.qq.com/weixin/checkresupdate/coco_bad_autov2_41add464411f40279704b6cffe660a1c.map',
102+
// url: 'http://dldir1.qq.com/weixin/checkresupdate/coco_bad_autov2_41add464411f40279704b6cffe660a1c.map',
103+
url: 'https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/output_bad.map',
91104
// url: 'http://dldir1.qq.com/weixin/checkresupdate/marker1_7d97094792854249a860640e985a743c.jpeg',
92105
success(res) {
93106
fs.saveFile({
@@ -114,6 +127,7 @@ Component({
114127
"filePathNow": filePath,
115128
"markerId": markerId
116129
})
130+
console.log("[markerId] -->", markerId)
117131
}
118132

119133
const getFilePathNow = () => {

miniprogram/packageAPI/pages/ar/3dmarker-ar/3dmarker-ar.wxml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<button type="primary" bindtap="addMarker" style="height:10vh">添加 marker</button>
77
<button type="primary" disabled="{{!markerId}}" bindtap="removeMarker" style="height:10vh">删除 marker</button>
88
<button type="primary" disabled="{{!markerId}}" bindtap="getAllMarker" style="height:10vh">获取所有 marker</button>
9+
<button type="primary" disabled="{{!mapUrl}}" bindtap="saveMap" style="height:10vh">保存map文件</button>
910
</view>
1011
<view class="photo-cnt">
1112
<view class="page-body-text tc">提示:点击加号添加模型视频, 选择已完成的模型, 选中将呈现蓝框, 手机摄像头对准该模型后添加marker, 页面下拉刷新模型状态, 向右滑动查看模型列表</view>

miniprogram/packageAPI/pages/ar/3dmarker-ar/behavior.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ export default function getBehavior() {
3030
const pixelRatio = info.pixelRatio
3131
const calcSize = (width, height) => {
3232
console.log(`canvas size: width = ${width} , height = ${height}`)
33-
this.canvas.width = width * pixelRatio / 2
34-
this.canvas.height = height * pixelRatio / 2
33+
this.canvas.width = width * pixelRatio
34+
this.canvas.height = height * pixelRatio
3535
this.setData({
3636
width,
3737
height,
@@ -113,8 +113,8 @@ export default function getBehavior() {
113113

114114
const calcSize = (width, height, pixelRatio) => {
115115
console.log(`canvas size: width = ${width} , height = ${height}`)
116-
this.canvas.width = width * pixelRatio / 2
117-
this.canvas.height = height * pixelRatio / 2
116+
this.canvas.width = width * pixelRatio
117+
this.canvas.height = height * pixelRatio
118118
this.setData({
119119
width,
120120
height,

0 commit comments

Comments
 (0)