{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## 使用光流检测手掌运动\n", "\n", "本实验是 [AI for Beginners Curriculum](http://aka.ms/ai-beginners) 的一部分。\n", "\n", "请参考[这个视频](../../../../../../lessons/4-ComputerVision/06-IntroCV/lab/palm-movement.mp4),视频中一个人的手掌在稳定的背景上向左/右/上/下移动。\n", "\n", "**你的目标**是使用光流来确定视频中哪些部分包含向上/向下/向左/向右的运动。\n", "\n", "首先按照课程中描述的方法获取视频帧:\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Code here" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "现在,根据讲座中描述的计算稠密光流帧,并将稠密光流转换为极坐标:\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Code here" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "为每一帧光流构建方向直方图。直方图显示有多少向量落入特定的区间,并且应该将帧中不同方向的运动区分开来。\n", "\n", "> 你可能还需要将所有幅值低于某个阈值的向量置零。这将消除视频中一些微小的多余运动,例如眼睛和头部的细微动作。\n", "\n", "绘制一些帧的直方图。\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Code here" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "观察直方图,确定运动方向应该相当简单。您需要选择那些对应于上/下/左/右方向的区间,并且超过某个阈值的区间。\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Code here" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "恭喜!如果您已完成以上所有步骤,您已完成实验!\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n---\n\n**免责声明**: \n本文档使用AI翻译服务[Co-op Translator](https://github.com/Azure/co-op-translator)进行翻译。尽管我们努力确保翻译的准确性,但请注意,自动翻译可能包含错误或不准确之处。原始语言的文档应被视为权威来源。对于关键信息,建议使用专业人工翻译。我们不对因使用此翻译而产生的任何误解或误读承担责任。\n" ] } ], "metadata": { "language_info": { "name": "python" }, "orig_nbformat": 4, "coopTranslator": { "original_hash": "153d9e417e079bf62f8f693002d0deaf", "translation_date": "2025-08-31T09:49:39+00:00", "source_file": "lessons/4-ComputerVision/06-IntroCV/lab/MovementDetection.ipynb", "language_code": "zh" } }, "nbformat": 4, "nbformat_minor": 2 }