资源简介
运动目标检测ViBe算法相关代码,原作者的代码。。。。
代码片段和文件信息
/* Copyright - Benjamin Laugraud - 2016
* Copyright - Marc Van Droogenbroeck - 2016
*
* ViBe is covered by a patent (see http://www.telecom.ulg.ac.be/research/vibe).
*
* Permission to use ViBe without payment of fee is granted for nonprofit
* educational and research purposes only.
*
* This work may not be copied or reproduced in whole or in part for any
* purpose.
*
* Copying reproduction or republishing for any purpose shall require a
* license. Please contact the authors in such cases. All the code is provided
* without any guarantee.
*
* This simple example program takes a path to a video sequence as an argument.
* When it is executed two windows are opened: one displaying the input
* sequence and one displaying the segmentation maps produced by ViBe. Note
* that this program uses the monochromatic version of ViBe.
*/
#include
#include
#include
#ifndef OPENCV_3
#include
#include
#else
#include
#endif /* OPENCV_3 */
#include
#include
#include
using namespace std;
using namespace cv;
using namespace ViBe;
int main(int argc char** argv) {
if (argc != 2) {
cerr << “A video file must be given as an argument to the program!“;
cerr << endl;
return EXIT_FAILURE;
}
/* Parameterization of ViBe. */
typedef ViBeSequential<1 Manhattan<1> > ViBe;
/* Random seed. */
srand(time(NULL));
cv::VideoCapture decoder(argv[1]);
cv::Mat frame;
int32_t height = decoder.get(CV_CAP_PROP_frame_HEIGHT);
int32_t width = decoder.get(CV_CAP_PROP_frame_WIDTH);
ViBe* vibe = NULL;
cv::Mat bwframe(height width CV_8UC1);
cv::Mat segmentationMap(height width CV_8UC1);
bool firstframe = true;
while (decoder.read(frame)) {
cv::cvtColor(frame bwframe CV_RGB2GRAY);
if (firstframe) {
/* Instantiation of ViBe. */
vibe = new ViBe(height width bwframe.data);
firstframe = false;
}
/* Segmentation and update. */
vibe->segmentation(bwframe.data segmentationMap.data);
vibe->update(bwframe.data segmentationMap.data);
/* Post-processing: 3x3 median filter. */
medianBlur(segmentationMap segmentationMap 3);
imshow(“Input video“ bwframe);
imshow(“Segmentation by ViBe“ segmentationMap);
cvWaitKey(1);
}
delete vibe;
cvDestroyAllWindows();
decoder.release();
return EXIT_SUCCESS;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2016-06-07 18:13 libvibe++\
目录 0 2016-06-01 13:24 libvibe++\src\
目录 0 2016-06-01 13:26 libvibe++\src\libvibe++\
目录 0 2016-06-01 13:24 libvibe++\src\libvibe++\common\
文件 1520 2016-06-02 13:43 libvibe++\src\libvibe++\common\ViBeTemplateba
文件 5761 2016-06-02 13:42 libvibe++\src\libvibe++\common\ViBeba
文件 2721 2016-06-02 13:42 libvibe++\src\libvibe++\common\ViBeba
文件 1752 2016-06-02 13:43 libvibe++\src\libvibe++\common\ViBeTemplateba
文件 1489 2016-06-02 13:43 libvibe++\src\libvibe++\ViBe.h
目录 0 2016-06-01 13:24 libvibe++\src\libvibe++\math\
文件 1104 2016-06-02 13:43 libvibe++\src\libvibe++\math\AbsoluteValue.h
目录 0 2016-06-02 13:18 libvibe++\src\libvibe++\distances\
文件 2876 2016-06-02 13:43 libvibe++\src\libvibe++\distances\Manhattan.h
目录 0 2016-06-01 13:24 libvibe++\src\libvibe++\system\
文件 1104 2016-06-02 13:43 libvibe++\src\libvibe++\system\types.h
文件 851 2016-06-02 13:43 libvibe++\src\libvibe++\system\inline.h
目录 0 2016-06-02 13:18 libvibe++\src\libvibe++\me
文件 1593 2016-06-02 13:43 libvibe++\src\libvibe++\me
文件 1941 2016-06-02 13:43 libvibe++\src\libvibe++\me
文件 2043 2016-06-02 13:43 libvibe++\src\libvibe++\me
文件 10829 2016-06-02 13:43 libvibe++\src\libvibe++\ViBe.t
文件 1388 2016-06-02 13:43 libvibe++\src\CMakeLists.txt
文件 440 2016-06-02 13:42 libvibe++\LICENSE
目录 0 2016-06-02 14:14 libvibe++\main\
文件 2575 2016-06-02 14:14 libvibe++\main\ViBe_8UC1.cpp
文件 1717 2016-06-02 14:14 libvibe++\main\CMakeLists.txt
文件 2494 2016-06-02 14:14 libvibe++\main\ViBe_8UC3.cpp
目录 0 2016-06-01 13:57 libvibe++\cmake\
文件 1411 2016-06-02 13:40 libvibe++\cmake\BenlaugUtils.cmake
文件 1927 2016-06-02 14:14 libvibe++\INSTALL
文件 1264 2016-06-02 13:43 libvibe++\CMakeLists.txt
............此处省略1个文件信息
- 上一篇:高频课程设计 二极管双平衡混频器
- 下一篇:PIC单片机的EEPROM读写及说明
评论
共有 条评论