openCv中的线相交轮廓 [英] Line intersecting contour in openCv

查看:531
本文介绍了openCv中的线相交轮廓的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的轮廓是 object ..和 line ..
对象正在移动..但是恒定的..
我想知道轮廓与直线相交的点.

例如:-以赛车作为终点的例子为例.
我有一个汽车轮廓线和终点线.
我想知道轮廓上与终点线相交的点.

解决方案

将对象轮廓与线轮廓相交(使用numpy.logical_and( object_mask, line_mask )),结果图像非零的所有点都是相交点.

I have a contour of object..and a line..
Object is moving..but line is constant..
I want to know the points at which contour intersects the line..

For example:- Take example of Car Race in which their is finish line..
I have a contour of Car and finish line.
I want to know the points on contour which intersects the finish line.

解决方案

Intersect the object contour with the line contour (use numpy.logical_and( object_mask, line_mask )) and all points where the resulting image is non-zero are the points of intersection.

这篇关于openCv中的线相交轮廓的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆