当前位置:网站首页>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 .
边栏推荐
猜你喜欢
Online sql to excel (xls/xlsx) tool
One question per day (2022-07-02) - Minimum refueling times
欧拉函数
To sort out messy header files, I use include what you use
用实际例子详细探究OpenCV的轮廓绘制函数drawContours()
MySQL数据库基本操作-DDL | 黑马程序员
Go microservice (II) - detailed introduction to protobuf
“只跑一趟”,小区装维任务主动推荐探索
读写关闭的channel是啥后果?
整理混乱的头文件,我用include what you use
随机推荐
From automation to digital twins, what can Tupo do?
Summary and sorting of 8 pits of redis distributed lock
Pointnet/Pointnet++点云数据集处理并训练
Caché WebSocket
长城证券开户安全吗 买股票怎么开户
Is it safe to open an account at Great Wall Securities? How to open an account when buying stocks
Technologie de base de la programmation Shell IV
Comment utiliser async awati asynchrone Task Handling au lieu de backgroundworker?
The latest progress of Intel Integrated Optoelectronics Research promotes the progress of CO packaging optics and optical interconnection technology
Shell programming core technology II
HDU 1097 A hard puzzle
测试工程师如何“攻城”(下)
2021 合肥市信息学竞赛小学组
Cache é JSON uses JSON adapters
HDU 6440 2018中国大学生程序设计网络选拔赛
"Only one trip", active recommendation and exploration of community installation and maintenance tasks
2022养生展,健康展,北京大健康展,健康产业展11月举办
C # implementation defines a set of SQL statements that can be executed across databases in the middle of SQL (detailed explanation of the case)
Build your own website (15)
反射(一)