当前位置:网站首页>Opencv daily function structure analysis and shape descriptor (7) finding polygon (contour) / rotating rectangle intersection
Opencv daily function structure analysis and shape descriptor (7) finding polygon (contour) / rotating rectangle intersection
2022-06-24 08:52:00 【Sit and watch the clouds rise】
One 、intersectConvexConvex function
1、 The function prototype
Find the intersection of two convex polygons . Returns the absolute value of the area of an intersecting polygon .intersectConvexConvex Do not confirm that both polygons are convex , If not , Invalid results will be returned .
float cv::intersectConvexConvex (InputArray p1, InputArray p2, OutputArray p12, bool handleNested=true)
2、 Parameters,
p1 | The first outline |
p2 | Second profile |
p12 | The output polygon that describes the intersection area |
handleNested | When it's true , If one polygon is completely contained in another , Then find an intersection . If false, The intersection cannot be found . If a polygon shares an edge or the vertex of one polygon is on the edge of another polygon , Then they are not considered nested , No matter what handleNested What's the value of , Will find the intersection . |
Two 、rotatedRectangleIntersection function
1、 The function prototype
This function finds out if there is any intersection between two rotating rectangles . If there is , The vertices of the intersecting region are also returned .
int cv::rotatedRectangleIntersection (const RotatedRect &rect1, const RotatedRect &rect2, OutputArray intersectingRegion)
2、 Parameters,
rect1 | The first rectangle |
rect2 | The second rectangle |
intersectingRegion | The output array of the vertices of the intersecting region . It returns... At most 8 vertices . Stored as std::vector<cv::Point2f> or cv::Mat As CV_32FC2 Type of Mx1. |
3、 Schematic image
Here are some examples of possible intersections . The shaded pattern represents the intersection area , The red vertex is returned by the function .

边栏推荐
猜你喜欢
为什么ping不通,而traceroute却可以通
One article explains in detail | those things about growth
Pymysql inserts data into MySQL and reports an error for no reason
KaFormer个人笔记整理
【LeetCode】387. 字符串中的第一个唯一字符
[pytoch basic tutorial 31] youtubednn model analysis
Wan Weiwei, a researcher from Osaka University, Japan, introduced the rapid integration method and application of robot based on WRS system
MySQL 因字符集问题插入中文数据时提示代码 :1366
打印出来的对象是[object object],解决方法
What is SRE? A detailed explanation of SRE operation and maintenance system
随机推荐
数据中台:民生银行的数据中台实践方案
MySQL | 存储《康师傅MySQL从入门到高级》笔记
4275. Dijkstra序列
什么是SRE?一文详解SRE运维体系
xargs使用技巧 —— 筑梦之路
Introduction to data platform
GradScaler MaxClipGradScaler
Database to query the quantity of books lent in this month. If it is higher than 10, it will display "more than 10 books lent in this month". Otherwise, it will display "less than 10 books lent in thi
Win11 blank when using VIM to view content in cmder
opencv最大值滤波(不局限于图像)
Several schemes of PHP code encryption
数据中台:国内大厂中台建设架构集锦
What is graph neural network? Figure what is the use of neural networks?
Using ngrok for intranet penetration
rpiplay实现树莓派AirPlay投屏器
rsync做文件备份
Ordering of MySQL composite index
Array opposite pointer series
MySQL 因字符集问题插入中文数据时提示代码 :1366
数据中台:数据中台技术架构详解