当前位置:网站首页>OpenCV每日函数 结构分析和形状描述符(7) 寻找多边形(轮廓)/旋转矩形交集
OpenCV每日函数 结构分析和形状描述符(7) 寻找多边形(轮廓)/旋转矩形交集
2022-06-24 07:06:00 【坐望云起】
一、intersectConvexConvex函数
1、函数原型
查找两个凸多边形的交集。返回相交多边形面积的绝对值。intersectConvexConvex 不确认两个多边形都是凸的,如果不是,将返回无效结果。
float cv::intersectConvexConvex (InputArray p1, InputArray p2, OutputArray p12, bool handleNested=true)
2、参数详解
p1 | 第一个轮廓 |
p2 | 第二个轮廓 |
p12 | 描述相交区域的输出多边形 |
handleNested | 当为真时,如果一个多边形完全包含在另一个多边形中,则找到一个交点。 如果为 false,则找不到交集。 如果多边形共享一条边或一个多边形的顶点位于另一个多边形的边上,则它们不被视为嵌套,无论handleNested 的值如何,都将找到交点。 |
二、rotatedRectangleIntersection函数
1、函数原型
该函数找出两个旋转矩形之间是否有任何交集。如果存在,则也返回相交区域的顶点。
int cv::rotatedRectangleIntersection (const RotatedRect &rect1, const RotatedRect &rect2, OutputArray intersectingRegion)
2、参数详解
rect1 | 第一个矩形 |
rect2 | 第二个矩形 |
intersectingRegion | 相交区域顶点的输出数组。 它最多返回 8 个顶点。 存储为 std::vector<cv::Point2f> 或 cv::Mat 作为 CV_32FC2 类型的 Mx1。 |
3、示意图像
以下是可能的交点的一些示例。 阴影图案表示相交区域,红色顶点由函数返回。

边栏推荐
- orb slam build bug: undefined reference to symbol ‘_ZN5boost6system15system_categoryEv‘
- [xinliu-s6 new model +sa 3-star Xinghai] the new two-way server of the third generation chip was launched and the product was updated~
- orb slam build bug: undefined reference to symbol ‘_ ZN5boost6system15system_ categoryEv‘
- win11在cmder中使用vim查看内容的时候空白
- Rescue system -- the application of read-write separation
- Qt源码分析--QObject(2)
- Detailed explanation of Base64 coding and its variants (to solve the problem that the plus sign changes into a space in the URL)
- js中通过key查找和更新对象中指定值的方法
- There was an error checking the latest version of pip
- xargs使用技巧 —— 筑梦之路
猜你喜欢
K8s deployment of highly available PostgreSQL Cluster -- the road to building a dream
打印出来的对象是[object object],解决方法
ZUCC_编译语言原理与编译_实验06 07 语法分析 LL 分析
为什么ping不通,而traceroute却可以通
[explain the difference between operation and maintenance and network engineering]
Liunx Mysql安装
Xiaohei ai4code code baseline nibble 1
什么是SRE?一文详解SRE运维体系
Detailed explanation of Base64 coding and its variants (to solve the problem that the plus sign changes into a space in the URL)
Pymysql inserts data into MySQL and reports an error for no reason
随机推荐
JS merge multiple objects and remove duplicates
Glusterfs replacement failure brick
【力扣10天SQL入门】Day2
【NOI模拟赛】寄(树形DP)
RuntimeError: Missing dependencies:XXX
Smart power plant: how to make use of easycvr to build a safe, stable, green and environment-friendly intelligent inspection platform
uniapp 热更新后台管理
相机投影矩阵计算
2022 spring recruitment interview summary
等保备案是什么意思?应该去哪里办理备案?
QT writing security video monitoring system 36 onvif continuous movement
Redis cluster data skew
Send custom events in QT
[untitled]
[xinliu-s6 new model +sa 3-star Xinghai] the new two-way server of the third generation chip was launched and the product was updated~
It is enough to read this article about ETL. Three minutes will let you understand what ETL is
不能改变虚拟机电源状态报错解决方案
疫情、失业,2022,我们高喊着摆烂和躺平!
leetcode 1268. Search suggestions system
Shell array