1 Star 0 Fork 0

wgu938 / no_fly_zone_detection

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
README.md 2.98 KB
一键复制 编辑 原始数据 按行查看 历史
wgu938 提交于 2024-04-23 16:22 . update readme

No-Fly Zone Detection

(Left: Binary mask; Mid: Original video; Right: Bitwise add result)

Preparation

To begin with, you need to install OpenCV and NumPy libraries to leverage powerful built-in functions such as cv2.VideoCapture (for video loading) and cv2.inRange() (for mask creation).

Using conda as a package management tool is strongly recommended for installing OpenCV. Conda simplifies package management, dependency handling, and environment management, ensuring streamlined workflows and reproducibility.

Step 1: Install Miniconda3

Please download the appropriate installer for your platform (Windows/Linux/macOS) from the official Miniconda documentation page and proceed with the installation based on the detailed instructions therein.

Step 2: Create a new Conda environment

Open a terminal and run:

conda create --name cv_env python=3.11

This will create a new Conda environment, namely cv_env, with python=3.11 installed.

Step 3: Activate the Conda environment

To view all the Conda environments on your PC, run:

(base) wgu@localhost ~ % conda env list
# conda environments:
#
base                  *  /Users/wgu/miniconda3
cv_env                   /Users/wgu/miniconda3/envs/cv_env

Here, cv_env is the new Conda environment that you created a few seconds ago. You can activate this Conda environment by running:

(base) wgu@localhost ~ % conda activate cv_env
(cv_env) wgu@localhost ~ % 

The (cv_env) prefix indicates the current environment you are using.

Note: You can create multiple Conda environments, each equipped with different versions of Python or other packages, to facilitate conflict-free development for distinct projects.

Step 4: Install OpenCV

conda install -c conda-forge opencv

You can verify the installation by running the following commands in the terminal, which check the OpenCV version:

(cv_env) wgu@localhost ~ % python
Python 3.11.8 | packaged by conda-forge | (main, Feb 16 2024, 20:49:36) [Clang 16.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> print(cv2.__version__)
4.9.0

Step 5: Install NumPy

conda install numpy

File hierarchy

Under this repo, there are three files:

  • README.md: an instruction file
  • no_fly_zone_detection.py: a Python script for no-fly zone detection
  • no_fly_zone.mp4: a video for emulating the top-down view from a drone flying over an urban area in our final challenge contest

Task and the deliverable

  • Implement the def red_hsv(hsv_img): function in no_fly_zone_detection.py to create a mask for thresholding the red color in HSV color space
  • Run the script with your implementation and evaluate its performance
  • Upload a report in PDF, including your code implementation and results (i.e., original image vs. detected image)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/weibin93/no_fly_zone_detection.git
git@gitee.com:weibin93/no_fly_zone_detection.git
weibin93
no_fly_zone_detection
no_fly_zone_detection
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891