当前位置:网站首页>Some thoughts on whether the judgment point is located in the contour
Some thoughts on whether the judgment point is located in the contour
2022-07-04 19:33:00 【Haohong image algorithm】
stay CSDN We found a method to judge whether the point is inside the polygon , Links are as follows :
https://blog.csdn.net/u011722133/article/details/52813374
https://blog.csdn.net/hjk61314/article/details/82587196
Then can we use the above method to judge whether the point is within the contour ?
The answer is : have to (děi) Sub situation .
When the width of our outline is 1 when , Sure , But when the outline width is not 1 Time is not allowed .
For example, the following outline is ok :
But the following outline is not allowed :
Why not? , Why you can , According to the methods provided in the above two blog posts, it is easy to think .
In fact, when the width is 1 when , You can use functions drawContours() Draw the outline point set in a solid way ( Parameters thickness The value of the set FILLED). Then judge whether a point is inside the contour .
When the outline is drawn in a solid way , For example, the following is drawn as a solid outline :
I just need to judge whether the pixel gray value at a certain point is greater than a certain threshold , For example, judge whether the gray value of the pixel is greater than 200. Greater than 200 It is thought to be on or inside the contour , Less than 200 It is thought to be outside the contour .
边栏推荐
- A method of using tree LSTM reinforcement learning for connection sequence selection
- How to use async Awati asynchronous task processing instead of backgroundworker?
- 欧拉函数
- Shell 编程核心技术《一》
- 2019年蜀山区第十五届青少年信息学竞赛
- Opencv functions and methods related to binary threshold processing are summarized for comparison and use
- HDU 6440 2018中国大学生程序设计网络选拔赛
- 2021 合肥市信息学竞赛小学组
- 在线SQL转Excel(xls/xlsx)工具
- 测试工程师如何“攻城”(下)
猜你喜欢
mysql中explain语句查询sql是否走索引,extra中的几种类型整理汇总
Oracle with as ora-00903: invalid table name multi report error
FPGA timing constraint sharing 01_ Brief description of the four steps
关于判断点是否位于轮廓内的一点思考
Pointnet/Pointnet++点云数据集处理并训练
Master the use of auto analyze in data warehouse
整理混乱的头文件,我用include what you use
2022CoCa: Contrastive Captioners are Image-Text Fountion Models
Detailed explanation of the binary processing function threshold() of opencv
Pytorch学习(四)
随机推荐
HDU 6440 2018中国大学生程序设计网络选拔赛
BI技巧丨权限轴
Pointnet/Pointnet++点云数据集处理并训练
《看完就懂系列》字符串截取方法substr() 、 slice() 和 substring()之间的区别和用法
基于NCF的多模块协同实例
Upgrade the smart switch, how much is the difference between the "zero fire version" and "single fire" wiring methods?
. Net ORM framework hisql practice - Chapter 2 - using hisql to realize menu management (add, delete, modify and check)
Lenovo explains in detail the green smart city digital twin platform for the first time to solve the difficulties of urban dual carbon upgrading
Nebula Importer 数据导入实践
Pytorch学习(四)
《工作、消费主义和新穷人》的微信读书笔记
The kth largest element in the array
26. 删除有序数组中的重复项 C#解答
OpenCV的二值化处理函数threshold()详解
FPGA timing constraint sharing 01_ Brief description of the four steps
函数式接口
Nebula importer data import practice
Crawler (6) - Web page data parsing (2) | the use of beautifulsoup4 in Crawlers
整理混乱的头文件,我用include what you use
Unity给自己的脚本添加类似编辑器扩展的功能案例ContextMenu的使用