第一步 键盘检测
方案一 canny边缘检测
canny边缘检测检测结果不稳定,容易因为复杂背景或光线变换检测出其他目标。
如图是用canny边缘检测方法标出的检测出的边缘的四个红点。
参考的是这篇文章OpenCV实战之三 | 基于OpenCV实现图像校正_opencv 图像校正-CSDN博客
方案二 Mask-RCNN
论文1703.06870
参考Mask Rcnn目标分割-训练自己数据集-详细步骤_maskrcnn训练自己的数据集-CSDN博客
1. 下载代码和配置环境
远程+源代码方案
发布 ·Matterport/Mask_RCNN
点击上传zip文件。
Linux 系统中不同层级的目录结构
根目录 /
下的文件目录。根目录 /
是 Linux 文件系统的最顶层目录,所有其他目录都是它的子目录。
root@autodl-container-9403468337-223581eb:~# cd /
root@autodl-container-9403468337-223581eb:/# ls
bin boot dev etc home init lib lib32 lib64 libx32 media mnt NGC-DL-CONTAINER-LICENSE opt proc root run sbin srv sys tmp usr var
用户主目录 ~
下的文件目录。用户主目录是每个用户专属的工作目录,用户可以在其中自由创建、修改和删除文件及文件夹。在这个目录中看到的内容通常与用户的特定操作和环境有关:
root@autodl-container-9403468337-223581eb:/# cd ~
root@autodl-container-9403468337-223581eb:~# ls
autodl-pub autodl-tmp Mask_RCNN-master.zip miniconda3 tf-logs
解压代码包
root@autodl-container-9403468337-223581eb:~# unzip Mask_RCNN-master.zip
之后根据确保requirements.txt安装必要的库。
本地+网传代码方案
(keyboard) C:\Users\吴伊晴>git clone https://github.com/matterport/Mask_RCNN.git
Cloning into 'Mask_RCNN'...
remote: Enumerating objects: 956, done.
remote: Total 956 (delta 0), reused 0 (delta 0), pack-reused 956 (from 1)
Receiving objects: 100% (956/956), 137.67 MiB | 16.28 MiB/s, done.
Resolving deltas: 100% (558/558), done.
(keyboard) C:\Users\吴伊晴>cd Mask_RCNN
(keyboard) C:\Users\吴伊晴\Mask_RCNN>python setup.py install
setup.py:9: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import pkg_resources
WARNING:root:Fail load requirements file, so using default ones.
D:\Env\ANACONDA\envs\keyboard\lib\site-packages\setuptools\dist.py:452: SetuptoolsDeprecationWarning: Invalid dash-separated options
!!
********************************************************************************
Usage of dash-separated 'description-file' will not be supported in future
versions. Please use the underscore name 'description_file' instead.
This deprecation is overdue, please update your project and remove deprecated
calls to avoid build errors in the future.
See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
********************************************************************************
!!
opt = self.warn_dash_deprecation(opt, section)
D:\Env\ANACONDA\envs\keyboard\lib\site-packages\setuptools\dist.py:452: SetuptoolsDeprecationWarning: Invalid dash-separated options
!!
********************************************************************************
Usage of dash-separated 'license-file' will not be supported in future
versions. Please use the underscore name 'license_file' inste