jupyter update

This commit is contained in:
13339479676 2022-01-06 09:16:40 +08:00
parent f704992799
commit eb9ed6f8ca
1 changed files with 133 additions and 15 deletions

View File

@ -50,9 +50,9 @@
"# 首先手动创建虚拟环境\n",
"# conda create -n ow python==3.8 # 虚拟环境名称为ow\n",
"# conda activate ow # 激活虚拟环境\n",
"!git clone https://gitee.com/CV_Lab/opencv_webcam.git # clone\n",
"!git clone https://gitee.com/CV_Lab/opencv_webcam.git # 克隆\n",
"%cd opencv_webcam\n",
"%pip install -qr requirements.txt -U # install"
"%pip install -qr requirements.txt -U # 安装"
]
},
{
@ -67,7 +67,9 @@
"cell_type": "code",
"execution_count": null,
"id": "58307de4-173b-46a9-b30d-c12cfe4a1de2",
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"# 常规调用\n",
@ -78,7 +80,9 @@
"cell_type": "code",
"execution_count": null,
"id": "f04eab9b-f7fc-42a0-a3df-6d546bcde5d9",
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"# 视频帧自动保存\n",
@ -89,23 +93,27 @@
"cell_type": "code",
"execution_count": null,
"id": "acaf3636-8f83-47af-8161-2614a24cf3cc",
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": []
"source": [
"# 每隔10帧保存一次帧\n",
"!python opencv_webcam.py -isasf -fns 10"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6b564768-4ea4-4081-a9e8-6799dd862ef8",
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"id": "2e706723-b274-41c7-b439-ccf9198e59b7",
"metadata": {},
"source": []
"source": [
"# 默认按a键捕获一帧\n",
"!python opencv_webcam.py -ishsf"
]
},
{
"cell_type": "code",
@ -113,7 +121,117 @@
"id": "bbf16f8a-50fb-41f6-8c6d-31152ce29217",
"metadata": {},
"outputs": [],
"source": []
"source": [
"# 设置z键为捕获键\n",
"!python opencv_webcam.py -ishsf -fck z"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b5be8596-d7c4-4f30-bdec-b2ac1ab31479",
"metadata": {},
"outputs": [],
"source": [
"# 重塑宽度300 高度200\n",
"# 自动版\n",
"!python opencv_webcam.py -isasf -isrf -rf 300 200\n",
"# 手动版\n",
"!python opencv_webcam.py -ishsf -isrf -rf 300 200"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "17d4f042-bcf5-4040-9737-ce5b927c13b2",
"metadata": {},
"outputs": [],
"source": [
"# 宽高缩放比为0.5\n",
"# 自动版\n",
"!python opencv_webcam.py -isasf -isrf -rrf 0.5\n",
"# 手动版\n",
"!python opencv_webcam.py -ishsf -isrf -rrf 0.5"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "46f48201-9608-4122-a0d0-ac226e46eaac",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"# 设置保存路径,默认保存路径为./WebcamFrame\n",
"!python opencv_webcam.py -fsd custom_dir -isasf # 以自动版为例"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5b34e67f-0e25-43ff-aec1-ef3ed74f7fd8",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"# 设置帧图片的前缀名称\n",
"!python opencv_webcam.py -isasf -fnp webcam"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "387d62f8-5e9b-4141-8e90-3d2c13381d57",
"metadata": {},
"outputs": [],
"source": [
"# 设置JPG质量为100默认为95\n",
"!python opencv_webcam.py -isasf -fss jpg -jq 100\n",
"# 设置PNG质量为5默认为3\n",
"!python opencv_webcam.py -isasf -fss png -jq 5"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "7cc860c3-e8a0-4e65-95c1-123f84c21c09",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"# 默认为p键\n",
"!python opencv_webcam.py -p w\n",
"# 按任意键继续"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "13f16a9e-cc3c-4b41-b23b-6383b36c5c16",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"# 设置保存100帧\n",
"!python opencv_webcam.py -isasf -afn 100"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "fcb03330-b662-4d49-b302-32c70ec40104",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"# 查询脚本参数\n",
"!python opencv_webcam.py --help"
]
}
],
"metadata": {