资源简介
LearningOpenCV_Code.rar
代码片段和文件信息
// Example 10-1. Pyramid Lucas-Kanade optical flow code
//
/* *************** License:**************************
Oct. 3 2008
Right to use this code in any way you want without warrenty support or any guarentee of it working.
BOOK: It would be nice if you cited it:
Learning OpenCV: Computer Vision with the OpenCV Library
by Gary Bradski and Adrian Kaehler
Published by O‘Reilly Media October 3 2008
AVAILABLE AT:
http://www.amazon.com/Learning-OpenCV-Computer-Vision-Library/dp/0596516134
Or: http://oreilly.com/catalog/9780596516130/
ISBN-10: 0596516134 or: ISBN-13: 978-0596516130
OTHER OPENCV SITES:
* The source code is on sourceforge at:
http://sourceforge.net/projects/opencvlibrary/
* The OpenCV wiki page (As of Oct 1 2008 this is down for changing over servers but should come back):
http://opencvlibrary.sourceforge.net/
* An active user group is at:
http://tech.groups.yahoo.com/group/OpenCV/
* The minutes of weekly OpenCV development meetings are at:
http://pr.willowgarage.com/wiki/OpenCV
************************************************** */
#include
#include
#include
#include
const int MAX_CORNERS = 500;
int main(int argc char** argv) {
// Initialize load two images from the file system and
// allocate the images and other structures we will need for
// results.
//
IplImage* imgA = cvLoadImage(“OpticalFlow0.jpg“CV_LOAD_IMAGE_GRAYSCALE);
IplImage* imgB = cvLoadImage(“OpticalFlow1.jpg“CV_LOAD_IMAGE_GRAYSCALE);
CvSize img_sz = cvGetSize( imgA );
int win_size = 10;
IplImage* imgC = cvLoadImage(“OpticalFlow1.jpg“CV_LOAD_IMAGE_UNCHANGED);
// The first thing we need to do is get the features
// we want to track.
//
IplImage* eig_image = cvCreateImage( img_sz IPL_DEPTH_32F 1 );
IplImage* tmp_image = cvCreateImage( img_sz IPL_DEPTH_32F 1 );
int corner_count = MAX_CORNERS;
CvPoint2D32f* cornersA = new CvPoint2D32f[ MAX_CORNERS ];
cvGoodFeaturesToTrack(
imgA
eig_image
tmp_image
cornersA
&corner_count
0.01
5.0
0
3
0
0.04
);
cvFindCornerSubPix(
imgA
cornersA
corner_count
cvSize(win_sizewin_size)
cvSize(-1-1)
cvTermCriteria(CV_TERMCRIT_ITER|CV_TERMCRIT_EPS200.03)
);
// Call the Lucas Kanade algorithm
//
char features_found[ MAX_CORNERS ];
float feature_errors[ MAX_CORNERS ];
CvSize pyr_sz = cvSize( imgA->width+8 imgB->height/3 );
IplImage* pyrA = cvCreateImage( pyr_sz IPL_DEPTH_32F 1 );
IplImage* pyrB = cvCreateImage( pyr_sz IPL_DEPTH_32F 1 );
CvPoint2D32f* cornersB = new CvPoint2D32f[ MAX_CORNERS ];
cvCalcOpticalFlowPyrLK(
imgA
imgB
pyrA
pyrB
cornersA
cornersB
corner_count
cvSize( win_sizewin_size )
5
features_found
feature_errors
cvTermCriteria( CV_TERMCRIT_ITER | CV_TERMCRIT_EPS 20 .3 )
0
);
/
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 6148 2008-10-07 15:10 LearningOpenCV_Code\.DS_Store
文件 189623 2008-10-07 10:00 LearningOpenCV_Code\adrian.jpg
文件 373704 2008-10-07 10:00 LearningOpenCV_Code\agaricus-lepiota.data
文件 6148 2008-10-07 15:08 LearningOpenCV_Code\birdseye\.DS_Store
文件 317775 2008-10-07 10:00 LearningOpenCV_Code\birdseye\IMG_0214.jpg
文件 317832 2008-10-07 10:00 LearningOpenCV_Code\birdseye\IMG_0214L.jpg
文件 325383 2008-10-07 10:00 LearningOpenCV_Code\birdseye\IMG_0215.jpg
文件 325446 2008-10-07 10:00 LearningOpenCV_Code\birdseye\IMG_0215L.jpg
文件 302958 2008-10-07 10:00 LearningOpenCV_Code\birdseye\IMG_0217.jpg
文件 302321 2008-10-07 10:00 LearningOpenCV_Code\birdseye\IMG_0217L.jpg
文件 296209 2008-10-07 10:00 LearningOpenCV_Code\birdseye\IMG_0218.jpg
文件 295342 2008-10-07 10:00 LearningOpenCV_Code\birdseye\IMG_0218L.jpg
文件 297508 2008-10-07 10:00 LearningOpenCV_Code\birdseye\IMG_0219.jpg
文件 297073 2008-10-07 10:00 LearningOpenCV_Code\birdseye\IMG_0219L.jpg
文件 348274 2008-10-07 10:00 LearningOpenCV_Code\birdseye\IMG_0220.jpg
文件 348262 2008-10-07 10:00 LearningOpenCV_Code\birdseye\IMG_0220L.jpg
文件 5237 2008-10-07 10:00 LearningOpenCV_Code\BlueCup.jpg
文件 463757 2008-10-07 10:00 LearningOpenCV_Code\calibration\IMG_0191.jpg
文件 407260 2008-10-07 10:00 LearningOpenCV_Code\calibration\IMG_0192.jpg
文件 447239 2008-10-07 10:00 LearningOpenCV_Code\calibration\IMG_0193.jpg
文件 451479 2008-10-07 10:00 LearningOpenCV_Code\calibration\IMG_0194.jpg
文件 490611 2008-10-07 10:00 LearningOpenCV_Code\calibration\IMG_0195.jpg
文件 450338 2008-10-07 10:00 LearningOpenCV_Code\calibration\IMG_0196.jpg
文件 433052 2008-10-07 10:00 LearningOpenCV_Code\calibration\IMG_0197.jpg
文件 429153 2008-10-07 10:00 LearningOpenCV_Code\calibration\IMG_0198.jpg
文件 431073 2008-10-07 10:00 LearningOpenCV_Code\calibration\IMG_0199.jpg
文件 457885 2008-10-07 10:00 LearningOpenCV_Code\calibration\IMG_0200.jpg
文件 465117 2008-10-07 10:00 LearningOpenCV_Code\calibration\IMG_0201.jpg
文件 466802 2008-10-07 10:00 LearningOpenCV_Code\calibration\IMG_0202.jpg
文件 502801 2008-10-07 10:00 LearningOpenCV_Code\calibration\IMG_0203.jpg
............此处省略149个文件信息
相关资源
- tixati271.zip
- guns-vip-advanced-20191009-cHhZXNEWlh28v.zip
- CHN_adm1_shp.zip
- 矩阵分析与应用张贤达第二版.pdf
- PMBOK第六版_中文版带完整目录1.pdf
- 矩阵分析与应用_张贤达.pdf.zip
- CFA2020LevelI-SchweserNotesBook2-4.zip
- NFC技术原理与应用王淼等编著.pdf
- 中国土地利用现状遥感监测数据1980
- 5f6f54f436bf275bf3d57e0e81dc4740.txt
- VisualGDB-5.2r8.7z
- unity底层源码.rar
- simulationandsoftwareradioformobilecommunicati
- 12.4.1.7z
- SSM_users_dept.zip
- 欢乐麻将游戏源码.rar
- 模拟coms集成电路设计答案.pdf
- 《源创客》迄今为止,最好用的PCB3
- 最优化导论(第四版)课后习题答案
- wyz199326_10141097.zip
- baotao.rar
- 算法竞赛入门经典第2版.zip
- WPS二次开发接口
- 基于R语言的时间序列分析以及garch模
- 国内顶级培训机构CISSP中英文对照习题
- 深思最新GTJ2019写锁工具.rar
- PMBOK第六版_中文版(带完整目录)_
- STM32 USB HID 的通信 源程序(上下位机
- python实现车道线识别程序
- 公章.psd
评论
共有 条评论