98 lines
3.3 KiB
Markdown
98 lines
3.3 KiB
Markdown
枚举视频捕获设备:https://learn.microsoft.com/zh-cn/windows/win32/medfound/enumerating-video-capture-devices
|
||
|
||
媒体基础中的音频/视频捕获:https://learn.microsoft.com/zh-cn/windows/win32/medfound/audio-video-capture-in-media-foundation,里面有枚举打印示例代码。
|
||
|
||
如何设置视频捕获格式:https://learn.microsoft.com/zh-cn/windows/win32/medfound/how-to-set-the-video-capture-format
|
||
|
||
|
||
|
||
```
|
||
palmDetectionProcess
|
||
facePalmDetectionProcess # 处理每帧,在MPP的回调函数里面
|
||
uart_msg_proc() -> cmd_exec()执行串口协议命令
|
||
|
||
sock_cmd_exec() 内部线程逻辑之间通信
|
||
|
||
线程函数frame_proc_task()
|
||
algo_cb()->onFacePalmDetectionPassed()->app_server_alive()->sock_cmd_exec:SOCK_CMD__ALIVE_PALM
|
||
|
||
ST__PlamRegister()->__PalmRegister() -> PalmFeatureExtract() -> spv2_get_feature()
|
||
|
||
frame_proc_task()
|
||
frame_sync_task() // L015 V200 __DUAL_SNS_FAKE__ 双sensor活体
|
||
```
|
||
|
||
|
||
|
||
## 门锁开发环境搭建
|
||
|
||
smart_doorbell 文件夹、cv181xc_qfn。
|
||
CONSOLE_UART_IDX
|
||
业务串口:2
|
||
|
||
安装如下 python 环境:
|
||
|
||
```shell
|
||
sudo apt-get install lz4 unzip python3-pip
|
||
pip3 install yoctools # 安装在 ~/.local 目录下
|
||
|
||
# Ubuntu下product实际为product64
|
||
cd ~/.local/bin
|
||
ln -s product64 product
|
||
|
||
# 以下两条命令打印版本,验证是否安装成功,如无版本信息输出,最好重启一下机器。可能安装yoctools后,可能yoc、product还找不到
|
||
yoc -V
|
||
product version
|
||
|
||
# 将 python 软链接定向为 python3
|
||
cd /usr/bin
|
||
ln -s python3 python
|
||
```
|
||
|
||
原门锁构建环境应该是采用 CenterOS 搭建的,所以很多脚本使用的是 `sh`,在 Ubuntu 环境下,需要注意构建输出,一旦出现疑似脚本错误的问题,可以将脚本开头的 `#/bin/sh` 改为 `#/bin/bash` 再重试。例如脚本文件 `Xuantie-900-gcc-elf-newlib-x86_64-V2.6.1/bin/riscv64-unknown-elf-g++`。
|
||
|
||
修改编译器位置,我习惯于将编译器独立于项目工程之外:
|
||
|
||
```makefile title="solutions/smart_doorbell/Makefile"
|
||
HOST_TOOLS := /opt/Xuantie-900-gcc-elf-newlib-x86_64-V2.6.1/bin
|
||
```
|
||
|
||
上述步骤执行完毕之后,即可编译打包:
|
||
|
||
```shell
|
||
./boot-rebuild.sh # 编译boot
|
||
./rebuild-app.sh y L015 V200 R002 # 编译烧录固件
|
||
|
||
# 编译OTA固件,11为OTA版本号,这个版本号只做固件文件名显示。
|
||
# 实际的版本设置在 cv181x_alios/solutions/smart_doorbell/package.yaml.L015_V200R002
|
||
600X800
|
||
|
||
|
||
|
||
# cv181x_alios/rebuild-app.sh 、cv181x_alios/rebuild-app-ota.sh 这两个文件需要改成 #!/bin/bash, 否则编译不过
|
||
|
||
docker run -it --rm --user 1000:1000 -v /opt:/opt -v $(pwd)/..:$(pwd)/.. -w $(pwd) registry.cn-shenzhen.aliyuncs.com/amass_toolset/yoctools:22.04 ./rebuild-app.sh y L015 V200 R002
|
||
|
||
docker run -it --rm --user 1000:1000 -v /opt:/opt -v $(pwd)/..:$(pwd)/.. -w $(pwd) registry.cn-shenzhen.aliyuncs.com/amass_toolset/yoctools:22.04 ./rebuild-app-ota.sh y L015 V200 R002 09
|
||
```
|
||
|
||
|
||
|
||
|
||
|
||
# Flash设置
|
||
|
||
```
|
||
__FLASH_16MB__
|
||
cv181x_alios/boards/cv181xc_qfn/configs/config.yaml
|
||
cv181x_alios/boards/cv181xc_qfn/configs/partition_alios_spinor.xml
|
||
cv181x_alios/solutions/smart_doorbell/face_lock_app/flash-part.h
|
||
```
|
||
|
||
修改`cv181x_alios/pack-ota.sh`,以支持将boot打进ota升级文件中。(有升级变砖风险)
|
||
|
||
```
|
||
# $ota_pack_tool $OTA_PKG imtb yoc.bin algo.bin.1 boot $@
|
||
```
|
||
|