diff --git a/README.en.md b/README.en.md index a163ee2..e212d08 100644 --- a/README.en.md +++ b/README.en.md @@ -130,28 +130,28 @@ webcam_opencv(is_autoSaveFrame=True, is_compress=True) # compressed frame #### 🔑 Easy Tutorial -- 第一步:下载镜像 +- Step 1: Download the mirror ```shell -sudo docker pull zengdockerdocker/opencv-webcam-script:v0.4 # 镜像拉取 +sudo docker pull zengdockerdocker/opencv-webcam-script:v0.4 # Mirror pull ``` -- 第二步:创建容器 +- Step 2: Create the container ```shell -xhost +local:root # 允许root用户访问正在运行的X服务器(重要) -sudo docker run --name=ows --ipc=host -it -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY --device=/dev/video0:/dev/video0 zengdockerdocker/opencv-webcam-script:v0.4 # 创建名称为ows的容器 +xhost +local:root # Allow root user access to running X server (important) +sudo docker run --name=ows --ipc=host -it -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY --device=/dev/video0:/dev/video0 zengdockerdocker/opencv-webcam-script:v0.4 # Create a container named ows ``` -- 第三步:运行程序 +- Step 3: Run the program ```shell -python3 opencv_webcam.py # 运行脚本程序 -python3 opencv_webcam.py -isasf # 自动保存帧 +python3 opencv_webcam.py # run script +python3 opencv_webcam.py -isasf # Auto save frames -# 获取docker帧数据到本机 -sudo docker cp 容器名称:容器目录 本机宿主目录 -sudo docker cp ows:/usr/src/app/WebcamFrame /home/用户名 # 举例 +# Get docker frame data to this machine +sudo docker cp Container name: container directory local host directory +sudo docker cp ows:/usr/src/app/WebcamFrame /home/username # Example ``` ### ✅ Method 4: Jupyter installation (Jupyter version) @@ -160,22 +160,22 @@ sudo docker cp ows:/usr/src/app/WebcamFrame /home/用户名 # 举例 #### 🔑 Easy Tutorial -- 第一步:安装 +- Step 1: Installation ```shell -# 首先手动创建虚拟环境 -# conda create -n ows python==3.8 # 虚拟环境名称为ows -# conda activate ows # 激活虚拟环境 -!git clone https://gitee.com/CV_Lab/opencv_webcam.git # 克隆 +# First create a virtual environment manually +# conda create -n ows python==3.8 # The virtual environment name is ows +# conda activate ows # Activate the virtual environment +!git clone https://gitee.com/CV_Lab/opencv_webcam.git # clone %cd opencv_webcam -%pip install -qr requirements.txt -U # 安装 +%pip install -qr requirements.txt -U # install ``` -- 第二步:运行 +- Step 2: Run ```shell -!python opencv_webcam.py # 默认按q键退出 -!python opencv_webcam.py -isasf # 视频帧自动保存 +!python opencv_webcam.py # Press the q key to exit by default +!python opencv_webcam.py -isasf # Automatically save video frames ``` **Note: Jupyter version of ows program can run unit instructions through `Ctrl+Enter`** @@ -184,16 +184,16 @@ sudo docker cp ows:/usr/src/app/WebcamFrame /home/用户名 # 举例

⚡Usage

-#### 💡 常规调用 +#### 💡 regular call ```shell -# 默认按q键退出 +# Press the q key to exit by default python opencv_webcam.py ``` -#### 💡 设备选择 +#### 💡 Device Selection ```shell # 多摄像头切换示例,默认为0 @@ -206,7 +206,7 @@ python opencv_webcam.py -dev rtsp://username:password@xxx.xxx.xxx -#### 💡 设置退出键 +#### 💡 set escape key ```shell # 默认按q键退出 @@ -216,7 +216,7 @@ python opencv_webcam.py -q k # 设置k键退出 -#### 💡 自动保存帧 +#### 💡 Auto save frames ```shell python opencv_webcam.py -isasf @@ -224,7 +224,7 @@ python opencv_webcam.py -isasf -#### 💡 每隔n帧保存一次帧 +#### 💡 Save frames every n frames ```shell # 每隔10帧保存一次帧 @@ -233,7 +233,7 @@ python opencv_webcam.py -isasf -fns 10 -#### 💡 手动保存帧 +#### 💡 Save frames manually ```shell # 默认按a键捕获一帧 @@ -242,7 +242,7 @@ python opencv_webcam.py -ishsf -#### 💡 自定义捕获键 +#### 💡 custom capture key ```shell # 设置z键为捕获键,默认为a键 @@ -251,7 +251,7 @@ python opencv_webcam.py -ishsf -fck z -#### 💡 重塑帧尺寸(自定义宽高) +#### 💡 Reshape frame size (custom width and height) ```shell # 重塑宽度300 高度200 @@ -261,7 +261,7 @@ python opencv_webcam.py -ishsf -isrf -rf 300 200 # 手动版 -#### 💡 重塑帧尺寸(自定义宽高缩放比) +#### 💡 Reshape frame size (custom aspect scaling) ```shell # 宽高缩放比为0.5 @@ -271,7 +271,7 @@ python opencv_webcam.py -ishsf -isrf -rrf 0.5 # 手动版 -#### 💡 自定义保存路径 +#### 💡 Custom save path ```shell # 设置保存路径,默认保存路径为./WebcamFrame @@ -280,7 +280,7 @@ python opencv_webcam.py -fsd custom_dir -isasf # 以自动版为例 -#### 💡 自定义帧目录名称 +#### 💡 custom frame directory name ```shell # 设置帧目录名称,默认保存路径为frames @@ -290,7 +290,7 @@ python opencv_webcam.py -fdn frames_custom -isasf # 以自动版为例 -#### 💡 自定义帧名前缀 +#### 💡 Custom frame name prefix ```shell # 设置帧图片的前缀名称 @@ -299,7 +299,7 @@ python opencv_webcam.py -isasf -fnp webcam -#### 💡 设置帧保存格式 +#### 💡 Set the frame save format ```shell # 设置JPG质量为100,默认为95 @@ -310,7 +310,7 @@ python opencv_webcam.py -isasf -fss png -jq 5 -#### 💡 设置暂停键 +#### 💡 set pause button ```shell # 设置w键为暂停键,默认为p键 @@ -319,7 +319,7 @@ python opencv_webcam.py -p w # 按任意键继续 -#### 💡 设置保存帧数 +#### 💡 Set the number of frames to save ```shell # 设置保存100帧 @@ -328,7 +328,7 @@ python opencv_webcam.py -isasf -afn 100 -#### 💡 日志设置 +#### 💡 log settings ```shell # 日志文件默认保存在项目根目录,ows.log @@ -341,7 +341,7 @@ python opencv_webcam.py -lm w # 设置为覆盖模式 -#### 💡 视频帧压缩 +#### 💡 video frame compression ```shell # 常规压缩,默认ows.zip(以自动版为例) @@ -357,7 +357,7 @@ python opencv_webcam.py -isasf -isc -cs tar -cm w:gz # tar压缩 -#### 💡 指令查询 +#### 💡 Instruction query ```shell # 查询脚本参数