当前位置:   article > 正文

Opencv基础使用2——拐角检测 | 轮廓检测_opencv 找到轮廓拐点

opencv 找到轮廓拐点

本博文接上一篇博文,继续进行部分 opencv Python 示例代码运行 效果测试


环境搭建、所使用代码版本 —— 参考上一篇博文——Opencv基础使用1——分割 - 视频人像跟踪


opencv-master 4.5.1 Python 示例代码运行测试——拐角检测 | 轮廓检测

  • 本博文的测试是直接拉取 opencv-master4.5.1,然后在opencv/samples/python/tutorial_code/ 目录下对不同模块 py 文件进行测试

0-9


TrackingMotion – corner detector tutorial 【拐角检测 – 顶点标识】


运行代码一:

cd opencv/samples/python/tutorial_code/TrackingMotion/corner_subpixels

python cornerSubPix_Demo.py --input ../../../../data/pic3.png 

或者 

cd opencv/samples/python/tutorial_code/TrackingMotion/generic_corner_detector

python cornerDetector_Demo.py --input ../../../../data/building.jpg

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

效果如下:

1-0

运行代码二:

cd opencv/samples/python/tutorial_code/TrackingMotion/good_features_to_track

python goodFeaturesToTrack_Demo.py --input ../../../../data/pic3.png
  • 1
  • 2
  • 3

效果如下:

1-1

运行代码三:

cd opencv/samples/python/tutorial_code/TrackingMotion/harris_detector

python cornerHarris_Demo.py --input ../../../../data/building.jpg
  • 1
  • 2
  • 3

效果如下:

1-3


轮廓检测【形状描述】


Draw polygonal contour + bonding rects + circles | 绘制多边形轮廓+边界矩形+圆

运行代码一:

cd opencv/samples/python/tutorial_code/ShapeDescriptors/bounding_rects_circles

python generalContours_demo1.py --input ../../../../data/stuff.jpg 

  • 1
  • 2
  • 3
  • 4

运行效果:

2-1

运行代码二【Code for Creating Bounding rotated boxes and ellipses for contours 轮廓 tutorial】:

cd opencv/samples/python/tutorial_code/ShapeDescriptors/bounding_rotated_ellipses

python generalContours_demo2.py --input ../../../../data/stuff.jpg
  • 1
  • 2
  • 3

运行效果

2-2

运行代码三

cd opencv/samples/python/tutorial_code/ShapeDescriptors/find_contours

python findContours_demo.py --input ../../../../data/HappyFish.jpg 
  • 1
  • 2
  • 3

运行效果:

2-3

运行代码四:

cd opencv/samples/python/tutorial_code/ShapeDescriptors/hull

python hull_demo.py --input ../../../../data/stuff.jpg

或者

cd ../moments/

python moments_demo.py  --input ../../../../data/stuff.jpg

或者

cd ../point_polygon_test/

python pointPolygonTest_demo.py 

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16

运行效果:

2-5

2-6


声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/140503
推荐阅读
相关标签
  

闽ICP备14008679号