我想运行出gtihub的这个程序https://github.com/JaimeIvanCervantes/Tracking 该程序是基于qt和opencv的识别运动的目标
该代码使用的版本好像是opencv2,但是我使用的版本是opencv4.3。在改进代码之后编译通过了可以运行出界面来。但是当我加载视频之后程序自动退出了,应用程序输出报错。如果注释掉medianBlur这一行那么就会对erode报错,请问这是为什么呢?
// Threshold and morphology operations
cv::threshold(foregroundFrame,foregroundFrame,130,255,cv::THRESH_BINARY);
cv::medianBlur(foregroundFrame,foregroundFrame,5);
cv::erode(foregroundFrame,foregroundFrame,cv::Mat());
cv::dilate(foregroundFrame,foregroundFrame,cv::Mat());
Qt报错
13:07:21: Starting C:\Users\75939\Desktop\test5\build-tracking-Desktop_Qt_5_14_2_MinGW_64_bit-Debug\debug\tracking.exe ...
OpenCV: terminate handler is called! The last OpenCV error is:
OpenCV(4.3.0) Error: Assertion failed (!_src0.empty()) in medianBlur, file D:\100\opencv\modules\imgproc\src\median_blur.dispatch.cpp, line 283
13:07:27: C:\Users\75939\Desktop\test5\build-tracking-Desktop_Qt_5_14_2_MinGW_64_bit-Debug\debug\tracking.exe exited with code 3
版本不兼容的原因,换回原来版本试试
您好,我是有问必答小助手,你的问题已经有小伙伴为您解答了问题,您看下是否解决了您的问题,可以追评进行沟通哦~
如果有您比较满意的答案 / 帮您提供解决思路的答案,可以点击【采纳】按钮,给回答的小伙伴一些鼓励哦~~
ps:问答VIP仅需29元,即可享受5次/月 有问必答服务,了解详情>>>https://vip.csdn.net/askvip?utm_source=1146287632
非常感谢您使用有问必答服务,为了后续更快速的帮您解决问题,现诚邀您参与有问必答体验反馈。您的建议将会运用到我们的产品优化中,希望能得到您的支持与协助!
速戳参与调研>>>https://t.csdnimg.cn/Kf0y