当前位置:网站首页>关于判断点是否位于轮廓内的一点思考
关于判断点是否位于轮廓内的一点思考
2022-07-04 17:41:00 【昊虹图像算法】
在CSDN上找到了判断点是否位于多边形内部的方法,链接如下:
https://blog.csdn.net/u011722133/article/details/52813374
https://blog.csdn.net/hjk61314/article/details/82587196
那么可否使用上述方法判断点是否位于轮廓内呢?
答案是:得(děi)分情况。
当我们轮廓的宽度为1时,可以,但当轮廓宽度不为1时是不可以的。
比如下面这种轮廓是可以的:
但是下面这种轮廓是不可以的:
为什么不可以,为什么可以,根据上面两篇博文提供的方法很容易想到。
其实当宽度为1时,可以用函数drawContours()把轮廓点集以实心方式画出(参数thickness的值设为FILLED)。进而判断一个点是否在轮廓内部。
当轮廓以实心方式画出之后,比如下面这个被画为实心的轮廓:
我只需要判断某点的像素灰度值是否大于某个阈值就行了,比如判断像素的灰度值是否大于200。大于200的认为是轮廓上或轮廓内部,小于200的认为是在轮廓外部。
边栏推荐
- Behind the ultra clear image quality of NBA Live Broadcast: an in-depth interpretation of Alibaba cloud video cloud "narrowband HD 2.0" technology
- BI技巧丨权限轴
- 基于lex和yacc的词法分析器+语法分析器
- Safer, smarter and more refined, Chang'an Lumin Wanmei Hongguang Mini EV?
- Perfect JS event delegation
- ByteDance dev better technology salon was successfully held, and we joined hands with Huatai to share our experience in improving the efficiency of web research and development
- Uni app and uviewui realize the imitation of Xiaomi mall app (with source code)
- 1672. Total assets of the richest customers
- Unity编辑器扩展C#遍历文件夹以及子目录下的所有图片
- 数组中的第K个最大元素
猜你喜欢

使用canal配合rocketmq监听mysql的binlog日志

2022CoCa: Contrastive Captioners are Image-Text Fountion Models

建立自己的网站(15)
Summary and sorting of 8 pits of redis distributed lock
![[2022 Jiangxi graduate mathematical modeling] curling movement idea analysis and code implementation](/img/63/8d5f875b4409511628faf2914836d3.png)
[2022 Jiangxi graduate mathematical modeling] curling movement idea analysis and code implementation
![[uniapp] uniapp development app online Preview PDF file](/img/11/d640338c626249057f7ad616b55c4f.png)
[uniapp] uniapp development app online Preview PDF file

Learning path PHP -- phpstudy "hosts file does not exist or is blocked from opening" when creating the project

Torchdrug tutorial

Scala basic tutorial -- 20 -- akka

Angry bird design based on unity
随机推荐
LeetCode第300场周赛(20220703)
正则替换【JS,正则表达式】
Pb extended DLL development (super chapter) (VII)
Deleting nodes in binary search tree
[release] a tool for testing WebService and database connection - dbtest v1.0
【机器学习的数学基础】(一)线性代数(Linear Algebra)(上+)
Scala基础教程--19--Actor
发送和接收IBM WebSphere MQ消息
Scala basic tutorial -- 14 -- implicit conversion
Unity编辑器扩展C#遍历文件夹以及子目录下的所有图片
2022CoCa: Contrastive Captioners are Image-Text Fountion Models
C#实现定义一套中间SQL可以跨库执行的SQL语句(案例详解)
Scala基础教程--15--递归
问下各位大佬有用过cdc直接mysql to clickhouse的么
ESP32-C3入门教程 问题篇⑫——undefined reference to rom_temp_to_power, in function phy_get_romfunc_addr
Scala basic tutorial -- 17 -- Collection
Scala basic tutorial -- 20 -- akka
神经网络物联网是什么意思通俗的解释
Scala基础教程--20--Akka
一种将Tree-LSTM的强化学习用于连接顺序选择的方法