简体   繁体   English

在opencv c ++上检测运动(移动摄像头)

[英]detecting motion on opencv c++ (moving camera)

I'm doing a project for the university and I'm working with OpenCV (that is really awesome). 我正在为大学做一个项目,我正在使用OpenCV(这真的很棒)。

Now my problem is: 现在我的问题是:
I have a video (.avi) and I have detected all the information I want to know about the blobs that suddenly appear in the RGB range between red and yellow. 我有一个视频(.avi),我已经检测到了我想知道的关于突然出现在红色和黄色之间的RGB范围内的斑点的所有信息。 After I have realized a matrix that saves all the information about the pixel values, finally I create an image in the scale of red that represents the median pixel values. 在我实现了一个保存有关像素值的所有信息的矩阵之后,我最终创建了一个红色标度的图像,表示中值像素值。

The real problem is that the video is not static and the camera moves (not too much but it moves). 真正的问题是视频不是静态的,摄像机会移动(不会移动太多但是移动)。
Can I calculate the x and y coordinates of the camera motion so I could shift the value of the matrix? 我可以计算相机运动的x和y坐标,以便我可以移动矩阵的值吗?

Who cares about your English? 谁在乎你的英语? Till we understand your problem :) What you could really do is to give a shot at KLT motion detection that is implemented in OpenCV. 直到我们理解你的问题:)你真正能做的就是试一下在OpenCV中实现的KLT运动检测。 Here is a link to KLT also known as optical flow If you can filter down the motion vectors limited to the blobs you can certainly get hold of the object you want to track. 以下是KLT的链接,也称为光流如果您可以过滤限制为斑点的运动矢量,您当然可以抓住想要跟踪的对象。 Even better to give KLT the objects initial coordinates/area to track. 更好的是给KLT提供对象的初始坐标/区域来跟踪。 Have you checked OpenCV blobs library to get hold of the blobs? 你检查过OpenCV blobs库来获取blob吗? Here is the link 这是链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM