├── BG_Mod ├── .vs │ └── BG_Mod │ │ └── v14 │ │ └── .suo ├── BG_Mod.sln └── BG_Mod │ ├── BG_Mod.cpp │ ├── BG_Mod.h │ ├── BG_Mod.vcxproj │ ├── BG_Mod.vcxproj.filters │ ├── cvhead.h │ └── main.cpp ├── Feature ├── .vs │ └── Feature │ │ └── v14 │ │ └── .suo ├── Feature.sln └── Feature │ ├── Feature.cpp │ ├── Feature.h │ ├── Feature.vcxproj │ ├── Feature.vcxproj.filters │ ├── Harris │ ├── harris.cpp │ └── harris.h │ ├── cvhead.h │ └── main.cpp ├── Filter ├── .vs │ └── Filter │ │ └── v14 │ │ └── .suo ├── Filter.sln ├── Filter │ ├── Filter.cpp │ ├── Filter.h │ ├── Filter.vcxproj │ ├── Filter.vcxproj.filters │ ├── Filter.vcxproj.user │ └── cvhead.h └── Photo │ ├── 0957b11b1b10b3d.jpg │ ├── sy_20091108143732390074.jpg │ └── th.jpg ├── Haar_Adaboost ├── .vs │ └── Haar_Adaboost │ │ └── v14 │ │ └── .suo ├── Haar_Adaboost.sln ├── Haar_Adaboost.vcxproj ├── Haar_Adaboost.vcxproj.filters ├── cvhead.h ├── docs │ ├── Rapid_Object_Detection_using_a_Boosted_cascade_of_simple_features1.pdf │ └── 基于AdaBoost算法的人脸检测(北京大学,赵楠).pdf ├── main.cpp └── test1.zip ├── Image_enhance ├── .vs │ └── boost_test │ │ └── v14 │ │ └── .suo ├── boost_test.sln ├── boost_test │ ├── Vooya.lnk │ ├── boost_test.vcxproj │ ├── boost_test.vcxproj.filters │ ├── cvhead.h │ ├── enhance.c │ ├── enhance.h │ ├── main.cpp │ ├── white_uyvy_process_in │ └── white_uyvy_process_out └── photo │ ├── HistQue_352x288.jpg │ ├── gamma.jpg │ ├── gamma_gaitubao_com_352x288(1).jpg │ ├── gamma_gaitubao_com_352x288.jpg │ ├── gamma_gaitubao_com_352x288_1.jpg │ ├── gauss.jpg │ ├── gauss_gaitubao_com_352x288.jpg │ ├── 下载.jpg │ └── 下载_gaitubao_com_352x288.jpg ├── Non-maximum_Suppression_5x5 ├── 2picture_out ├── img8x5_out └── main.c ├── README.md └── Tracke ├── .vs └── Tracke │ └── v14 │ └── .suo ├── Tracke.sln └── klt ├── Klt ├── .vs │ └── Klt │ │ └── v14 │ │ └── .suo ├── Debug │ ├── Klt.Build.CppClean.log │ ├── Klt.exe │ ├── Klt.ilk │ ├── Klt.log │ ├── Klt.pch │ ├── Klt.pdb │ ├── Klt.tlog │ │ ├── CL.command.1.tlog │ │ ├── CL.read.1.tlog │ │ ├── CL.write.1.tlog │ │ ├── Klt.lastbuildstate │ │ ├── link.command.1.tlog │ │ ├── link.read.1.tlog │ │ └── link.write.1.tlog │ ├── StdAfx.obj │ ├── convolve.obj │ ├── error.obj │ ├── example1.obj │ ├── example2.obj │ ├── example3.obj │ ├── example4.obj │ ├── example5.obj │ ├── klt.obj │ ├── klt_util.obj │ ├── main.obj │ ├── pnmio.obj │ ├── pyramid.obj │ ├── selectGoodFeatures.obj │ ├── storeFeatures.obj │ ├── trackFeatures.obj │ ├── vc140.idb │ ├── vc140.pdb │ └── writeFeatures.obj ├── Klt.VC.db ├── Klt.dsp ├── Klt.dsw ├── Klt.opt ├── Klt.plg ├── Klt.sln ├── Klt.vcxproj ├── Klt.vcxproj.filters ├── Klt.vcxproj.user ├── KltExamples.h ├── ReadMe.txt ├── StdAfx.cpp ├── StdAfx.h ├── UpgradeLog.htm ├── base.h ├── convolve.c ├── convolve.h ├── cvhead.h ├── dos2unix.sh ├── draw_img.cpp ├── draw_img.h ├── error.c ├── error.h ├── example1.cpp ├── example2.c ├── example2.cpp ├── example3.c ├── example4.c ├── example5.c ├── klt.c ├── klt.h ├── klt_util.c ├── klt_util.h ├── main.cpp ├── pnmio.c ├── pnmio.h ├── pyramid.c ├── pyramid.h ├── selectGoodFeatures.c ├── storeFeatures.c ├── trackFeatures.c └── writeFeatures.c ├── README.txt ├── doc ├── birchfield-klt-derivation.pdf ├── home_motif.gif ├── index.html ├── installation.html ├── log.html ├── next_motif.gif ├── previous_motif.gif ├── previous_versions.html ├── ref │ ├── backup │ ├── change_pyramid.html │ ├── count.html │ ├── create.html │ ├── feature.html │ ├── fh.html │ ├── fl.html │ ├── ft.html │ ├── index.html │ ├── print_tc.html │ ├── replace.html │ ├── select.html │ ├── stop.html │ ├── store.html │ ├── tc.html │ ├── track.html │ ├── update_border.html │ ├── verbosity.html │ └── write.html ├── shi-tomasi-good-features-cvpr1994.pdf ├── toc_motif.gif ├── up_motif.gif └── user │ ├── backup │ ├── chpt1.html │ ├── chpt2.html │ ├── chpt3.html │ ├── chpt4.html │ ├── chpt5.html │ ├── chpt6.html │ ├── chpt7.html │ ├── index.html │ └── noUchar.html └── klt_track.gif /BG_Mod/.vs/BG_Mod/v14/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/BG_Mod/.vs/BG_Mod/v14/.suo -------------------------------------------------------------------------------- /BG_Mod/BG_Mod.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BG_Mod", "BG_Mod\BG_Mod.vcxproj", "{6BD3C000-A4B8-47A3-AE6D-F15D81722CE6}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {6BD3C000-A4B8-47A3-AE6D-F15D81722CE6}.Debug|x64.ActiveCfg = Debug|x64 17 | {6BD3C000-A4B8-47A3-AE6D-F15D81722CE6}.Debug|x64.Build.0 = Debug|x64 18 | {6BD3C000-A4B8-47A3-AE6D-F15D81722CE6}.Debug|x86.ActiveCfg = Debug|Win32 19 | {6BD3C000-A4B8-47A3-AE6D-F15D81722CE6}.Debug|x86.Build.0 = Debug|Win32 20 | {6BD3C000-A4B8-47A3-AE6D-F15D81722CE6}.Release|x64.ActiveCfg = Release|x64 21 | {6BD3C000-A4B8-47A3-AE6D-F15D81722CE6}.Release|x64.Build.0 = Release|x64 22 | {6BD3C000-A4B8-47A3-AE6D-F15D81722CE6}.Release|x86.ActiveCfg = Release|Win32 23 | {6BD3C000-A4B8-47A3-AE6D-F15D81722CE6}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /BG_Mod/BG_Mod/BG_Mod.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/BG_Mod/BG_Mod/BG_Mod.cpp -------------------------------------------------------------------------------- /BG_Mod/BG_Mod/BG_Mod.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/BG_Mod/BG_Mod/BG_Mod.h -------------------------------------------------------------------------------- /BG_Mod/BG_Mod/BG_Mod.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | {6BD3C000-A4B8-47A3-AE6D-F15D81722CE6} 23 | Win32Proj 24 | BG_Mod 25 | 8.1 26 | 27 | 28 | 29 | Application 30 | true 31 | v140 32 | Unicode 33 | 34 | 35 | Application 36 | false 37 | v140 38 | true 39 | Unicode 40 | 41 | 42 | Application 43 | true 44 | v140 45 | Unicode 46 | 47 | 48 | Application 49 | false 50 | v140 51 | true 52 | Unicode 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | true 74 | C:\opencv\build\include;$(IncludePath) 75 | C:\opencv\build\x86\vc12\lib;$(LibraryPath) 76 | 77 | 78 | true 79 | 80 | 81 | false 82 | 83 | 84 | false 85 | 86 | 87 | 88 | 89 | 90 | Level3 91 | Disabled 92 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 93 | true 94 | 95 | 96 | Console 97 | true 98 | 99 | 100 | 101 | 102 | 103 | 104 | Level3 105 | Disabled 106 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 107 | true 108 | 109 | 110 | Console 111 | true 112 | 113 | 114 | 115 | 116 | Level3 117 | 118 | 119 | MaxSpeed 120 | true 121 | true 122 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 123 | true 124 | 125 | 126 | Console 127 | true 128 | true 129 | true 130 | 131 | 132 | 133 | 134 | Level3 135 | 136 | 137 | MaxSpeed 138 | true 139 | true 140 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 141 | true 142 | 143 | 144 | Console 145 | true 146 | true 147 | true 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | -------------------------------------------------------------------------------- /BG_Mod/BG_Mod/BG_Mod.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 源文件 20 | 21 | 22 | 源文件 23 | 24 | 25 | 26 | 27 | 头文件 28 | 29 | 30 | 头文件 31 | 32 | 33 | -------------------------------------------------------------------------------- /BG_Mod/BG_Mod/cvhead.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | using namespace std; 5 | using namespace cv; 6 | 7 | #define CV_VERSION_ID CVAUX_STR(CV_MAJOR_VERSION) CVAUX_STR(CV_MINOR_VERSION) CVAUX_STR(CV_SUBMINOR_VERSION) 8 | 9 | #ifdef _DEBUG 10 | #define cvLIB(name) "opencv_" name CV_VERSION_ID "d" 11 | #else 12 | #define cvLIB(name) "opencv_" name CV_VERSION_ID 13 | #endif 14 | 15 | #pragma comment(lib,cvLIB("core")) 16 | #pragma comment(lib,cvLIB("highgui")) 17 | #pragma comment(lib,cvLIB("imgproc")) 18 | #pragma comment(lib,cvLIB("objdetect")) 19 | #pragma comment(lib,cvLIB("features2d")) 20 | #pragma comment(lib,cvLIB("nonfree")) 21 | #pragma comment(lib,cvLIB("legacy")) 22 | #pragma comment(lib,cvLIB("ml")) 23 | #pragma comment(lib,cvLIB("contrib")) 24 | #pragma comment(lib,cvLIB("video")) 25 | #pragma comment(lib,cvLIB("videostab")) 26 | #pragma comment(lib,cvLIB("ts")) 27 | #pragma comment(lib,cvLIB("stitching")) 28 | #pragma comment(lib,cvLIB("flann")) 29 | #pragma comment(lib,cvLIB("calib3d")) 30 | -------------------------------------------------------------------------------- /BG_Mod/BG_Mod/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/BG_Mod/BG_Mod/main.cpp -------------------------------------------------------------------------------- /Feature/.vs/Feature/v14/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Feature/.vs/Feature/v14/.suo -------------------------------------------------------------------------------- /Feature/Feature.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Feature", "Feature\Feature.vcxproj", "{AC0430B9-239C-49BD-A450-3A4C464ECDE9}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {AC0430B9-239C-49BD-A450-3A4C464ECDE9}.Debug|x64.ActiveCfg = Debug|x64 17 | {AC0430B9-239C-49BD-A450-3A4C464ECDE9}.Debug|x64.Build.0 = Debug|x64 18 | {AC0430B9-239C-49BD-A450-3A4C464ECDE9}.Debug|x86.ActiveCfg = Debug|Win32 19 | {AC0430B9-239C-49BD-A450-3A4C464ECDE9}.Debug|x86.Build.0 = Debug|Win32 20 | {AC0430B9-239C-49BD-A450-3A4C464ECDE9}.Release|x64.ActiveCfg = Release|x64 21 | {AC0430B9-239C-49BD-A450-3A4C464ECDE9}.Release|x64.Build.0 = Release|x64 22 | {AC0430B9-239C-49BD-A450-3A4C464ECDE9}.Release|x86.ActiveCfg = Release|Win32 23 | {AC0430B9-239C-49BD-A450-3A4C464ECDE9}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /Feature/Feature/Feature.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Feature/Feature/Feature.h -------------------------------------------------------------------------------- /Feature/Feature/Feature.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | {AC0430B9-239C-49BD-A450-3A4C464ECDE9} 23 | Win32Proj 24 | Feature 25 | 8.1 26 | 27 | 28 | 29 | Application 30 | true 31 | v140 32 | Unicode 33 | 34 | 35 | Application 36 | false 37 | v140 38 | true 39 | Unicode 40 | 41 | 42 | Application 43 | true 44 | v140 45 | Unicode 46 | 47 | 48 | Application 49 | false 50 | v140 51 | true 52 | Unicode 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | true 74 | C:\opencv\build\include;$(IncludePath) 75 | C:\opencv\build\x86\vc12\lib;$(LibraryPath) 76 | 77 | 78 | true 79 | 80 | 81 | false 82 | 83 | 84 | false 85 | 86 | 87 | 88 | 89 | 90 | Level3 91 | Disabled 92 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 93 | true 94 | 95 | 96 | Console 97 | true 98 | 99 | 100 | 101 | 102 | 103 | 104 | Level3 105 | Disabled 106 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 107 | true 108 | 109 | 110 | Console 111 | true 112 | 113 | 114 | 115 | 116 | Level3 117 | 118 | 119 | MaxSpeed 120 | true 121 | true 122 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 123 | true 124 | 125 | 126 | Console 127 | true 128 | true 129 | true 130 | 131 | 132 | 133 | 134 | Level3 135 | 136 | 137 | MaxSpeed 138 | true 139 | true 140 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 141 | true 142 | 143 | 144 | Console 145 | true 146 | true 147 | true 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | -------------------------------------------------------------------------------- /Feature/Feature/Feature.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | {53b1fb64-d1a9-4ef7-819b-523d42a06ed9} 18 | 19 | 20 | 21 | 22 | 源文件 23 | 24 | 25 | 源文件 26 | 27 | 28 | Harris 29 | 30 | 31 | 32 | 33 | 头文件 34 | 35 | 36 | 头文件 37 | 38 | 39 | Harris 40 | 41 | 42 | -------------------------------------------------------------------------------- /Feature/Feature/Harris/harris.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "opencv2/imgproc/imgproc.hpp" 4 | #include "opencv2/highgui/highgui.hpp" 5 | using namespace cv; 6 | using namespace std; 7 | 8 | #define ENABLE_SHI_TOMASI_CONNER_POINT (0) //使用Shi_Tomais角点,Harris的改进 9 | 10 | /* 11 | RGB转换成灰度图像的一个常用公式是: 12 | Gray = R*0.299 + G*0.587 + B*0.114 13 | */ 14 | //******************灰度转换函数************************* 15 | //第一个参数image输入的彩色RGB图像的引用; 16 | //第二个参数imageGray是转换后输出的灰度图像的引用; 17 | //******************************************************* 18 | void ConvertRGB2GRAY(const Mat &image, Mat &imageGray); 19 | 20 | //******************Sobel卷积因子计算X、Y方向梯度和梯度方向角******************** 21 | //第一个参数imageSourc原始灰度图像; 22 | //第二个参数imageSobelX是X方向梯度图像; 23 | //第三个参数imageSobelY是Y方向梯度图像; 24 | //第四个参数pointDrection是梯度方向角数组指针 25 | //************************************************************* 26 | void SobelGradDirction(Mat &imageSource, Mat &imageSobelX, Mat &imageSobelY); 27 | 28 | //******************计算Sobel的X方向梯度幅值的平方************************* 29 | //第一个参数imageGradX是X方向梯度图像; 30 | //第二个参数SobelAmpXX是输出的X方向梯度图像的平方 31 | //************************************************************* 32 | void SobelXX(const Mat imageGradX, Mat_ &SobelAmpXX); 33 | 34 | //******************计算Sobel的Y方向梯度幅值的平方************************* 35 | //第一个参数imageGradY是Y方向梯度图像; 36 | //第二个参数SobelAmpXX是输出的Y方向梯度图像的平方 37 | //************************************************************* 38 | void SobelYY(const Mat imageGradY, Mat_ &SobelAmpYY); 39 | 40 | //******************计算Sobel的XY方向梯度幅值的乘积************************* 41 | //第一个参数imageGradX是X方向梯度图像; 42 | //第二个参数imageGradY是Y方向梯度图像; 43 | //第二个参数SobelAmpXY是输出的XY方向梯度图像 44 | //************************************************************* 45 | void SobelXY(const Mat imageGradX, const Mat imageGradY, Mat_ &SobelAmpXY); 46 | 47 | //****************计算一维高斯的权值数组***************** 48 | //第一个参数size是代表的卷积核的边长的大小 49 | //第二个参数sigma表示的是sigma的大小 50 | //******************************************************* 51 | double *getOneGuassionArray(int size, double sigma); 52 | 53 | //****************高斯滤波函数的实现***************** 54 | //第一个参数srcImage是代表的输入的原图 55 | //第二个参数dst表示的是输出的图 56 | //第三个参数size表示的是卷积核的边长的大小 57 | //******************************************************* 58 | void MyGaussianBlur(Mat_ &srcImage, Mat_ &dst, int size); 59 | 60 | //****计算局部特涨结果矩阵M的特征值和响应函数H = (A*B - C) - k*(A+B)^2****** 61 | //M 62 | //A C 63 | //C B 64 | //Tr(M)=a+b=A+B 65 | //Det(M)=a*b=A*B-C^2 66 | //计算输出响应函数的值得矩阵 67 | //**************************************************************************** 68 | void harrisResponse(Mat_ &GaussXX, Mat_ &GaussYY, Mat_ &GaussXY, Mat_ &resultData, float k); 69 | 70 | 71 | //***********非极大值抑制和满足阈值及某邻域内的局部极大值为角点************** 72 | //第一个参数是响应函数的矩阵 73 | //第二个参数是输入的灰度图像 74 | //第三个参数表示的是输出的角点检测到的结果图 75 | void LocalMaxValue(Mat_ &resultData, Mat &srcGray, Mat &ResultImage, int kSize); 76 | 77 | 78 | //********************* CStyle ************************************ 79 | ////////////////////////////////////////////////////////////////////////// 80 | /// \brief 计算局部特涨结果矩阵M的特征值和响应函数H = (A*B - C) - k*(A+B)^2 81 | /// \remark 82 | /// \param[in] GaussXX 高斯滤波后X方向梯度平方 83 | /// \param[in] GaussYY 高斯滤波后Y方向梯度平方 84 | /// \param[in/out] resultData 输出响应 85 | /// \param[in] width 图像宽 86 | /// \param[in] height 图像高 87 | ////////////////////////////////////////////////////////////////////////// 88 | /***************************************** 89 | M 90 | A C 91 | C B 92 | Tr(M)=a+b=A+B 93 | Det(M)=a*b=A*B-C^2 94 | 计算输出响应函数的值得矩阵 95 | *****************************************/ 96 | void harrisResponse_CStyle(float* GaussXX, float* GaussYY, float* GaussXY, float* resultData, int width, int height, float k); 97 | 98 | ////////////////////////////////////////////////////////////////////////// 99 | /// \brief 梯度图高斯滤波 100 | /// \remark 101 | /// \param[in] srcImage 梯度图 102 | /// \param[in] width 图像宽 103 | /// \param[in] height 图像高 104 | /// \param[in/out] dst 滤波输出 105 | /// \param[in] k_size 高斯滤波尺寸 106 | /// \param[in] channels 图像通道数,暂时支持单通道 107 | ////////////////////////////////////////////////////////////////////////// 108 | int MyGaussianBlur_CStyle(float *srcImage, int width, int height, float* dst, int k_size, int channels); 109 | 110 | ////////////////////////////////////////////////////////////////////////// 111 | /// \brief 计算X,Y梯度乘积 112 | /// \remark 113 | /// \param[in] imageGradX X方向梯度图 114 | /// \param[in] imageGradY Y方向梯度图 115 | /// \param[in] width 图像宽 116 | /// \param[in] height 图像高 117 | /// \param[in/out] SobelAmpXY 输出 118 | ////////////////////////////////////////////////////////////////////////// 119 | void SobelXY_CStyle(float* imageGradX, float* imageGradY, int width, int height, float* SobelAmpXY); 120 | 121 | ////////////////////////////////////////////////////////////////////////// 122 | /// \brief 计算Y梯度平方 123 | /// \remark 124 | /// \param[in] imageGradY Y方向梯度图 125 | /// \param[in] width 图像宽 126 | /// \param[in] height 图像高 127 | /// \param[in/out] SobelAmpYY 输出 128 | ////////////////////////////////////////////////////////////////////////// 129 | void SobelYY_CStyle(float* imageGradY, int width, int height, float* SobelAmpYY); 130 | 131 | ////////////////////////////////////////////////////////////////////////// 132 | /// \brief 计算X梯度平方 133 | /// \remark 134 | /// \param[in] imageGradX X方向梯度图 135 | /// \param[in] width 图像宽 136 | /// \param[in] height 图像高 137 | /// \param[in/out] SobelAmpXX 输出 138 | ////////////////////////////////////////////////////////////////////////// 139 | void SobelXX_CStyle(float* imageGradX, int width, int height, float* SobelAmpXX); 140 | 141 | ////////////////////////////////////////////////////////////////////////// 142 | /// \brief 计算图像梯度 143 | /// \remark 144 | /// \param[in] imageSource 源图(灰度) 145 | /// \param[in] width 图像宽 146 | /// \param[in] height 图像高 147 | /// \param[in/out] imageGradX X方向梯度图 148 | /// \param[in/out] imageGradY Y方向梯度图 149 | ////////////////////////////////////////////////////////////////////////// 150 | void SobelGradDirction_CStyle(unsigned char *imageSource, int width, int height, float* imageSobelX, float* imageSobelY); 151 | 152 | ////////////////////////////////////////////////////////////////////////// 153 | /// \brief 3X3 角点响应图非极大值抑制 154 | /// \remark 155 | /// \param[in] resultData 角点响应图 156 | /// \param[in] srcGray 源灰度应图 157 | /// \param[in/out] ResultImage 输出--极大值角点处画点 158 | /// \param[in] width 图像宽 159 | /// \param[in] height 图像高 160 | ////////////////////////////////////////////////////////////////////////// 161 | void Local_3x3_MaxValue_CStyle(float *resultData, unsigned char* srcGray, unsigned char* ResultImage, int width, int height); 162 | 163 | //使用opencv实现的harris角点响应测试 164 | int harris_main(); 165 | 166 | //使用C语言实现的harris角点响应测试 167 | int harris_main_CStyle(); -------------------------------------------------------------------------------- /Feature/Feature/cvhead.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | using namespace std; 5 | using namespace cv; 6 | 7 | #define CV_VERSION_ID CVAUX_STR(CV_MAJOR_VERSION) CVAUX_STR(CV_MINOR_VERSION) CVAUX_STR(CV_SUBMINOR_VERSION) 8 | 9 | #ifdef _DEBUG 10 | #define cvLIB(name) "opencv_" name CV_VERSION_ID "d" 11 | #else 12 | #define cvLIB(name) "opencv_" name CV_VERSION_ID 13 | #endif 14 | 15 | #pragma comment(lib,cvLIB("core")) 16 | #pragma comment(lib,cvLIB("highgui")) 17 | #pragma comment(lib,cvLIB("imgproc")) 18 | #pragma comment(lib,cvLIB("objdetect")) 19 | #pragma comment(lib,cvLIB("features2d")) 20 | #pragma comment(lib,cvLIB("nonfree")) 21 | #pragma comment(lib,cvLIB("legacy")) 22 | #pragma comment(lib,cvLIB("ml")) 23 | #pragma comment(lib,cvLIB("contrib")) 24 | #pragma comment(lib,cvLIB("video")) 25 | #pragma comment(lib,cvLIB("videostab")) 26 | #pragma comment(lib,cvLIB("ts")) 27 | #pragma comment(lib,cvLIB("stitching")) 28 | #pragma comment(lib,cvLIB("flann")) 29 | #pragma comment(lib,cvLIB("calib3d")) 30 | -------------------------------------------------------------------------------- /Feature/Feature/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | //for opencv 6 | #include "cvhead.h" 7 | 8 | #include "Feature.h" 9 | #include "Harris/harris.h" 10 | 11 | using namespace cv; 12 | using namespace std; 13 | 14 | 15 | int main() 16 | { 17 | //LBP(); 18 | //test_cal_gradian(); 19 | //harris_main(); 20 | harris_main_CStyle(); 21 | waitKey(0); 22 | getchar(); 23 | return 0; 24 | } -------------------------------------------------------------------------------- /Filter/.vs/Filter/v14/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Filter/.vs/Filter/v14/.suo -------------------------------------------------------------------------------- /Filter/Filter.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Filter", "Filter\Filter.vcxproj", "{3A442FE6-3325-4F38-AE9F-11E2FD68BF32}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {3A442FE6-3325-4F38-AE9F-11E2FD68BF32}.Debug|x64.ActiveCfg = Debug|x64 17 | {3A442FE6-3325-4F38-AE9F-11E2FD68BF32}.Debug|x64.Build.0 = Debug|x64 18 | {3A442FE6-3325-4F38-AE9F-11E2FD68BF32}.Debug|x86.ActiveCfg = Debug|Win32 19 | {3A442FE6-3325-4F38-AE9F-11E2FD68BF32}.Debug|x86.Build.0 = Debug|Win32 20 | {3A442FE6-3325-4F38-AE9F-11E2FD68BF32}.Release|x64.ActiveCfg = Release|x64 21 | {3A442FE6-3325-4F38-AE9F-11E2FD68BF32}.Release|x64.Build.0 = Release|x64 22 | {3A442FE6-3325-4F38-AE9F-11E2FD68BF32}.Release|x86.ActiveCfg = Release|Win32 23 | {3A442FE6-3325-4F38-AE9F-11E2FD68BF32}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /Filter/Filter/Filter.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Filter/Filter/Filter.cpp -------------------------------------------------------------------------------- /Filter/Filter/Filter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Filter/Filter/Filter.h -------------------------------------------------------------------------------- /Filter/Filter/Filter.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | {3A442FE6-3325-4F38-AE9F-11E2FD68BF32} 23 | Win32Proj 24 | Filter 25 | 8.1 26 | 27 | 28 | 29 | Application 30 | true 31 | v140 32 | Unicode 33 | 34 | 35 | Application 36 | false 37 | v140 38 | true 39 | Unicode 40 | 41 | 42 | Application 43 | true 44 | v140 45 | Unicode 46 | 47 | 48 | Application 49 | false 50 | v140 51 | true 52 | Unicode 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | true 74 | $(ExecutablePath) 75 | C:\opencv\build\include;$(IncludePath) 76 | C:\opencv\build\x86\vc12\lib;$(LibraryPath) 77 | 78 | 79 | true 80 | 81 | 82 | false 83 | 84 | 85 | false 86 | 87 | 88 | 89 | NotUsing 90 | Level3 91 | Disabled 92 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 93 | true 94 | 95 | 96 | Console 97 | true 98 | 99 | 100 | 101 | 102 | Use 103 | Level3 104 | Disabled 105 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 106 | true 107 | 108 | 109 | Console 110 | true 111 | 112 | 113 | 114 | 115 | Level3 116 | Use 117 | MaxSpeed 118 | true 119 | true 120 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 121 | true 122 | 123 | 124 | Console 125 | true 126 | true 127 | true 128 | 129 | 130 | 131 | 132 | Level3 133 | Use 134 | MaxSpeed 135 | true 136 | true 137 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 138 | true 139 | 140 | 141 | Console 142 | true 143 | true 144 | true 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | -------------------------------------------------------------------------------- /Filter/Filter/Filter.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 头文件 23 | 24 | 25 | 头文件 26 | 27 | 28 | 29 | 30 | 源文件 31 | 32 | 33 | -------------------------------------------------------------------------------- /Filter/Filter/Filter.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Filter/Filter/cvhead.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | using namespace std; 5 | using namespace cv; 6 | 7 | #define CV_VERSION_ID CVAUX_STR(CV_MAJOR_VERSION) CVAUX_STR(CV_MINOR_VERSION) CVAUX_STR(CV_SUBMINOR_VERSION) 8 | 9 | #ifdef _DEBUG 10 | #define cvLIB(name) "opencv_" name CV_VERSION_ID "d" 11 | #else 12 | #define cvLIB(name) "opencv_" name CV_VERSION_ID 13 | #endif 14 | 15 | #pragma comment(lib,cvLIB("core")) 16 | #pragma comment(lib,cvLIB("highgui")) 17 | #pragma comment(lib,cvLIB("imgproc")) 18 | #pragma comment(lib,cvLIB("objdetect")) 19 | #pragma comment(lib,cvLIB("features2d")) 20 | #pragma comment(lib,cvLIB("nonfree")) 21 | #pragma comment(lib,cvLIB("legacy")) 22 | #pragma comment(lib,cvLIB("ml")) 23 | #pragma comment(lib,cvLIB("contrib")) 24 | #pragma comment(lib,cvLIB("video")) 25 | #pragma comment(lib,cvLIB("videostab")) 26 | #pragma comment(lib,cvLIB("ts")) 27 | #pragma comment(lib,cvLIB("stitching")) 28 | #pragma comment(lib,cvLIB("flann")) 29 | #pragma comment(lib,cvLIB("calib3d")) 30 | -------------------------------------------------------------------------------- /Filter/Photo/0957b11b1b10b3d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Filter/Photo/0957b11b1b10b3d.jpg -------------------------------------------------------------------------------- /Filter/Photo/sy_20091108143732390074.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Filter/Photo/sy_20091108143732390074.jpg -------------------------------------------------------------------------------- /Filter/Photo/th.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Filter/Photo/th.jpg -------------------------------------------------------------------------------- /Haar_Adaboost/.vs/Haar_Adaboost/v14/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Haar_Adaboost/.vs/Haar_Adaboost/v14/.suo -------------------------------------------------------------------------------- /Haar_Adaboost/Haar_Adaboost.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Haar_Adaboost", "Haar_Adaboost.vcxproj", "{2B9D7BC1-7993-4D79-A099-4A2C5C02A59A}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {2B9D7BC1-7993-4D79-A099-4A2C5C02A59A}.Debug|x64.ActiveCfg = Debug|x64 17 | {2B9D7BC1-7993-4D79-A099-4A2C5C02A59A}.Debug|x64.Build.0 = Debug|x64 18 | {2B9D7BC1-7993-4D79-A099-4A2C5C02A59A}.Debug|x86.ActiveCfg = Debug|Win32 19 | {2B9D7BC1-7993-4D79-A099-4A2C5C02A59A}.Debug|x86.Build.0 = Debug|Win32 20 | {2B9D7BC1-7993-4D79-A099-4A2C5C02A59A}.Release|x64.ActiveCfg = Release|x64 21 | {2B9D7BC1-7993-4D79-A099-4A2C5C02A59A}.Release|x64.Build.0 = Release|x64 22 | {2B9D7BC1-7993-4D79-A099-4A2C5C02A59A}.Release|x86.ActiveCfg = Release|Win32 23 | {2B9D7BC1-7993-4D79-A099-4A2C5C02A59A}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /Haar_Adaboost/Haar_Adaboost.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | {2B9D7BC1-7993-4D79-A099-4A2C5C02A59A} 23 | Win32Proj 24 | Haar_Adaboost 25 | 8.1 26 | 27 | 28 | 29 | Application 30 | true 31 | v140 32 | Unicode 33 | 34 | 35 | Application 36 | false 37 | v140 38 | true 39 | Unicode 40 | 41 | 42 | Application 43 | true 44 | v140 45 | Unicode 46 | 47 | 48 | Application 49 | false 50 | v140 51 | true 52 | Unicode 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | true 74 | C:\opencv\build\include;$(IncludePath) 75 | C:\opencv\build\x86\vc12\lib;$(LibraryPath) 76 | 77 | 78 | true 79 | 80 | 81 | false 82 | 83 | 84 | false 85 | 86 | 87 | 88 | 89 | 90 | Level3 91 | Disabled 92 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 93 | 94 | 95 | Console 96 | true 97 | 98 | 99 | 100 | 101 | 102 | 103 | Level3 104 | Disabled 105 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 106 | 107 | 108 | Console 109 | true 110 | 111 | 112 | 113 | 114 | Level3 115 | 116 | 117 | MaxSpeed 118 | true 119 | true 120 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 121 | 122 | 123 | Console 124 | true 125 | true 126 | true 127 | 128 | 129 | 130 | 131 | Level3 132 | 133 | 134 | MaxSpeed 135 | true 136 | true 137 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 138 | 139 | 140 | Console 141 | true 142 | true 143 | true 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | -------------------------------------------------------------------------------- /Haar_Adaboost/Haar_Adaboost.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 源文件 20 | 21 | 22 | -------------------------------------------------------------------------------- /Haar_Adaboost/cvhead.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | using namespace std; 5 | using namespace cv; 6 | 7 | #define CV_VERSION_ID CVAUX_STR(CV_MAJOR_VERSION) CVAUX_STR(CV_MINOR_VERSION) CVAUX_STR(CV_SUBMINOR_VERSION) 8 | 9 | #ifdef _DEBUG 10 | #define cvLIB(name) "opencv_" name CV_VERSION_ID "d" 11 | #else 12 | #define cvLIB(name) "opencv_" name CV_VERSION_ID 13 | #endif 14 | 15 | #pragma comment(lib,cvLIB("core")) 16 | #pragma comment(lib,cvLIB("highgui")) 17 | #pragma comment(lib,cvLIB("imgproc")) 18 | #pragma comment(lib,cvLIB("objdetect")) 19 | #pragma comment(lib,cvLIB("features2d")) 20 | #pragma comment(lib,cvLIB("nonfree")) 21 | #pragma comment(lib,cvLIB("legacy")) 22 | #pragma comment(lib,cvLIB("ml")) 23 | #pragma comment(lib,cvLIB("contrib")) 24 | #pragma comment(lib,cvLIB("video")) 25 | #pragma comment(lib,cvLIB("videostab")) 26 | #pragma comment(lib,cvLIB("ts")) 27 | #pragma comment(lib,cvLIB("stitching")) 28 | #pragma comment(lib,cvLIB("flann")) 29 | #pragma comment(lib,cvLIB("calib3d")) 30 | -------------------------------------------------------------------------------- /Haar_Adaboost/docs/Rapid_Object_Detection_using_a_Boosted_cascade_of_simple_features1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Haar_Adaboost/docs/Rapid_Object_Detection_using_a_Boosted_cascade_of_simple_features1.pdf -------------------------------------------------------------------------------- /Haar_Adaboost/docs/基于AdaBoost算法的人脸检测(北京大学,赵楠).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Haar_Adaboost/docs/基于AdaBoost算法的人脸检测(北京大学,赵楠).pdf -------------------------------------------------------------------------------- /Haar_Adaboost/test1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Haar_Adaboost/test1.zip -------------------------------------------------------------------------------- /Image_enhance/.vs/boost_test/v14/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Image_enhance/.vs/boost_test/v14/.suo -------------------------------------------------------------------------------- /Image_enhance/boost_test.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "boost_test", "boost_test\boost_test.vcxproj", "{A206AD3A-A8FF-428C-BD48-44FFB8091A9D}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {A206AD3A-A8FF-428C-BD48-44FFB8091A9D}.Debug|x64.ActiveCfg = Debug|x64 17 | {A206AD3A-A8FF-428C-BD48-44FFB8091A9D}.Debug|x64.Build.0 = Debug|x64 18 | {A206AD3A-A8FF-428C-BD48-44FFB8091A9D}.Debug|x86.ActiveCfg = Debug|Win32 19 | {A206AD3A-A8FF-428C-BD48-44FFB8091A9D}.Debug|x86.Build.0 = Debug|Win32 20 | {A206AD3A-A8FF-428C-BD48-44FFB8091A9D}.Release|x64.ActiveCfg = Release|x64 21 | {A206AD3A-A8FF-428C-BD48-44FFB8091A9D}.Release|x64.Build.0 = Release|x64 22 | {A206AD3A-A8FF-428C-BD48-44FFB8091A9D}.Release|x86.ActiveCfg = Release|Win32 23 | {A206AD3A-A8FF-428C-BD48-44FFB8091A9D}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /Image_enhance/boost_test/Vooya.lnk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Image_enhance/boost_test/Vooya.lnk -------------------------------------------------------------------------------- /Image_enhance/boost_test/boost_test.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 源文件 20 | 21 | 22 | 源文件 23 | 24 | 25 | 26 | 27 | 头文件 28 | 29 | 30 | 头文件 31 | 32 | 33 | -------------------------------------------------------------------------------- /Image_enhance/boost_test/cvhead.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | using namespace std; 5 | using namespace cv; 6 | 7 | #define CV_VERSION_ID CVAUX_STR(CV_MAJOR_VERSION) CVAUX_STR(CV_MINOR_VERSION) CVAUX_STR(CV_SUBMINOR_VERSION) 8 | 9 | #ifdef _DEBUG 10 | #define cvLIB(name) "opencv_" name CV_VERSION_ID "d" 11 | #else 12 | #define cvLIB(name) "opencv_" name CV_VERSION_ID 13 | #endif 14 | 15 | #pragma comment(lib,cvLIB("core")) 16 | #pragma comment(lib,cvLIB("highgui")) 17 | #pragma comment(lib,cvLIB("imgproc")) 18 | #pragma comment(lib,cvLIB("objdetect")) 19 | #pragma comment(lib,cvLIB("features2d")) 20 | #pragma comment(lib,cvLIB("nonfree")) 21 | #pragma comment(lib,cvLIB("legacy")) 22 | #pragma comment(lib,cvLIB("ml")) 23 | #pragma comment(lib,cvLIB("contrib")) 24 | #pragma comment(lib,cvLIB("video")) 25 | #pragma comment(lib,cvLIB("videostab")) 26 | #pragma comment(lib,cvLIB("ts")) 27 | #pragma comment(lib,cvLIB("stitching")) 28 | #pragma comment(lib,cvLIB("flann")) 29 | #pragma comment(lib,cvLIB("calib3d")) 30 | -------------------------------------------------------------------------------- /Image_enhance/boost_test/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Image_enhance/boost_test/main.cpp -------------------------------------------------------------------------------- /Image_enhance/boost_test/white_uyvy_process_in: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Image_enhance/boost_test/white_uyvy_process_in -------------------------------------------------------------------------------- /Image_enhance/boost_test/white_uyvy_process_out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Image_enhance/boost_test/white_uyvy_process_out -------------------------------------------------------------------------------- /Image_enhance/photo/HistQue_352x288.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Image_enhance/photo/HistQue_352x288.jpg -------------------------------------------------------------------------------- /Image_enhance/photo/gamma.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Image_enhance/photo/gamma.jpg -------------------------------------------------------------------------------- /Image_enhance/photo/gamma_gaitubao_com_352x288(1).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Image_enhance/photo/gamma_gaitubao_com_352x288(1).jpg -------------------------------------------------------------------------------- /Image_enhance/photo/gamma_gaitubao_com_352x288.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Image_enhance/photo/gamma_gaitubao_com_352x288.jpg -------------------------------------------------------------------------------- /Image_enhance/photo/gamma_gaitubao_com_352x288_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Image_enhance/photo/gamma_gaitubao_com_352x288_1.jpg -------------------------------------------------------------------------------- /Image_enhance/photo/gauss.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Image_enhance/photo/gauss.jpg -------------------------------------------------------------------------------- /Image_enhance/photo/gauss_gaitubao_com_352x288.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Image_enhance/photo/gauss_gaitubao_com_352x288.jpg -------------------------------------------------------------------------------- /Image_enhance/photo/下载.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Image_enhance/photo/下载.jpg -------------------------------------------------------------------------------- /Image_enhance/photo/下载_gaitubao_com_352x288.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Image_enhance/photo/下载_gaitubao_com_352x288.jpg -------------------------------------------------------------------------------- /Non-maximum_Suppression_5x5/2picture_out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Non-maximum_Suppression_5x5/2picture_out -------------------------------------------------------------------------------- /Non-maximum_Suppression_5x5/img8x5_out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Non-maximum_Suppression_5x5/img8x5_out -------------------------------------------------------------------------------- /Non-maximum_Suppression_5x5/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | void* pthread_test(void* t) 6 | { 7 | int * k = (int*)t; 8 | printf(" k =%d\n",*k); 9 | return NULL; 10 | } 11 | 12 | //5X5非极大值抑制使用的数组 13 | int ofs[25] = 14 | { -2*176-2, -2*176-1, -2*176, -2*176+1, -2*176+2, 15 | -176-2, -176-1, -176, -176+1, -176+2, 16 | -2, -1, 0, 1, 2, 17 | 176-2 , 176-1 , 176, 176+1, 176+2, 18 | 2*176-2, 2*176-1, 2*176, 2*176+1, 2*176+2 19 | }; 20 | 21 | //5X5非极大值抑制 22 | /* 23 | img:输入图片,格式为Y格式,大小为176*144 24 | w=176 h=144 25 | out:极大值抑制的输出,为二值图像 26 | */ 27 | void NO_MAX_EXPRESS_5X5(void* img, int w, int h,void* out) 28 | { 29 | 30 | int index = 0, i = 0, j = 0,k = 0; 31 | short max_val = 0; 32 | int TotalNum = 0; 33 | 34 | unsigned char* imgptr = (unsigned char*)img + ( w + 1) * 2; //5X5模板在图片边界处的宽度 35 | unsigned char* imgout = (unsigned char*)out; 36 | 37 | for (j = 0; j < w - 2; j ++) 38 | { 39 | for (i = 0; i < h - 2; i ++) 40 | { 41 | int max_ofs = 0; 42 | int offset = i * w + j; 43 | int num = 0; 44 | max_val = imgptr[offset]; 45 | 46 | for (k = 0; k < 25; k++) 47 | { 48 | if (max_val >= imgptr[offset + ofs[k]]) 49 | { 50 | //out[offset] = 255; 51 | num++; 52 | } 53 | } 54 | 55 | if(num == 25) 56 | { 57 | if(imgptr[offset] > 80) //阈值 58 | imgout[offset] = 255; 59 | } 60 | } 61 | 62 | } 63 | 64 | } 65 | 66 | #define WIDTH 176 67 | #define HIGHT 144 68 | #define FILENAME "2picture_out" 69 | 70 | int main() 71 | { 72 | FILE *fd = fopen(FILENAME,"rb+"); 73 | unsigned char img[WIDTH*HIGHT]; 74 | unsigned char out[WIDTH*HIGHT]; 75 | 76 | memset(img, 0, WIDTH*HIGHT); 77 | 78 | if(!fd) 79 | { 80 | printf("Open error\n"); 81 | return 0; 82 | } 83 | 84 | FILE *wfd = fopen("img8x5_out","wb+"); 85 | while( fread(img, 1, WIDTH*HIGHT, fd)) 86 | { 87 | memset(out, 0, WIDTH*HIGHT); 88 | NO_MAX_EXPRESS_5X5(img, WIDTH,HIGHT, out); 89 | fwrite(out, 1, WIDTH*HIGHT, wfd); 90 | } 91 | 92 | fclose(fd); 93 | fclose(wfd); 94 | 95 | fd = NULL; 96 | wfd = NULL; 97 | 98 | return 0; 99 | } 100 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Image_Process -------------------------------------------------------------------------------- /Tracke/.vs/Tracke/v14/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/.vs/Tracke/v14/.suo -------------------------------------------------------------------------------- /Tracke/Tracke.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Klt", "klt\Klt\Klt.vcxproj", "{466E641E-CE88-4EED-A37E-53B725C49BC3}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {466E641E-CE88-4EED-A37E-53B725C49BC3}.Debug|x64.ActiveCfg = Debug|Win32 17 | {466E641E-CE88-4EED-A37E-53B725C49BC3}.Debug|x86.ActiveCfg = Debug|Win32 18 | {466E641E-CE88-4EED-A37E-53B725C49BC3}.Debug|x86.Build.0 = Debug|Win32 19 | {466E641E-CE88-4EED-A37E-53B725C49BC3}.Release|x64.ActiveCfg = Release|Win32 20 | {466E641E-CE88-4EED-A37E-53B725C49BC3}.Release|x86.ActiveCfg = Release|Win32 21 | {466E641E-CE88-4EED-A37E-53B725C49BC3}.Release|x86.Build.0 = Release|Win32 22 | EndGlobalSection 23 | GlobalSection(SolutionProperties) = preSolution 24 | HideSolutionNode = FALSE 25 | EndGlobalSection 26 | EndGlobal 27 | -------------------------------------------------------------------------------- /Tracke/klt/Klt/.vs/Klt/v14/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/.vs/Klt/v14/.suo -------------------------------------------------------------------------------- /Tracke/klt/Klt/Debug/Klt.Build.CppClean.log: -------------------------------------------------------------------------------- 1 | d:\gitsource\image_process\tracke\klt\klt\debug\klt.pch 2 | d:\gitsource\image_process\tracke\klt\klt\debug\vc140.pdb 3 | d:\gitsource\image_process\tracke\klt\klt\debug\vc140.idb 4 | d:\gitsource\image_process\tracke\klt\klt\debug\stdafx.obj 5 | d:\gitsource\image_process\tracke\klt\klt\debug\convolve.obj 6 | d:\gitsource\image_process\tracke\klt\klt\debug\error.obj 7 | d:\gitsource\image_process\tracke\klt\klt\debug\example2.obj 8 | d:\gitsource\image_process\tracke\klt\klt\debug\example3.obj 9 | d:\gitsource\image_process\tracke\klt\klt\debug\example4.obj 10 | d:\gitsource\image_process\tracke\klt\klt\debug\example5.obj 11 | d:\gitsource\image_process\tracke\klt\klt\debug\klt.obj 12 | d:\gitsource\image_process\tracke\klt\klt\debug\klt_util.obj 13 | d:\gitsource\image_process\tracke\klt\klt\debug\pnmio.obj 14 | d:\gitsource\image_process\tracke\klt\klt\debug\pyramid.obj 15 | d:\gitsource\image_process\tracke\klt\klt\debug\selectgoodfeatures.obj 16 | d:\gitsource\image_process\tracke\klt\klt\debug\storefeatures.obj 17 | d:\gitsource\image_process\tracke\klt\klt\debug\trackfeatures.obj 18 | d:\gitsource\image_process\tracke\klt\klt\debug\writefeatures.obj 19 | d:\gitsource\image_process\tracke\klt\klt\debug\example1.obj 20 | d:\gitsource\image_process\tracke\klt\klt\debug\main.obj 21 | d:\gitsource\image_process\tracke\klt\klt\debug\klt.ilk 22 | d:\gitsource\image_process\tracke\klt\klt\debug\klt.exe 23 | d:\gitsource\image_process\tracke\klt\klt\debug\klt.pdb 24 | d:\gitsource\image_process\tracke\klt\klt\.\debug\klt.exe 25 | d:\gitsource\image_process\tracke\klt\klt\debug\klt.tlog\cl.read.1.tlog 26 | d:\gitsource\image_process\tracke\klt\klt\debug\klt.tlog\cl.write.1.tlog 27 | d:\gitsource\image_process\tracke\klt\klt\debug\klt.tlog\cl.command.1.tlog 28 | d:\gitsource\image_process\tracke\klt\klt\debug\klt.tlog\link.read.1.tlog 29 | d:\gitsource\image_process\tracke\klt\klt\debug\klt.tlog\link.write.1.tlog 30 | d:\gitsource\image_process\tracke\klt\klt\debug\klt.tlog\link.command.1.tlog 31 | -------------------------------------------------------------------------------- /Tracke/klt/Klt/Debug/Klt.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/Debug/Klt.exe -------------------------------------------------------------------------------- /Tracke/klt/Klt/Debug/Klt.ilk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/Debug/Klt.ilk -------------------------------------------------------------------------------- /Tracke/klt/Klt/Debug/Klt.pch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/Debug/Klt.pch -------------------------------------------------------------------------------- /Tracke/klt/Klt/Debug/Klt.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/Debug/Klt.pdb -------------------------------------------------------------------------------- /Tracke/klt/Klt/Debug/Klt.tlog/CL.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/Debug/Klt.tlog/CL.command.1.tlog -------------------------------------------------------------------------------- /Tracke/klt/Klt/Debug/Klt.tlog/CL.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/Debug/Klt.tlog/CL.read.1.tlog -------------------------------------------------------------------------------- /Tracke/klt/Klt/Debug/Klt.tlog/CL.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/Debug/Klt.tlog/CL.write.1.tlog -------------------------------------------------------------------------------- /Tracke/klt/Klt/Debug/Klt.tlog/Klt.lastbuildstate: -------------------------------------------------------------------------------- 1 | #TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=8.1 2 | Debug|Win32|D:\GitSource\Image_Process\Tracke\| 3 | -------------------------------------------------------------------------------- /Tracke/klt/Klt/Debug/Klt.tlog/link.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/Debug/Klt.tlog/link.command.1.tlog -------------------------------------------------------------------------------- /Tracke/klt/Klt/Debug/Klt.tlog/link.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/Debug/Klt.tlog/link.read.1.tlog -------------------------------------------------------------------------------- /Tracke/klt/Klt/Debug/Klt.tlog/link.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/Debug/Klt.tlog/link.write.1.tlog -------------------------------------------------------------------------------- /Tracke/klt/Klt/Debug/StdAfx.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/Debug/StdAfx.obj -------------------------------------------------------------------------------- /Tracke/klt/Klt/Debug/convolve.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/Debug/convolve.obj -------------------------------------------------------------------------------- /Tracke/klt/Klt/Debug/error.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/Debug/error.obj -------------------------------------------------------------------------------- /Tracke/klt/Klt/Debug/example1.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/Debug/example1.obj -------------------------------------------------------------------------------- /Tracke/klt/Klt/Debug/example2.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/Debug/example2.obj -------------------------------------------------------------------------------- /Tracke/klt/Klt/Debug/example3.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/Debug/example3.obj -------------------------------------------------------------------------------- /Tracke/klt/Klt/Debug/example4.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/Debug/example4.obj -------------------------------------------------------------------------------- /Tracke/klt/Klt/Debug/example5.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/Debug/example5.obj -------------------------------------------------------------------------------- /Tracke/klt/Klt/Debug/klt.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/Debug/klt.obj -------------------------------------------------------------------------------- /Tracke/klt/Klt/Debug/klt_util.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/Debug/klt_util.obj -------------------------------------------------------------------------------- /Tracke/klt/Klt/Debug/main.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/Debug/main.obj -------------------------------------------------------------------------------- /Tracke/klt/Klt/Debug/pnmio.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/Debug/pnmio.obj -------------------------------------------------------------------------------- /Tracke/klt/Klt/Debug/pyramid.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/Debug/pyramid.obj -------------------------------------------------------------------------------- /Tracke/klt/Klt/Debug/selectGoodFeatures.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/Debug/selectGoodFeatures.obj -------------------------------------------------------------------------------- /Tracke/klt/Klt/Debug/storeFeatures.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/Debug/storeFeatures.obj -------------------------------------------------------------------------------- /Tracke/klt/Klt/Debug/trackFeatures.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/Debug/trackFeatures.obj -------------------------------------------------------------------------------- /Tracke/klt/Klt/Debug/vc140.idb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/Debug/vc140.idb -------------------------------------------------------------------------------- /Tracke/klt/Klt/Debug/vc140.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/Debug/vc140.pdb -------------------------------------------------------------------------------- /Tracke/klt/Klt/Debug/writeFeatures.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/Debug/writeFeatures.obj -------------------------------------------------------------------------------- /Tracke/klt/Klt/Klt.VC.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/Klt.VC.db -------------------------------------------------------------------------------- /Tracke/klt/Klt/Klt.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="Klt" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) Console Application" 0x0103 6 | 7 | CFG=Klt - Win32 Debug 8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE, 9 | !MESSAGE use the Export Makefile command and run 10 | !MESSAGE 11 | !MESSAGE NMAKE /f "Klt.mak". 12 | !MESSAGE 13 | !MESSAGE You can specify a configuration when running NMAKE 14 | !MESSAGE by defining the macro CFG on the command line. For example: 15 | !MESSAGE 16 | !MESSAGE NMAKE /f "Klt.mak" CFG="Klt - Win32 Debug" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "Klt - Win32 Release" (based on "Win32 (x86) Console Application") 21 | !MESSAGE "Klt - Win32 Debug" (based on "Win32 (x86) Console Application") 22 | !MESSAGE 23 | 24 | # Begin Project 25 | # PROP AllowPerConfigDependencies 0 26 | # PROP Scc_ProjName "" 27 | # PROP Scc_LocalPath "" 28 | CPP=cl.exe 29 | RSC=rc.exe 30 | 31 | !IF "$(CFG)" == "Klt - Win32 Release" 32 | 33 | # PROP BASE Use_MFC 0 34 | # PROP BASE Use_Debug_Libraries 0 35 | # PROP BASE Output_Dir "Release" 36 | # PROP BASE Intermediate_Dir "Release" 37 | # PROP BASE Target_Dir "" 38 | # PROP Use_MFC 0 39 | # PROP Use_Debug_Libraries 0 40 | # PROP Output_Dir "Release" 41 | # PROP Intermediate_Dir "Release" 42 | # PROP Target_Dir "" 43 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c 44 | # ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c 45 | # SUBTRACT CPP /YX /Yc /Yu 46 | # ADD BASE RSC /l 0x409 /d "NDEBUG" 47 | # ADD RSC /l 0x409 /d "NDEBUG" 48 | BSC32=bscmake.exe 49 | # ADD BASE BSC32 /nologo 50 | # ADD BSC32 /nologo 51 | LINK32=link.exe 52 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 53 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 54 | 55 | !ELSEIF "$(CFG)" == "Klt - Win32 Debug" 56 | 57 | # PROP BASE Use_MFC 0 58 | # PROP BASE Use_Debug_Libraries 1 59 | # PROP BASE Output_Dir "Debug" 60 | # PROP BASE Intermediate_Dir "Debug" 61 | # PROP BASE Target_Dir "" 62 | # PROP Use_MFC 0 63 | # PROP Use_Debug_Libraries 1 64 | # PROP Output_Dir "Debug" 65 | # PROP Intermediate_Dir "Debug" 66 | # PROP Target_Dir "" 67 | # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c 68 | # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c 69 | # SUBTRACT CPP /YX /Yc /Yu 70 | # ADD BASE RSC /l 0x409 /d "_DEBUG" 71 | # ADD RSC /l 0x409 /d "_DEBUG" 72 | BSC32=bscmake.exe 73 | # ADD BASE BSC32 /nologo 74 | # ADD BSC32 /nologo 75 | LINK32=link.exe 76 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept 77 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept 78 | 79 | !ENDIF 80 | 81 | # Begin Target 82 | 83 | # Name "Klt - Win32 Release" 84 | # Name "Klt - Win32 Debug" 85 | # Begin Group "Source Files" 86 | 87 | # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" 88 | # Begin Source File 89 | 90 | SOURCE=.\convolve.c 91 | # End Source File 92 | # Begin Source File 93 | 94 | SOURCE=.\error.c 95 | # End Source File 96 | # Begin Source File 97 | 98 | SOURCE=.\example1.c 99 | # End Source File 100 | # Begin Source File 101 | 102 | SOURCE=.\example2.c 103 | # End Source File 104 | # Begin Source File 105 | 106 | SOURCE=.\example3.c 107 | # End Source File 108 | # Begin Source File 109 | 110 | SOURCE=.\example4.c 111 | # End Source File 112 | # Begin Source File 113 | 114 | SOURCE=.\example5.c 115 | # End Source File 116 | # Begin Source File 117 | 118 | SOURCE=.\klt.c 119 | # End Source File 120 | # Begin Source File 121 | 122 | SOURCE=.\klt_util.c 123 | # End Source File 124 | # Begin Source File 125 | 126 | SOURCE=.\main.cpp 127 | # End Source File 128 | # Begin Source File 129 | 130 | SOURCE=.\pnmio.c 131 | # End Source File 132 | # Begin Source File 133 | 134 | SOURCE=.\pyramid.c 135 | # End Source File 136 | # Begin Source File 137 | 138 | SOURCE=.\selectGoodFeatures.c 139 | # End Source File 140 | # Begin Source File 141 | 142 | SOURCE=.\StdAfx.cpp 143 | # ADD CPP /Yc"stdafx.h" 144 | # End Source File 145 | # Begin Source File 146 | 147 | SOURCE=.\storeFeatures.c 148 | # End Source File 149 | # Begin Source File 150 | 151 | SOURCE=.\trackFeatures.c 152 | # End Source File 153 | # Begin Source File 154 | 155 | SOURCE=.\writeFeatures.c 156 | # End Source File 157 | # End Group 158 | # Begin Group "Header Files" 159 | 160 | # PROP Default_Filter "h;hpp;hxx;hm;inl" 161 | # Begin Source File 162 | 163 | SOURCE=.\base.h 164 | # End Source File 165 | # Begin Source File 166 | 167 | SOURCE=.\convolve.h 168 | # End Source File 169 | # Begin Source File 170 | 171 | SOURCE=.\error.h 172 | # End Source File 173 | # Begin Source File 174 | 175 | SOURCE=.\klt.h 176 | # End Source File 177 | # Begin Source File 178 | 179 | SOURCE=.\klt_util.h 180 | # End Source File 181 | # Begin Source File 182 | 183 | SOURCE=.\KltExamples.h 184 | # End Source File 185 | # Begin Source File 186 | 187 | SOURCE=.\pnmio.h 188 | # End Source File 189 | # Begin Source File 190 | 191 | SOURCE=.\pyramid.h 192 | # End Source File 193 | # Begin Source File 194 | 195 | SOURCE=.\StdAfx.h 196 | # End Source File 197 | # End Group 198 | # Begin Group "Resource Files" 199 | 200 | # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" 201 | # End Group 202 | # Begin Source File 203 | 204 | SOURCE=.\ReadMe.txt 205 | # End Source File 206 | # End Target 207 | # End Project 208 | -------------------------------------------------------------------------------- /Tracke/klt/Klt/Klt.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "Klt"=.\Klt.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /Tracke/klt/Klt/Klt.opt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/Klt.opt -------------------------------------------------------------------------------- /Tracke/klt/Klt/Klt.plg: -------------------------------------------------------------------------------- 1 | 2 | 3 |
 4 | 

Build Log

5 |

6 | --------------------Configuration: Klt - Win32 Release-------------------- 7 |

8 |

Command Lines

9 | Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP102.tmp" with contents 10 | [ 11 | /nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fo"Release/" /Fd"Release/" /FD /c 12 | "C:\stb\klt\Klt\main.cpp" 13 | ] 14 | Creating command line "cl.exe @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP102.tmp" 15 | Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP103.tmp" with contents 16 | [ 17 | kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:"Release/Klt.pdb" /machine:I386 /out:"Release/Klt.exe" 18 | .\Release\StdAfx.obj 19 | .\Release\Klt.obj 20 | .\Release\convolve.obj 21 | .\Release\error.obj 22 | .\Release\example1.obj 23 | .\Release\example2.obj 24 | .\Release\example3.obj 25 | .\Release\example4.obj 26 | .\Release\example5.obj 27 | .\Release\klt_util.obj 28 | .\Release\pnmio.obj 29 | .\Release\pyramid.obj 30 | .\Release\selectGoodFeatures.obj 31 | .\Release\storeFeatures.obj 32 | .\Release\trackFeatures.obj 33 | .\Release\writeFeatures.obj 34 | .\Release\main.obj 35 | ] 36 | Creating command line "link.exe @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP103.tmp" 37 |

Output Window

38 | Compiling... 39 | main.cpp 40 | Linking... 41 | 42 | 43 | 44 |

Results

45 | Klt.exe - 0 error(s), 0 warning(s) 46 |
47 | 48 | 49 | -------------------------------------------------------------------------------- /Tracke/klt/Klt/Klt.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Klt", "Klt.vcxproj", "{466E641E-CE88-4EED-A37E-53B725C49BC3}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x86 = Debug|x86 11 | Release|x86 = Release|x86 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {466E641E-CE88-4EED-A37E-53B725C49BC3}.Debug|x86.ActiveCfg = Debug|Win32 15 | {466E641E-CE88-4EED-A37E-53B725C49BC3}.Debug|x86.Build.0 = Debug|Win32 16 | {466E641E-CE88-4EED-A37E-53B725C49BC3}.Release|x86.ActiveCfg = Release|Win32 17 | {466E641E-CE88-4EED-A37E-53B725C49BC3}.Release|x86.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /Tracke/klt/Klt/Klt.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {96a0e2ec-fdb9-4e17-badf-7883ee106ff2} 6 | cpp;c;cxx;rc;def;r;odl;idl;hpj;bat 7 | 8 | 9 | {a0c03f3d-7416-468d-b600-fe2d2ef3d277} 10 | h;hpp;hxx;hm;inl 11 | 12 | 13 | {c6e27b5e-492a-4693-b587-a45d23a52f78} 14 | ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | Source Files 38 | 39 | 40 | Source Files 41 | 42 | 43 | Source Files 44 | 45 | 46 | Source Files 47 | 48 | 49 | Source Files 50 | 51 | 52 | Source Files 53 | 54 | 55 | Source Files 56 | 57 | 58 | Source Files 59 | 60 | 61 | Source Files 62 | 63 | 64 | Source Files 65 | 66 | 67 | Source Files 68 | 69 | 70 | Source Files 71 | 72 | 73 | 74 | 75 | Header Files 76 | 77 | 78 | Header Files 79 | 80 | 81 | Header Files 82 | 83 | 84 | Header Files 85 | 86 | 87 | Header Files 88 | 89 | 90 | Header Files 91 | 92 | 93 | Header Files 94 | 95 | 96 | Header Files 97 | 98 | 99 | Header Files 100 | 101 | 102 | Header Files 103 | 104 | 105 | Header Files 106 | 107 | 108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /Tracke/klt/Klt/Klt.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Tracke/klt/Klt/KltExamples.h: -------------------------------------------------------------------------------- 1 | #ifndef __KLT_EXAMPLES__ 2 | #define __KLT_EXAMPLES__ 3 | 4 | // Declarations of all the examples 5 | #ifdef __cplusplus 6 | extern "C" 7 | { 8 | #endif 9 | void RunExample1(); 10 | void RunExample2(); 11 | void RunExample3(); 12 | void RunExample4(); 13 | void RunExample5(); 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | 19 | #endif -------------------------------------------------------------------------------- /Tracke/klt/Klt/ReadMe.txt: -------------------------------------------------------------------------------- 1 | ======================================================================== 2 | CONSOLE APPLICATION : Klt 3 | ======================================================================== 4 | 5 | 6 | AppWizard has created this Klt application for you. 7 | 8 | This file contains a summary of what you will find in each of the files that 9 | make up your Klt application. 10 | 11 | Klt.dsp 12 | This file (the project file) contains information at the project level and 13 | is used to build a single project or subproject. Other users can share the 14 | project (.dsp) file, but they should export the makefiles locally. 15 | 16 | Klt.cpp 17 | This is the main application source file. 18 | 19 | 20 | ///////////////////////////////////////////////////////////////////////////// 21 | Other standard files: 22 | 23 | StdAfx.h, StdAfx.cpp 24 | These files are used to build a precompiled header (PCH) file 25 | named Klt.pch and a precompiled types file named StdAfx.obj. 26 | 27 | 28 | ///////////////////////////////////////////////////////////////////////////// 29 | Other notes: 30 | 31 | AppWizard uses "TODO:" to indicate parts of the source code you 32 | should add to or customize. 33 | 34 | ///////////////////////////////////////////////////////////////////////////// 35 | -------------------------------------------------------------------------------- /Tracke/klt/Klt/StdAfx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // Klt.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /Tracke/klt/Klt/StdAfx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #if !defined(AFX_STDAFX_H__C5C6334A_70BB_4E9D_9594_C1D2EC698DF0__INCLUDED_) 7 | #define AFX_STDAFX_H__C5C6334A_70BB_4E9D_9594_C1D2EC698DF0__INCLUDED_ 8 | 9 | #if _MSC_VER > 1000 10 | #pragma once 11 | #endif // _MSC_VER > 1000 12 | 13 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 14 | 15 | #include 16 | 17 | // TODO: reference additional headers your program requires here 18 | 19 | //{{AFX_INSERT_LOCATION}} 20 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 21 | 22 | #endif // !defined(AFX_STDAFX_H__C5C6334A_70BB_4E9D_9594_C1D2EC698DF0__INCLUDED_) 23 | -------------------------------------------------------------------------------- /Tracke/klt/Klt/UpgradeLog.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/UpgradeLog.htm -------------------------------------------------------------------------------- /Tracke/klt/Klt/base.h: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | * base.h 3 | *********************************************************************/ 4 | 5 | #ifndef _BASE_H_ 6 | #define _BASE_H_ 7 | 8 | #ifndef uchar 9 | #define uchar unsigned char 10 | #endif 11 | 12 | #ifndef schar 13 | #define schar signed char 14 | #endif 15 | 16 | #ifndef uint 17 | #define uint unsigned int 18 | #endif 19 | 20 | #ifndef ushort 21 | #define ushort unsigned short 22 | #endif 23 | 24 | #ifndef ulong 25 | #define ulong unsigned long 26 | #endif 27 | 28 | //#define max(a,b) ((a) > (b) ? (a) : (b)) 29 | //#define min(a,b) ((a) < (b) ? (a) : (b)) 30 | #define max3(a,b,c) ((a) > (b) ? max((a),(c)) : max((b),(c))) 31 | #define min3(a,b,c) ((a) < (b) ? min((a),(c)) : min((b),(c))) 32 | 33 | #endif 34 | 35 | -------------------------------------------------------------------------------- /Tracke/klt/Klt/convolve.h: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | * convolve.h 3 | *********************************************************************/ 4 | 5 | #ifndef _CONVOLVE_H_ 6 | #define _CONVOLVE_H_ 7 | 8 | #include "klt.h" 9 | #include "klt_util.h" 10 | 11 | void _KLTToFloatImage( 12 | KLT_PixelType *img, 13 | int ncols, int nrows, 14 | _KLT_FloatImage floatimg); 15 | 16 | void _KLTComputeGradients( 17 | _KLT_FloatImage img, 18 | float sigma, 19 | _KLT_FloatImage gradx, 20 | _KLT_FloatImage grady); 21 | 22 | void _KLTGetKernelWidths( 23 | float sigma, 24 | int *gauss_width, 25 | int *gaussderiv_width); 26 | 27 | void _KLTComputeSmoothedImage( 28 | _KLT_FloatImage img, 29 | float sigma, 30 | _KLT_FloatImage smooth); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /Tracke/klt/Klt/cvhead.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | using namespace std; 5 | using namespace cv; 6 | 7 | #define CV_VERSION_ID CVAUX_STR(CV_MAJOR_VERSION) CVAUX_STR(CV_MINOR_VERSION) CVAUX_STR(CV_SUBMINOR_VERSION) 8 | 9 | #ifdef _DEBUG 10 | #define cvLIB(name) "opencv_" name CV_VERSION_ID "d" 11 | #else 12 | #define cvLIB(name) "opencv_" name CV_VERSION_ID 13 | #endif 14 | 15 | #pragma comment(lib,cvLIB("core")) 16 | #pragma comment(lib,cvLIB("highgui")) 17 | #pragma comment(lib,cvLIB("imgproc")) 18 | #pragma comment(lib,cvLIB("objdetect")) 19 | #pragma comment(lib,cvLIB("features2d")) 20 | #pragma comment(lib,cvLIB("nonfree")) 21 | #pragma comment(lib,cvLIB("legacy")) 22 | #pragma comment(lib,cvLIB("ml")) 23 | #pragma comment(lib,cvLIB("contrib")) 24 | #pragma comment(lib,cvLIB("video")) 25 | #pragma comment(lib,cvLIB("videostab")) 26 | #pragma comment(lib,cvLIB("ts")) 27 | #pragma comment(lib,cvLIB("stitching")) 28 | #pragma comment(lib,cvLIB("flann")) 29 | #pragma comment(lib,cvLIB("calib3d")) 30 | -------------------------------------------------------------------------------- /Tracke/klt/Klt/dos2unix.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #Need to install dos2unix and enconv software 3 | #使用:放到源码根目录然后执行,该脚本会将该目录下(包括子目录)所有.cpp/.c/.h文件转化为UNIX格式,文件编码转化为UTF-8 无BOM格式,TAB键转化为4个空格 4 | #最后会输出一个log文件,该文件记录的是文件编码被转化的文件列表 5 | # 6 | 7 | 8 | echo "\033[31m Begin dos2unix convert process....\033[0m" 9 | find . -regex '.*\.cpp\|.*\.h\|.*\.c\|' | xargs unix2dos -q # dos to unix quiet mode 10 | 11 | FILE=$(find . -regex '.*\.cpp\|.*\.h\|.*\.c\|') 12 | 13 | for filename in $FILE 14 | do 15 | sed -i 's/\t/ /g' $filename # tab to space 16 | done 17 | echo "\033[31m End dos2unix convert process.\t You can see the result in ChangedCodeFileList.log \033[0m" 18 | 19 | -------------------------------------------------------------------------------- /Tracke/klt/Klt/draw_img.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/draw_img.cpp -------------------------------------------------------------------------------- /Tracke/klt/Klt/draw_img.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/draw_img.h -------------------------------------------------------------------------------- /Tracke/klt/Klt/error.c: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | * error.c 3 | * 4 | * Error and warning messages, and system commands. 5 | *********************************************************************/ 6 | 7 | 8 | /* Standard includes */ 9 | #include 10 | #include 11 | #include 12 | 13 | 14 | /********************************************************************* 15 | * KLTError 16 | * 17 | * Prints an error message and dies. 18 | * 19 | * INPUTS 20 | * exactly like printf 21 | */ 22 | 23 | void KLTError(char *fmt, ...) 24 | { 25 | va_list args; 26 | 27 | va_start(args, fmt); 28 | fprintf(stderr, "KLT Error: "); 29 | vfprintf(stderr, fmt, args); 30 | fprintf(stderr, "\n"); 31 | va_end(args); 32 | exit(1); 33 | } 34 | 35 | 36 | /********************************************************************* 37 | * KLTWarning 38 | * 39 | * Prints a warning message. 40 | * 41 | * INPUTS 42 | * exactly like printf 43 | */ 44 | 45 | void KLTWarning(char *fmt, ...) 46 | { 47 | va_list args; 48 | 49 | va_start(args, fmt); 50 | fprintf(stderr, "KLT Warning: "); 51 | vfprintf(stderr, fmt, args); 52 | fprintf(stderr, "\n"); 53 | fflush(stderr); 54 | va_end(args); 55 | } 56 | 57 | -------------------------------------------------------------------------------- /Tracke/klt/Klt/error.h: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | * error.h 3 | *********************************************************************/ 4 | 5 | #ifndef _ERROR_H_ 6 | #define _ERROR_H_ 7 | 8 | #include 9 | #include 10 | 11 | void KLTError(char *fmt, ...); 12 | void KLTWarning(char *fmt, ...); 13 | 14 | #endif 15 | 16 | -------------------------------------------------------------------------------- /Tracke/klt/Klt/example1.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/example1.cpp -------------------------------------------------------------------------------- /Tracke/klt/Klt/example2.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Finds the 100 best features in an image, tracks these 3 | features to the next image, and replaces the lost features with new 4 | features in the second image. Saves the feature 5 | locations (before and after tracking) to text files and to PPM files. 6 | **********************************************************************/ 7 | 8 | #include "pnmio.h" 9 | #include "klt.h" 10 | 11 | void RunExample2() 12 | { 13 | unsigned char *img1, *img2; 14 | KLT_TrackingContext tc; 15 | KLT_FeatureList fl; 16 | int nFeatures = 100; 17 | int ncols, nrows; 18 | 19 | tc = KLTCreateTrackingContext(); 20 | fl = KLTCreateFeatureList(nFeatures); 21 | 22 | img1 = pgmReadFile("img0.pgm", NULL, &ncols, &nrows); 23 | img2 = pgmReadFile("img1.pgm", NULL, &ncols, &nrows); 24 | 25 | KLTSelectGoodFeatures(tc, img1, ncols, nrows, fl); 26 | 27 | KLTWriteFeatureListToPPM(fl, img1, ncols, nrows, "feat1.ppm"); 28 | KLTWriteFeatureList(fl, "feat1.txt", "%3d"); 29 | 30 | KLTTrackFeatures(tc, img1, img2, ncols, nrows, fl); 31 | KLTReplaceLostFeatures(tc, img2, ncols, nrows, fl); 32 | 33 | KLTWriteFeatureListToPPM(fl, img2, ncols, nrows, "feat2.ppm"); 34 | KLTWriteFeatureList(fl, "feat2.txt", "%3d"); 35 | } 36 | 37 | -------------------------------------------------------------------------------- /Tracke/klt/Klt/example2.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/example2.cpp -------------------------------------------------------------------------------- /Tracke/klt/Klt/example3.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Finds the 150 best features in an image and tracks them through the 3 | next two images. The sequential mode is set in order to speed 4 | processing. The features are stored in a feature table, which is then 5 | saved to a text file; each feature list is also written to a PPM file. 6 | **********************************************************************/ 7 | 8 | #include 9 | #include 10 | #include "pnmio.h" 11 | #include "klt.h" 12 | 13 | /* #define REPLACE */ 14 | 15 | void RunExample3() 16 | { 17 | unsigned char *img1, *img2; 18 | char fnamein[100], fnameout[100]; 19 | KLT_TrackingContext tc; 20 | KLT_FeatureList fl; 21 | KLT_FeatureTable ft; 22 | int nFeatures = 150, nFrames = 3; 23 | int ncols, nrows; 24 | int i; 25 | 26 | tc = KLTCreateTrackingContext(); 27 | fl = KLTCreateFeatureList(nFeatures); 28 | ft = KLTCreateFeatureTable(nFrames, nFeatures); 29 | tc->sequentialMode = TRUE; 30 | 31 | img1 = pgmReadFile("img0.pgm", NULL, &ncols, &nrows); 32 | img2 = (unsigned char *) malloc(ncols*nrows*sizeof(unsigned char)); 33 | 34 | KLTSelectGoodFeatures(tc, img1, ncols, nrows, fl); 35 | KLTStoreFeatureList(fl, ft, 0); 36 | KLTWriteFeatureListToPPM(fl, img1, ncols, nrows, "feat0.ppm"); 37 | 38 | for (i = 1 ; i < nFrames ; i++) { 39 | sprintf(fnamein, "img%d.pgm", i); 40 | pgmReadFile(fnamein, img2, &ncols, &nrows); 41 | KLTTrackFeatures(tc, img1, img2, ncols, nrows, fl); 42 | #ifdef REPLACE 43 | KLTReplaceLostFeatures(tc, img2, ncols, nrows, fl); 44 | #endif 45 | KLTStoreFeatureList(fl, ft, i); 46 | sprintf(fnameout, "feat%d.ppm", i); 47 | KLTWriteFeatureListToPPM(fl, img2, ncols, nrows, fnameout); 48 | } 49 | KLTWriteFeatureTable(ft, "features.txt", "%5.1f"); 50 | KLTWriteFeatureTable(ft, "features.ft", NULL); 51 | } 52 | 53 | -------------------------------------------------------------------------------- /Tracke/klt/Klt/example4.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Reads the feature table from "features.txt", copies the features from 3 | the second frame to those of the third frame, writes the features to 4 | "feat2.txt", and writes the new feature table to "ft2.txt". Then the 5 | eighth feature is overwritten with the fifth feature, and the resulting 6 | table is saved to "ft3.txt". 7 | **********************************************************************/ 8 | 9 | #include 10 | #include "klt.h" 11 | 12 | void RunExample4() 13 | { 14 | KLT_FeatureList fl; 15 | KLT_FeatureHistory fh; 16 | KLT_FeatureTable ft; 17 | int i; 18 | 19 | ft = KLTReadFeatureTable(NULL, "features.txt"); 20 | fl = KLTCreateFeatureList(ft->nFeatures); 21 | KLTExtractFeatureList(fl, ft, 1); 22 | KLTWriteFeatureList(fl, "feat1.txt", "%3d"); 23 | KLTReadFeatureList(fl, "feat1.txt"); 24 | KLTStoreFeatureList(fl, ft, 2); 25 | KLTWriteFeatureTable(ft, "ft2.txt", "%3d"); 26 | 27 | fh = KLTCreateFeatureHistory(ft->nFrames); 28 | KLTExtractFeatureHistory(fh, ft, 5); 29 | 30 | printf("The feature history of feature number 5:\n\n"); 31 | for (i = 0 ; i < fh->nFrames ; i++) 32 | printf("%d: (%5.1f,%5.1f) = %d\n", 33 | i, fh->feature[i]->x, fh->feature[i]->y, 34 | fh->feature[i]->val); 35 | 36 | KLTStoreFeatureHistory(fh, ft, 8); 37 | KLTWriteFeatureTable(ft, "ft3.txt", "%6.1f"); 38 | } 39 | 40 | -------------------------------------------------------------------------------- /Tracke/klt/Klt/example5.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | Demonstrates manually tweaking the tracking context parameters. 3 | **********************************************************************/ 4 | 5 | #include "pnmio.h" 6 | #include "klt.h" 7 | 8 | void RunExample5() 9 | { 10 | unsigned char *img1, *img2; 11 | KLT_TrackingContext tc; 12 | KLT_FeatureList fl; 13 | int nFeatures = 100; 14 | int ncols, nrows; 15 | 16 | tc = KLTCreateTrackingContext(); 17 | tc->mindist = 20; 18 | tc->window_width = 9; 19 | tc->window_height = 9; 20 | KLTChangeTCPyramid(tc, 15); 21 | KLTUpdateTCBorder(tc); 22 | fl = KLTCreateFeatureList(nFeatures); 23 | 24 | img1 = pgmReadFile("img0.pgm", NULL, &ncols, &nrows); 25 | img2 = pgmReadFile("img2.pgm", NULL, &ncols, &nrows); 26 | 27 | KLTSelectGoodFeatures(tc, img1, ncols, nrows, fl); 28 | 29 | KLTWriteFeatureListToPPM(fl, img1, ncols, nrows, "feat1b.ppm"); 30 | 31 | KLTTrackFeatures(tc, img1, img2, ncols, nrows, fl); 32 | 33 | KLTWriteFeatureListToPPM(fl, img2, ncols, nrows, "feat2b.ppm"); 34 | } 35 | 36 | -------------------------------------------------------------------------------- /Tracke/klt/Klt/klt.h: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | * klt.h 3 | * 4 | * Kanade-Lucas-Tomasi tracker 5 | *********************************************************************/ 6 | 7 | #ifndef _KLT_H_ 8 | #define _KLT_H_ 9 | 10 | typedef float KLT_locType; 11 | typedef unsigned char KLT_PixelType; 12 | 13 | #define KLT_BOOL int 14 | 15 | #ifndef TRUE 16 | #define TRUE 1 17 | #define FALSE 0 18 | #endif 19 | 20 | #ifndef NULL 21 | #define NULL 0 22 | #endif 23 | 24 | #define KLT_TRACKED (0) // 跟踪成功 25 | #define KLT_NOT_FOUND (-1) 26 | #define KLT_SMALL_DET (-2) //feature is lost 27 | #define KLT_MAX_ITERATIONS (-3) //tracking stopped because iterations timed out 28 | #define KLT_OOB (-4) //跟踪出错 29 | #define KLT_LARGE_RESIDUE (-5) //残差过大 30 | 31 | /******************* 32 | * Structures 33 | */ 34 | 35 | typedef struct { 36 | /* Available to user */ 37 | int mindist; /* min distance between selected features */ 38 | int window_width, window_height; ////*特征窗口尺寸*/ 39 | KLT_BOOL sequentialMode; /* whether to save most recent image to save time */ 40 | /* can set to TRUE manually, but don't set to */ 41 | /* FALSE manually */ 42 | KLT_BOOL smoothBeforeSelecting; ////* whether to smooth image before 特征点筛选前平滑去噪*/ 43 | /* selecting features */ 44 | KLT_BOOL writeInternalImages; ////* whether to write internal images 写积分函数*/ 45 | 46 | /* Available, but hopefully can ignore */ 47 | int min_eigenvalue; /* smallest eigenvalue allowed for selecting */ 48 | float min_determinant; ////* min determinant for declaring tracking failure 跟踪失败的最小..[待定]*/ 49 | float min_displacement; /* th for stopping tracking when pixel changes little */ 50 | int max_iterations; /* th for stopping tracking when too many iterations */ 51 | float max_residue; /* th for stopping tracking when residue is large */ 52 | float grad_sigma; ///*计算梯度的高斯核因子*/ 53 | float smooth_sigma_fact; ////*平滑滤波高斯核因子*/ 54 | float pyramid_sigma_fact; ////*金字塔高斯核因子*/ 55 | int nSkippedPixels; /// /* # of pixels skipped when finding features 用户加速计算*/ 56 | int borderx; /// /* border in which features will not be found */ 57 | int bordery; 58 | int nPyramidLevels; ////* computed from search_ranges*/ 59 | int subsampling; ////* 金字塔采样尺寸 " */ 60 | 61 | /* User must not touch these */ 62 | void *pyramid_last; 63 | void *pyramid_last_gradx; 64 | void *pyramid_last_grady; 65 | } KLT_TrackingContextRec, *KLT_TrackingContext; 66 | 67 | 68 | typedef struct { 69 | KLT_locType x; 70 | KLT_locType y; 71 | int val; 72 | /* will be needed when we do affine */ 73 | /* int window_width, window_height; */ 74 | /* uchar *img; */ 75 | } KLT_FeatureRec, *KLT_Feature; 76 | 77 | typedef struct { 78 | int nFeatures; 79 | KLT_Feature *feature; 80 | } KLT_FeatureListRec, *KLT_FeatureList; 81 | 82 | typedef struct { 83 | int nFrames; 84 | KLT_Feature *feature; 85 | } KLT_FeatureHistoryRec, *KLT_FeatureHistory; 86 | 87 | typedef struct { 88 | int nFrames; 89 | int nFeatures; 90 | KLT_Feature **feature; 91 | } KLT_FeatureTableRec, *KLT_FeatureTable; 92 | 93 | 94 | 95 | /******************* 96 | * Functions 97 | */ 98 | #ifdef __cplusplus 99 | extern "C" 100 | { 101 | #endif 102 | /* Create */ 103 | KLT_TrackingContext KLTCreateTrackingContext(void); 104 | KLT_FeatureList KLTCreateFeatureList( 105 | int nFeatures); 106 | KLT_FeatureHistory KLTCreateFeatureHistory( 107 | int nFrames); 108 | KLT_FeatureTable KLTCreateFeatureTable( 109 | int nFrames, 110 | int nFeatures); 111 | 112 | /* Free */ 113 | void KLTFreeTrackingContext( 114 | KLT_TrackingContext tc); 115 | void KLTFreeFeatureList( 116 | KLT_FeatureList fl); 117 | void KLTFreeFeatureHistory( 118 | KLT_FeatureHistory fh); 119 | void KLTFreeFeatureTable( 120 | KLT_FeatureTable ft); 121 | 122 | /* Processing */ 123 | void KLTSelectGoodFeatures( 124 | KLT_TrackingContext tc, 125 | KLT_PixelType *img, 126 | int ncols, 127 | int nrows, 128 | KLT_FeatureList fl); 129 | void KLTTrackFeatures( 130 | KLT_TrackingContext tc, 131 | KLT_PixelType *img1, 132 | KLT_PixelType *img2, 133 | int ncols, 134 | int nrows, 135 | KLT_FeatureList fl); 136 | void KLTReplaceLostFeatures( 137 | KLT_TrackingContext tc, 138 | KLT_PixelType *img, 139 | int ncols, 140 | int nrows, 141 | KLT_FeatureList fl); 142 | 143 | /* Utilities */ 144 | int KLTCountRemainingFeatures( 145 | KLT_FeatureList fl); 146 | void KLTPrintTrackingContext( 147 | KLT_TrackingContext tc); 148 | void KLTChangeTCPyramid( 149 | KLT_TrackingContext tc, 150 | int search_range); 151 | void KLTUpdateTCBorder( 152 | KLT_TrackingContext tc); 153 | void KLTStopSequentialMode( 154 | KLT_TrackingContext tc); 155 | void KLTSetVerbosity( 156 | int verbosity); 157 | float _KLTComputeSmoothSigma( 158 | KLT_TrackingContext tc); 159 | 160 | /* Storing/Extracting Features */ 161 | void KLTStoreFeatureList( 162 | KLT_FeatureList fl, 163 | KLT_FeatureTable ft, 164 | int frame); 165 | void KLTExtractFeatureList( 166 | KLT_FeatureList fl, 167 | KLT_FeatureTable ft, 168 | int frame); 169 | void KLTStoreFeatureHistory( 170 | KLT_FeatureHistory fh, 171 | KLT_FeatureTable ft, 172 | int feat); 173 | void KLTExtractFeatureHistory( 174 | KLT_FeatureHistory fh, 175 | KLT_FeatureTable ft, 176 | int feat); 177 | 178 | /* Writing/Reading */ 179 | void KLTWriteFeatureListToPPM( 180 | KLT_FeatureList fl, 181 | KLT_PixelType *greyimg, 182 | int ncols, 183 | int nrows, 184 | char *filename); 185 | void KLTWriteFeatureList( 186 | KLT_FeatureList fl, 187 | char *filename, 188 | char *fmt); 189 | void KLTWriteFeatureHistory( 190 | KLT_FeatureHistory fh, 191 | char *filename, 192 | char *fmt); 193 | void KLTWriteFeatureTable( 194 | KLT_FeatureTable ft, 195 | char *filename, 196 | char *fmt); 197 | KLT_FeatureList KLTReadFeatureList( 198 | KLT_FeatureList fl, 199 | char *filename); 200 | KLT_FeatureHistory KLTReadFeatureHistory( 201 | KLT_FeatureHistory fh, 202 | char *filename); 203 | KLT_FeatureTable KLTReadFeatureTable( 204 | KLT_FeatureTable ft, 205 | char *filename); 206 | 207 | #ifdef __cplusplus 208 | } 209 | #endif 210 | 211 | #endif 212 | 213 | 214 | 215 | 216 | 217 | 218 | -------------------------------------------------------------------------------- /Tracke/klt/Klt/klt_util.c: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | * klt_util.c 3 | *********************************************************************/ 4 | 5 | /* Standard includes */ 6 | #include 7 | #include /* malloc() */ 8 | 9 | /* Our includes */ 10 | #include "base.h" 11 | #include "error.h" 12 | #include "pnmio.h" 13 | #include "klt.h" 14 | #include "klt_util.h" 15 | 16 | 17 | /*********************************************************************/ 18 | 19 | float _KLTComputeSmoothSigma( 20 | KLT_TrackingContext tc) 21 | { 22 | return (tc->smooth_sigma_fact * max(tc->window_width, tc->window_height)); 23 | } 24 | 25 | 26 | /********************************************************************* 27 | * _KLTCreateFloatImage 28 | */ 29 | 30 | _KLT_FloatImage _KLTCreateFloatImage( 31 | int ncols, 32 | int nrows) 33 | { 34 | _KLT_FloatImage floatimg; 35 | int nbytes = sizeof(_KLT_FloatImageRec) + 36 | ncols * nrows * sizeof(float); 37 | 38 | floatimg = (_KLT_FloatImage) malloc(nbytes); 39 | if (floatimg == NULL) 40 | KLTError("(_KLTCreateFloatImage) Out of memory"); 41 | floatimg->ncols = ncols; 42 | floatimg->nrows = nrows; 43 | floatimg->data = (float *) (floatimg + 1); 44 | 45 | return(floatimg); 46 | } 47 | 48 | 49 | /********************************************************************* 50 | * _KLTFreeFloatImage 51 | */ 52 | 53 | void _KLTFreeFloatImage( 54 | _KLT_FloatImage floatimg) 55 | { 56 | free(floatimg); 57 | } 58 | 59 | 60 | /********************************************************************* 61 | * _KLTPrintSubFloatImage 62 | */ 63 | 64 | void _KLTPrintSubFloatImage( 65 | _KLT_FloatImage floatimg, 66 | int x0, int y0, 67 | int width, int height) 68 | { 69 | int ncols = floatimg->ncols; 70 | int offset; 71 | int i, j; 72 | 73 | assert(x0 >= 0); 74 | assert(y0 >= 0); 75 | assert(x0 + width <= ncols); 76 | assert(y0 + height <= floatimg->nrows); 77 | 78 | fprintf(stderr, "\n"); 79 | for (j = 0 ; j < height ; j++) { 80 | for (i = 0 ; i < width ; i++) { 81 | offset = (j+y0)*ncols + (i+x0); 82 | fprintf(stderr, "%6.2f ", *(floatimg->data + offset)); 83 | } 84 | fprintf(stderr, "\n"); 85 | } 86 | fprintf(stderr, "\n"); 87 | } 88 | 89 | 90 | /********************************************************************* 91 | * _KLTWriteFloatImageToPGM 92 | */ 93 | 94 | void _KLTWriteFloatImageToPGM( 95 | _KLT_FloatImage img, 96 | char *filename) 97 | { 98 | int npixs = img->ncols * img->nrows; 99 | float mmax = -999999.9f, mmin = 999999.9f; 100 | float fact; 101 | float *ptr; 102 | uchar *byteimg, *ptrout; 103 | int i; 104 | 105 | /* Calculate minimum and maximum values of float image */ 106 | ptr = img->data; 107 | for (i = 0 ; i < npixs ; i++) { 108 | mmax = max(mmax, *ptr); 109 | mmin = min(mmin, *ptr); 110 | ptr++; 111 | } 112 | 113 | /* Allocate memory to hold converted image */ 114 | byteimg = (uchar *) malloc(npixs * sizeof(uchar)); 115 | 116 | /* Convert image from float to uchar */ 117 | fact = (float) (255.0 / (mmax-mmin)); 118 | ptr = img->data; 119 | ptrout = byteimg; 120 | for (i = 0 ; i < npixs ; i++) { 121 | *ptrout++ = (uchar) ((*ptr++ - mmin) * fact); 122 | } 123 | 124 | /* Write uchar image to PGM */ 125 | pgmWriteFile(filename, byteimg, img->ncols, img->nrows); 126 | 127 | /* Free memory */ 128 | free(byteimg); 129 | } 130 | 131 | -------------------------------------------------------------------------------- /Tracke/klt/Klt/klt_util.h: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | * klt_util.h 3 | *********************************************************************/ 4 | 5 | #ifndef _KLT_UTIL_H_ 6 | #define _KLT_UTIL_H_ 7 | 8 | typedef struct { 9 | int ncols; 10 | int nrows; 11 | float *data; 12 | } _KLT_FloatImageRec, *_KLT_FloatImage; 13 | 14 | _KLT_FloatImage _KLTCreateFloatImage( 15 | int ncols, 16 | int nrows); 17 | 18 | void _KLTFreeFloatImage( 19 | _KLT_FloatImage); 20 | 21 | void _KLTPrintSubFloatImage( 22 | _KLT_FloatImage floatimg, 23 | int x0, int y0, 24 | int width, int height); 25 | 26 | void _KLTWriteFloatImageToPGM( 27 | _KLT_FloatImage img, 28 | char *filename); 29 | 30 | #endif 31 | 32 | 33 | -------------------------------------------------------------------------------- /Tracke/klt/Klt/main.cpp: -------------------------------------------------------------------------------- 1 | // main.cpp : Defines the entry point for the console application. 2 | // 3 | 4 | #include // printf 5 | #include "KltExamples.h" 6 | 7 | int main(int argc, char* argv[]) 8 | { 9 | // select which example to run here 10 | const int which = 2; 11 | 12 | // run the appropriate example 13 | switch (which) { 14 | case 1: RunExample1(); break; 15 | case 2: RunExample2(); break; 16 | case 3: RunExample3(); break; 17 | case 4: RunExample4(); break; // Note: example4 reads output from example 3 18 | case 5: RunExample5(); break; 19 | default: printf("There is no example number %d\n", which); 20 | } 21 | 22 | getchar(); 23 | return 0; 24 | } 25 | 26 | -------------------------------------------------------------------------------- /Tracke/klt/Klt/pnmio.h: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | * pnmio.h 3 | *********************************************************************/ 4 | 5 | #ifndef _PNMIO_H_ 6 | #define _PNMIO_H_ 7 | 8 | #include 9 | 10 | /********** 11 | * With pgmReadFile and pgmRead, setting img to NULL causes memory 12 | * to be allocated 13 | */ 14 | 15 | /********** 16 | * used for reading from/writing to files 17 | */ 18 | #ifdef __cplusplus 19 | extern "C" 20 | { 21 | #endif 22 | 23 | unsigned char* pgmReadFile( 24 | char *fname, 25 | unsigned char *img, 26 | int *ncols, 27 | int *nrows); 28 | void pgmWriteFile( 29 | char *fname, 30 | unsigned char *img, 31 | int ncols, 32 | int nrows); 33 | void ppmWriteFileRGB( 34 | char *fname, 35 | unsigned char *redimg, 36 | unsigned char *greenimg, 37 | unsigned char *blueimg, 38 | int ncols, 39 | int nrows); 40 | 41 | /********** 42 | * used for communicating with stdin and stdout 43 | */ 44 | unsigned char* pgmRead( 45 | FILE *fp, 46 | unsigned char *img, 47 | int *ncols, int *nrows); 48 | void pgmWrite( 49 | FILE *fp, 50 | unsigned char *img, 51 | int ncols, 52 | int nrows); 53 | void ppmWrite( 54 | FILE *fp, 55 | unsigned char *redimg, 56 | unsigned char *greenimg, 57 | unsigned char *blueimg, 58 | int ncols, 59 | int nrows); 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /Tracke/klt/Klt/pyramid.c: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | * pyramid.c 3 | * 4 | *********************************************************************/ 5 | 6 | /* Standard includes */ 7 | #include 8 | #include /* malloc() ? */ 9 | #include /* memset() ? */ 10 | #include /* */ 11 | 12 | /* Our includes */ 13 | #include "base.h" 14 | #include "error.h" 15 | #include "convolve.h" /* for computing pyramid */ 16 | #include "pyramid.h" 17 | 18 | 19 | /********************************************************************* 20 | * 21 | */ 22 | 23 | _KLT_Pyramid _KLTCreatePyramid( 24 | int ncols, 25 | int nrows, 26 | int subsampling, 27 | int nlevels) 28 | { 29 | _KLT_Pyramid pyramid; 30 | int nbytes = sizeof(_KLT_PyramidRec) + 31 | nlevels * sizeof(_KLT_FloatImage *) + 32 | nlevels * sizeof(int) + 33 | nlevels * sizeof(int); 34 | int i; 35 | 36 | if (subsampling != 2 && subsampling != 4 && 37 | subsampling != 8 && subsampling != 16 && subsampling != 32) 38 | KLTError("(_KLTCreatePyramid) Pyramid's subsampling must " 39 | "be either 2, 4, 8, 16, or 32"); 40 | 41 | 42 | /* Allocate memory for structure and set parameters */ 43 | pyramid = (_KLT_Pyramid) malloc(nbytes); 44 | if (pyramid == NULL) 45 | KLTError("(_KLTCreatePyramid) Out of memory"); 46 | 47 | /* Set parameters */ 48 | pyramid->subsampling = subsampling; 49 | pyramid->nLevels = nlevels; 50 | pyramid->img = (_KLT_FloatImage *) (pyramid + 1); 51 | pyramid->ncols = (int *) (pyramid->img + nlevels); 52 | pyramid->nrows = (int *) (pyramid->ncols + nlevels); 53 | 54 | /* Allocate memory for each level of pyramid and assign pointers */ 55 | for (i = 0 ; i < nlevels ; i++) { 56 | pyramid->img[i] = _KLTCreateFloatImage(ncols, nrows); 57 | pyramid->ncols[i] = ncols; pyramid->nrows[i] = nrows; 58 | ncols /= subsampling; nrows /= subsampling; 59 | } 60 | 61 | return pyramid; 62 | } 63 | 64 | 65 | /********************************************************************* 66 | * 67 | */ 68 | 69 | void _KLTFreePyramid( 70 | _KLT_Pyramid pyramid) 71 | { 72 | int i; 73 | 74 | /* Free images */ 75 | for (i = 0 ; i < pyramid->nLevels ; i++) 76 | _KLTFreeFloatImage(pyramid->img[i]); 77 | 78 | /* Free structure */ 79 | free(pyramid); 80 | } 81 | 82 | 83 | /********************************************************************* 84 | * 85 | */ 86 | 87 | void _KLTComputePyramid( 88 | _KLT_FloatImage img, 89 | _KLT_Pyramid pyramid, 90 | float sigma_fact) 91 | { 92 | _KLT_FloatImage currimg, tmpimg; 93 | int ncols = img->ncols, nrows = img->nrows; 94 | int subsampling = pyramid->subsampling; 95 | int subhalf = subsampling / 2; 96 | float sigma = subsampling * sigma_fact; /* empirically determined */ 97 | int oldncols; 98 | int i, x, y; 99 | 100 | if (subsampling != 2 && subsampling != 4 && 101 | subsampling != 8 && subsampling != 16 && subsampling != 32) 102 | KLTError("(_KLTComputePyramid) Pyramid's subsampling must " 103 | "be either 2, 4, 8, 16, or 32"); 104 | 105 | assert(pyramid->ncols[0] == img->ncols); 106 | assert(pyramid->nrows[0] == img->nrows); 107 | 108 | /* Copy original image to level 0 of pyramid */ 109 | memcpy(pyramid->img[0]->data, img->data, ncols*nrows*sizeof(float)); 110 | 111 | currimg = img; 112 | for (i = 1 ; i < pyramid->nLevels ; i++) { 113 | tmpimg = _KLTCreateFloatImage(ncols, nrows); 114 | _KLTComputeSmoothedImage(currimg, sigma, tmpimg); 115 | 116 | 117 | /* Subsample */ 118 | oldncols = ncols; 119 | ncols /= subsampling; nrows /= subsampling; 120 | for (y = 0 ; y < nrows ; y++) 121 | for (x = 0 ; x < ncols ; x++) 122 | pyramid->img[i]->data[y*ncols+x] = 123 | tmpimg->data[(subsampling*y+subhalf)*oldncols + 124 | (subsampling*x+subhalf)]; 125 | 126 | /* Reassign current image */ 127 | currimg = pyramid->img[i]; 128 | 129 | _KLTFreeFloatImage(tmpimg); 130 | } 131 | } 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | -------------------------------------------------------------------------------- /Tracke/klt/Klt/pyramid.h: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | * pyramid.h 3 | *********************************************************************/ 4 | 5 | #ifndef _PYRAMID_H_ 6 | #define _PYRAMID_H_ 7 | 8 | #include "klt_util.h" 9 | 10 | typedef struct { 11 | int subsampling; 12 | int nLevels; 13 | _KLT_FloatImage *img; 14 | int *ncols, *nrows; 15 | } _KLT_PyramidRec, *_KLT_Pyramid; 16 | 17 | 18 | _KLT_Pyramid _KLTCreatePyramid( 19 | int ncols, 20 | int nrows, 21 | int subsampling, 22 | int nlevels); 23 | 24 | void _KLTComputePyramid( 25 | _KLT_FloatImage floatimg, 26 | _KLT_Pyramid pyramid, 27 | float sigma_fact); 28 | 29 | void _KLTFreePyramid( 30 | _KLT_Pyramid pyramid); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /Tracke/klt/Klt/storeFeatures.c: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | * storeFeatures.c 3 | * 4 | *********************************************************************/ 5 | 6 | /* Our includes */ 7 | #include "error.h" 8 | #include "klt.h" 9 | 10 | 11 | /********************************************************************* 12 | * 13 | */ 14 | 15 | void KLTStoreFeatureList( 16 | KLT_FeatureList fl, 17 | KLT_FeatureTable ft, 18 | int frame) 19 | { 20 | int feat; 21 | 22 | if (frame < 0 || frame >= ft->nFrames) 23 | KLTError("(KLTStoreFeatures) Frame number %d is not between 0 and %d", 24 | frame, ft->nFrames - 1); 25 | 26 | if (fl->nFeatures != ft->nFeatures) 27 | KLTError("(KLTStoreFeatures) FeatureList and FeatureTable must " 28 | "have the same number of features"); 29 | 30 | for (feat = 0 ; feat < fl->nFeatures ; feat++) { 31 | ft->feature[feat][frame]->x = fl->feature[feat]->x; 32 | ft->feature[feat][frame]->y = fl->feature[feat]->y; 33 | ft->feature[feat][frame]->val = fl->feature[feat]->val; 34 | } 35 | } 36 | 37 | 38 | /********************************************************************* 39 | * 40 | */ 41 | 42 | void KLTExtractFeatureList( 43 | KLT_FeatureList fl, 44 | KLT_FeatureTable ft, 45 | int frame) 46 | { 47 | int feat; 48 | 49 | if (frame < 0 || frame >= ft->nFrames) 50 | KLTError("(KLTExtractFeatures) Frame number %d is not between 0 and %d", 51 | frame, ft->nFrames - 1); 52 | 53 | if (fl->nFeatures != ft->nFeatures) 54 | KLTError("(KLTExtractFeatures) FeatureList and FeatureTable must " 55 | "have the same number of features"); 56 | 57 | for (feat = 0 ; feat < fl->nFeatures ; feat++) { 58 | fl->feature[feat]->x = ft->feature[feat][frame]->x; 59 | fl->feature[feat]->y = ft->feature[feat][frame]->y; 60 | fl->feature[feat]->val = ft->feature[feat][frame]->val; 61 | } 62 | } 63 | 64 | 65 | /********************************************************************* 66 | * 67 | */ 68 | 69 | void KLTStoreFeatureHistory( 70 | KLT_FeatureHistory fh, 71 | KLT_FeatureTable ft, 72 | int feat) 73 | { 74 | int frame; 75 | 76 | if (feat < 0 || feat >= ft->nFeatures) 77 | KLTError("(KLTStoreFeatureHistory) Feature number %d is not between 0 and %d", 78 | feat, ft->nFeatures - 1); 79 | 80 | if (fh->nFrames != ft->nFrames) 81 | KLTError("(KLTStoreFeatureHistory) FeatureHistory and FeatureTable must " 82 | "have the same number of frames"); 83 | 84 | for (frame = 0 ; frame < fh->nFrames ; frame++) { 85 | ft->feature[feat][frame]->x = fh->feature[frame]->x; 86 | ft->feature[feat][frame]->y = fh->feature[frame]->y; 87 | ft->feature[feat][frame]->val = fh->feature[frame]->val; 88 | } 89 | } 90 | 91 | 92 | /********************************************************************* 93 | * 94 | */ 95 | 96 | void KLTExtractFeatureHistory( 97 | KLT_FeatureHistory fh, 98 | KLT_FeatureTable ft, 99 | int feat) 100 | { 101 | int frame; 102 | 103 | if (feat < 0 || feat >= ft->nFeatures) 104 | KLTError("(KLTExtractFeatureHistory) Feature number %d is not between 0 and %d", 105 | feat, ft->nFeatures - 1); 106 | 107 | if (fh->nFrames != ft->nFrames) 108 | KLTError("(KLTExtractFeatureHistory) FeatureHistory and FeatureTable must " 109 | "have the same number of frames"); 110 | 111 | for (frame = 0 ; frame < fh->nFrames ; frame++) { 112 | fh->feature[frame]->x = ft->feature[feat][frame]->x; 113 | fh->feature[frame]->y = ft->feature[feat][frame]->y; 114 | fh->feature[frame]->val = ft->feature[feat][frame]->val; 115 | } 116 | } 117 | 118 | -------------------------------------------------------------------------------- /Tracke/klt/Klt/trackFeatures.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/Klt/trackFeatures.c -------------------------------------------------------------------------------- /Tracke/klt/README.txt: -------------------------------------------------------------------------------- 1 | ********************************************************************** 2 | NOTICE: 3 | 4 | Copyright (1997,1998) The Board of Trustees of the Leland Stanford Junior 5 | Univeristy. Except for commercial resale, lease, license or other 6 | commercial transactions, permission is hereby given to use, copy, modify, 7 | and distribute this software. STANFORD MAKES NO REPRESENTATIONS OR 8 | WARRANTIES OF ANY KIND CONCERNING THIS SOFTWARE. 9 | 10 | Inquiries to adapt this code for commercial use should be directed 11 | to the Office of Technology Licensing of Stanford University, 12 | http://www-leland.stanford.edu/group/OTL, (650) 723-0651. 13 | ********************************************************************** 14 | 15 | KLT 16 | An implementation of the Kanade-Lucas-Tomasi feature tracker 17 | 18 | Version 1.1.5 19 | 20 | Author: Stan Birchfield 21 | birchfield@cs.stanford.edu 22 | 23 | Date: October 7, A. D. 1998 24 | Ported to Microsoft Visual C++ 6.0: March 2, A. D. 2004 25 | 26 | The code can be obtained from http://www.vision.stanford.edu/~birch/klt, 27 | where the official manuals reside. For your convenience, unofficial 28 | manuals have been placed in the current subdirectory 'doc'. 29 | 30 | -------------------------------------------------------------------------------- /Tracke/klt/doc/birchfield-klt-derivation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/doc/birchfield-klt-derivation.pdf -------------------------------------------------------------------------------- /Tracke/klt/doc/home_motif.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/doc/home_motif.gif -------------------------------------------------------------------------------- /Tracke/klt/doc/index.html: -------------------------------------------------------------------------------- 1 | KLT: Kanade-Lucas-Tomasi Feature Tracker 2 | ----- 3 |

KLT: An Implementation of the Kanade-Lucas-Tomasi Feature Tracker

4 | -----

5 | 6 | KLT is an implementation, in the C programming language, of a feature 7 | tracker that will hopefully be of interest to the computer vision community. 8 | The tracker is based on the early work of Lucas and 9 | 10 | Kanade 11 | [1] and was developed fully by 12 | 13 | Tomasi 14 | and Kanade [2], but the only 15 | published, readily accessible description is contained in the paper by 16 | 17 | Shi 18 | and Tomasi [3]. 19 | Recently, Tomasi proposed a slight modification which 20 | makes the computation symmetric with respect to the two images; the 21 | resulting equation is fully derived 22 | in the unpublished note by 23 | 24 | Birchfield 25 | [4].

26 | 27 | Briefly, good features are located by examining the minimum 28 | eigenvalue of each 2 by 2 gradient matrix, and features are 29 | tracked using a Newton-Raphson method of minimizing the difference 30 | between the two windows. 31 | Multiresolution tracking allows for even large displacements between 32 | images. 33 | Currently, the affine computation that evaluates the consistency 34 | of features between non-consecutive frames [3] 35 | is not implemented.

36 | 37 |

44 | 45 |
46 |

References

47 |
48 |
[1] Bruce D. Lucas and Takeo Kanade. 49 | An Iterative Image Registration Technique with an 50 | Application to Stereo Vision. 51 | International Joint Conference on Artificial Intelligence, 52 | pages 674-679, 1981.

53 | 54 |

[2] Carlo Tomasi and Takeo Kanade. 55 | Detection and Tracking of Point Features. 56 | Carnegie Mellon University Technical Report CMU-CS-91-132, 57 | April 1991.

58 | 59 |

[3] Jianbo Shi and Carlo Tomasi. 60 | 61 | Good Features to Track. 62 | IEEE Conference on Computer Vision and Pattern Recognition, 63 | pages 593-600, 1994.

64 | 65 |

[4] Stan Birchfield. 66 | 67 | Derivation of Kanade-Lucas-Tomasi Tracking Equation. 68 | Unpublished, May 1996. 69 |
70 | 71 |
72 | 73 | Last updated by 74 | Stan Birchfield on 75 | March 11, A. D. 1998
76 | 77 | birchfield@cs.stanford.edu 78 | 79 | -------------------------------------------------------------------------------- /Tracke/klt/doc/installation.html: -------------------------------------------------------------------------------- 1 | Obtaining and Installing KLT 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 |

Obtaining and Installing the Code

10 | 11 | Please follow these steps to obtain and install KLT: 12 |
    13 |
  1. Choose the version you want to download (You'll probably want 14 | the most recent version): 15 | 19 | Save it to a file named "klt.tar.gz" and move it to a directory like "~/src". 20 |
  2. Type gunzip klt.tar.gz 21 |
  3. Type tar xf klt.tar. A directory called "klt" will automatically be 22 | created and all the files will go there. 23 |
  4. Move to the "klt" directory. Type make.
    24 | NOTE: On some systems it may be necessary to manually convert 25 | expf() to exp() and logf() to log(), and/or fsqrt() to sqrtf(). 26 |
  5. That's it. Now try some examples, by typing example1, etc. 27 |
  6. Notice that, for your convenience, unofficial copies of the 28 | User and Reference Manuals can be found in the doc directory. 29 |
  7. To keep the "klt.tar.gz" reasonably sized, only three images are included. 30 | If you want to play with the code even more, grab the 31 | extra images (407 KB). 32 |
33 | 34 | Please let me know of any bugs you find. Moreover, any questions, 35 | comments, suggestions, and criticisms are welcome.

36 | 37 | If you download KLT and find it useful for your work, I would like very much to 38 | hear from you. Please send me a short email (to the address below) describing 39 | the application in which you are involved. Such correspondence benefits me 40 | because I am curious to know how this software is being used. But it also 41 | benefits you because (1) the larger the number of people who use the program, 42 | the more I can justify spending time improving it, and (2) when a new version 43 | becomes available, I can notify you by email.

44 | 45 | An acknowledgment in any publication describing work that uses KLT would 46 | be greatly appreciated.

47 | 48 |


49 | Stan Birchfield
50 | 51 | birchfield@cs.stanford.edu 52 | 53 | -------------------------------------------------------------------------------- /Tracke/klt/doc/log.html: -------------------------------------------------------------------------------- 1 | Log of Changes 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 |

Log of Changes

10 | 11 |
    12 | 13 |
  • Version 1.1.5 (7 Oct 1998) 14 |
      15 |
    • In trackFeatures.c, renamed _sumFloatWindow to _sumAbsFloatWindow 16 | (I thought this had been done before in version 1.1.1). 17 | Two bugs in the function were fixed: 18 |
        19 |
      1. Now, the absolute value is taken of the individual pixels before 20 | summing them. 21 |
      2. The 'for' loop over 'width' now works correctly. 22 |
      23 | Note: As a result of this bug fix, the default value of tc->max_residue 24 | was changed to 10. 25 |
      -- Thanks to Pedro Felzenszwalb 26 |
    27 | 28 |
  • Version 1.1.4 (18 Sep 1998) 29 |
      30 |
    • To make code work for Win32 systems, forced fopen() to 31 | use binary rather than text file. (In Unix, default is 32 | to open as binary, whereas in Win32, default is to open as 33 | text). 34 |
      -- Thanks to Johan, Fredje Helderweirt, and LiYunhao 35 |
    • In convolve.c: Simplified formula for maximum of Gaussian 36 | and Gaussian derivative. 37 |
    • In selectFeatures.c, changed the errors to warnings, when 38 | checking window size. 39 |
    • Changed indentation for improved readability. 40 |
    • Minor changes to eliminate compiler warnings: 41 |
        42 |
      • In selectGoodFeatures.c: Changed _quicksort to return void, 43 | and wrapped _comparePoints() with #ifdef KLT_USE_QSORT. 44 |
      • In trackFeatures.c: Changed _computeIntensityDifference 45 | and _computeGradientSum to return void; removed 46 | search_range_max, nlevels, and ixx, which were not being used. 47 |
      • In pnmio.c: Type conversion made explicit in malloc(). 48 |
      • In selectFeatures.c: moved _quicksort() to top of file to 49 | obviate need for prototype. 50 |
      • In writeFeatures.c: _readHeader() now returns a structureType, 51 | instead of an int (A structureType is an int, but some 52 | compilers are really picky). 53 |
      54 |
    55 | 56 |
  • Version 1.1.3 (3 Mar 1998) 57 |
      58 |
    • Fixed bug in KLTTrackFeatures(). In the 59 | conditional just after the call to _trackFeature(), 60 | KLT_OOB is now properly handled. 61 |
    • Slightly improved bounds-checking by introducing an epsilon, 62 | and by giving back an extra pixel along the border that had 63 | been taken away unnecessarily. 64 |
    • If tc->window_[width,height] is unacceptable, 65 | a warning is now generated and the value is corrected. 66 | Previously an error was generated. 67 |
    • In Example 5, changed search range from 20 to 15. As a 68 | result, if the window size is changed to 5 the number of 69 | pyramid levels remains 2, which prevents the border from 70 | increasing dramatically. 71 |
    • In Makefile, change example dependencies from lib to libklt.a. 72 | Unfortunately, changing the library source code (such as 73 | trackFeatures.c) and then calling make 74 | example1 does not work properly, but at least 75 | changing example1.c and then calling make 76 | example1 does work. The latter case is probably more 77 | important, so we will have to live with the current tradeoff. 78 |
    79 | 80 |
  • Version 1.1.2 (24 Feb 1998) 81 |
      82 |
    • Fixed major bug: Added an explicit check to ensure that feature 83 | does not drift out of bounds during tracking. This removes the 84 | problem of occasional crashes. 85 |
      -- Thanks to Rainer Stiefelhagen 86 |
    • Speeded up sorting by replacing qsort() with Manolis Lourakis' 87 | _quicksort() function. 88 |
      -- Thanks to Manolis Lourakis, Luis Rivera 89 |
    • Added KLTSetVerbosity() to klt.c (It should have already been there) 90 |
    • Changed ppmWriteFile() to ppmWriteFileRGB() 91 |
    • Fixed minor bug: assert() statement in line 314 of convolve.c 92 |
      -- Thanks to Rainer Stiefelhagen 93 |
    • In Makefile, change example dependencies from libklt.a to lib 94 |
    95 | 96 |
  • Version 1.1.1 (18 Dec 1997) 97 |
      98 |
    • Fixed minor syntax bug: Changed 'if feof(fp)' to 'if (feof(fp))' 99 | in writeFeatures.c 100 |
      -- Thanks to Matt Last 101 |
    • Fixed major bug: When tracking features, 'max_residue' was not 102 | being computed correctly. Therefore, feature windows that changed 103 | a lot in intensity were not being detected. Specifically, in 104 | trackFeatures.c, I changed _sumFloatWindow to _sumAbsFloatWindow. 105 |
    106 | 107 |
  • Version 1.1 108 |
      109 |
    • (16 Oct 1997) 110 |
        111 |
      • Fixed bug in pgmReadFile(). It was not skipping over the 112 | last return character. 113 |
      • Example 1 was updated to include binary files. 114 |
      • Changed KLTWriteFeature...() and KLTReadFeature...() 115 | to allow binary files, as well as text files. 116 |
      117 |
    • (15 Oct 1997) 118 |
        119 |
      • Posted 120 |
      • Fixed obscure bug in KLTChangeTCPyramid() and 121 | improved readability of that function 122 |
      • Fixed incorrect assert() statement in _interpolate() function 123 |
      124 |
    125 | 126 |
  • Version 1.1 (beta) 127 |
      128 |
    • (21 Feb 1997) 129 |
        130 |
      • Renamed as Version 1.1 (beta) 131 |
      132 |
    • (15 Feb 1997) 133 |
        134 |
      • Posted as Version 1.2
        135 | (This was a mistake; it should have been named Version 1.1 (beta).) 136 |
      • Fixed obscure bug that sometimes caused infinite loop
        137 | (bug was in _enforceMinimumDistance() function of 138 | selectGoodFeatures.c) 139 |
      • Amended KLTPrintTrackingContext() to print all the new 140 | fields that were added in Version 1.1 141 |
      142 |
    143 | 144 |
  • Version 1.1 (alpha) 145 |
      146 |
    • (21 Feb 1997) 147 |
        Renamed as Version 1.1 (alpha) 148 |
      149 |
    • (10 Feb 1997) 150 |
        151 |
      • Posted as Version 1.1
        152 | (This was a mistake; it should have been named Version 1.1 (alpha).) 153 |
      • Features are lost when residue exceeded 154 |
      • KLTSelectGoodFeatures() only accepts features whose minimum 155 | eigenvalue is at least tc->min_eigenvalue 156 |
      • User allowed to output internal images 157 |
      • comments allowed in data files 158 |
      • Default for tc->smooth_sigma_fact changed from 0.5 to 0.1 159 |
      • Simplified _minEigenvalue() routine in selectGoodFeatures.c 160 |
      161 |
    162 | 163 |
  • Version 1.0 (beta) 164 |
      165 |
    • (10 Feb 1997) 166 |
        167 |
      • Posted 168 |
      • Print statements are prefaced by "(KLT) " 169 |
      170 |
    171 | 172 |
  • Version 1.0 (alpha) 173 |
      174 |
    • (28 Jan 1997) 175 |
        176 |
      • Removed '#include "pyramid.h"' from "klt.h" 177 |
      • Changed '_KLT_Pyramid' in "klt.h" to 'void *' 178 |
      • Forced coercion of 'void *' to '_KLT_Pyramid' in other files 179 |
      180 |
    • (27 Jan 1997) 181 |
      182 |
      Removed 'makedepend' from Makefile, along with dependencies 183 | below '# DO NOT DELETE' 184 |
      185 |
    • (24 Jan 1997) 186 |
      187 |
      Posted 188 |
      189 |
    190 | 191 |
192 | 193 |
194 | 195 | -------------------------------------------------------------------------------- /Tracke/klt/doc/next_motif.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/doc/next_motif.gif -------------------------------------------------------------------------------- /Tracke/klt/doc/previous_motif.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/doc/previous_motif.gif -------------------------------------------------------------------------------- /Tracke/klt/doc/previous_versions.html: -------------------------------------------------------------------------------- 1 | Earlier Versions of KLT 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 |

Previous Versions of KLT

10 | 11 | 17 | 18 | -------------------------------------------------------------------------------- /Tracke/klt/doc/ref/backup: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | for file in `ls *.html` 4 | do 5 | cp $file `echo $file | sed s/'\.html'/"\.html~$1"/` 6 | done 7 | 8 | -------------------------------------------------------------------------------- /Tracke/klt/doc/ref/change_pyramid.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 |

KLTChangeTCPyramid()

19 | 20 |

21 | 22 | void KLTChangeTCPyramid(
23 | KLT_TrackingContext tc,
24 | int search_range);
25 |
26 |

27 | 28 | KLTChangeTCPyramid() is a convenience function that 29 | updates the nPyramidLevels and subsampling 30 | fields of the tc structure, based on the value 31 | of search_range. The function 32 | is designed so that the tracker will be able find displacements up to 33 | search_range. For example, if search_range 34 | is 1 (pixel), then nPyramidLevels 35 | will be one and subsampling will be irrelevant, because there will be no 36 | need for multiresolution tracking. However, if 37 | search_range is 25 (pixels), 38 | then nPyramidLevels will be 2 and subsampling 39 | will be 8. The tracker is not 40 | guaranteed to find all displacements up to search_range 41 | pixels, so it is 42 | probably a good idea to overestimate the value. However, too much 43 | overestimation will make it more likely for ambiguity to confuse the tracker.

44 | 45 |


46 | 47 | -------------------------------------------------------------------------------- /Tracke/klt/doc/ref/count.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 |

KLTCountRemainingFeatures()

19 | 20 |

21 | 22 | int KLTCountRemainingFeatures(
23 | KLT_FeatureList fl);
24 |
25 |

26 | 27 | KLTCountRemainingFeatures() returns the number of features in 28 | fl whose value is nonnegative (i.e., the number of 29 | features that are not lost.

30 | 31 |


32 | 33 | -------------------------------------------------------------------------------- /Tracke/klt/doc/ref/create.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 |

KLTCreate...() / KLTFree...()

19 | 20 |
21 | 22 |

23 | 24 | KLT_TrackingContext KLTCreateTrackingContext(void);

25 | KLT_FeatureList KLTCreateFeatureList(
26 | int nFeatures);

27 | KLT_FeatureHistory KLTCreateFeatureHistory(
28 | int nFrames);

29 | KLT_FeatureTable KLTCreateFeatureTable(
30 | int nFrames,
31 | int nFeatures);

32 | void KLTFreeTrackingContext(
33 | KLT_TrackingContext tc);

34 | void KLTFreeFeatureList(
35 | KLT_FeatureList fl);

36 | void KLTFreeFeatureHistory(
37 | KLT_FeatureHistory fh);

38 | void KLTFreeFeatureTable(
39 | KLT_FeatureTable ft);

40 |
41 |

42 | 43 | These functions create and free various structures. Technically, it is 44 | good programming practice to free the structures after using them, although 45 | this is not done in any of the example code.

46 | 47 | KLTCreateTrackingContext() is a little different from the other creation 48 | routines in that it uses default values defined 49 | in klt.c to set up the structure. 50 | These values can be changed if desired. 51 | 52 |


53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /Tracke/klt/doc/ref/feature.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 |

KLT_Feature

19 | 20 |

21 | 22 | typedef struct {
23 | KLT_locType x;
24 | KLT_locType y;
25 | int val;
26 | } *KLT_Feature;
27 |
28 |

29 | 30 | A KLT_Feature contains an (x,y) location and a value. 31 | (KLT_locType is equal 32 | to float.) The value is interpreted as follows: 33 |
    34 |
  1. A positive value means the feature has just been found by 35 | KLTSelectGoodFeatures() or KLTReplaceLostFeatures(). 36 | 37 |
  2. KLT_TRACKED (0) means the feature has been successfully tracked. 38 | 39 |
  3. KLT_NOT_FOUND (-1) means that no feature could be found. For example, 40 | if the user attempts to find 150 features in an image, but only 125 can 41 | be found, then the 42 | remaining 25 will be assigned a value of KLT_NOT_FOUND. 43 | 44 |
  4. KLT_SMALL_DET (-2) indicates that the feature has been lost due to 45 | the 2 by 2 gradient matrix having a small determinant. 46 | 47 |
  5. KLT_MAX_ITERATIONS (-3) means that the feature has been lost 48 | because the number of iterations exceeded the maximum allowable. 49 | 50 |
  6. KLT_OOB (-4) means that the feature has been lost 51 | because it was out of bounds (i.e., it was too close to the image border). 52 | 53 |
  7. KLT_LARGE_RESIDUE (-5) means that the feature has been lost 54 | because the residue between the two feature windows was too large. 55 |
56 | 57 |
58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /Tracke/klt/doc/ref/fh.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 |

KLT_FeatureHistory

19 | 20 |

21 | 22 | typedef struct {
23 | int nFrames;
24 | KLT_Feature *feature;
25 | } *KLT_FeatureHistory;
26 |
27 |

28 | 29 | A KLT_FeatureHistory is an array of features. The nFrames field 30 | indicates the number of features allocated, or rather the number of 31 | frames in which the feature's data is given. 32 | It must not be changed manually.

33 | 34 | NOTE: Although a feature list and a feature history look similar, the former 35 | is intended to refer to an array of features from a single image, while 36 | the latter refers to the same feature tracked through several images.

37 | 38 | The following code illustrates how to access the data 39 | in a feature history: 40 | 41 |

42 | KLT_FeatureHistory fh;
43 | int frame;
44 | 
45 | for (frame = 0 ; frame < fh->nFrames ; frame++)  {
46 |      printf("(%5.1f,%5.1f) = %d\n", 
47 |           fh->feature[frame]->x,
48 |           fh->feature[frame]->y,
49 |           fh->feature[frame]->val);
50 | }
51 | 
52 | 53 | 54 |
55 | 56 | -------------------------------------------------------------------------------- /Tracke/klt/doc/ref/fl.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 |

KLT_FeatureList

19 | 20 |

21 | 22 | typedef struct {
23 | int nFeatures;
24 | KLT_Feature *feature;
25 | } *KLT_FeatureList;
26 |
27 |

28 | 29 | A KLT_FeatureList is an array of features. The 30 | nFeatures field 31 | indicates the number of features allocated, but not necessarily 32 | the number of non-lost features. It must not be changed manually.

33 | 34 | NOTE: Although a feature list and a feature history look similar, the former 35 | is intended to refer to an array of features from a single image, while 36 | the latter refers to the same feature tracked through several images.

37 | 38 | The following code illustrates how to access the data 39 | in a feature list: 40 | 41 |

42 | KLT_FeatureList fl;
43 | int feat;
44 | 
45 | for (feat = 0 ; feat < fl->nFeatures ; feat++)  {
46 |      printf("(%5.1f,%5.1f) = %d\n",
47 |           fl->feature[feat]->x,
48 |           fl->feature[feat]->y,
49 |           fl->feature[feat]->val);
50 | }
51 | 
52 | 53 | 54 |
55 | 56 | -------------------------------------------------------------------------------- /Tracke/klt/doc/ref/ft.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 |

KLT_FeatureTable

19 | 20 |

21 | 22 | typedef struct {
23 | int nFrames;
24 | int nFeatures;
25 | KLT_Feature **feature;
26 | } *KLT_FeatureTable;
27 |
28 |

29 | 30 | A KLT_FeatureTable is a two-dimensional array of features with 31 | nFrames columns and nFeatures rows. It is used 32 | to collect the features tracked through an image sequence.

33 | 34 | Data in a feature table is accessed by indexing the feature number before the 35 | frame number. For example, if ft is a feature table, 36 | the following code prints the data: 37 | 38 |

39 | KLT_FeatureTable ft;
40 | int feat, frame;
41 | 
42 | for (feat = 0 ; feat < ft->nFeatures ; feat++)
43 |      for (frame = 0 ; frame < ft->nFrames ; frame++)  {
44 |           printf("(%5.1f,%5.1f) = %d\n", 
45 |                ft->feature[feat][frame]->x,
46 |                ft->feature[feat][frame]->y,
47 |                ft->feature[feat][frame]->val);
48 |      }
49 | 
50 | 51 |
52 | 53 | -------------------------------------------------------------------------------- /Tracke/klt/doc/ref/index.html: -------------------------------------------------------------------------------- 1 | KLT Reference Manual 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 |

Reference Manual

19 | 20 | 62 | 63 |
64 | 65 | -------------------------------------------------------------------------------- /Tracke/klt/doc/ref/print_tc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 |

KLTPrintTrackingContext()

19 | 20 |

21 | 22 | void KLTPrintTrackingContext(
23 | KLT_TrackingContext tc);
24 |
25 |

26 | 27 | KLTPrintTrackingContext() prints the fields of the tracking 28 | context to stderr.

29 | 30 |


31 | 32 | -------------------------------------------------------------------------------- /Tracke/klt/doc/ref/replace.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 |

KLTReplaceLostFeatures()

19 | 20 |

21 | 22 | void KLTReplaceLostFeatures(
23 | KLT_TrackingContext tc,
24 | KLT_PixelType *img,
25 | int ncols,
26 | int nrows,
27 | KLT_FeatureList fl);
28 |
29 |

30 | 31 | KLTReplaceLostFeatures() takes an image pointed to by img 32 | and a feature list 33 | fl. (NOTE: KLT_PixelType 34 | is, unless modified by the user, an unsigned char.) 35 | If tc->sequentialMode is 36 | TRUE, and if KLTTrackFeatures() has previously been called, 37 | then img is ignored 38 | and instead the image from 39 | tc->pyramid_last, tc->pyramid_last_gradx, 40 | and tc->pyramid_last_grady is used. 41 | Otherwise, the gradients are computed using a Gaussian of sigma = 42 | tc->grad_sigma, but not before the image is smoothed with a Gaussian of 43 | sigma = (tc->smooth_sigma_fact * 44 | max(tc->window_width, tc->window_height)) if 45 | tc->smoothBeforeSelecting is TRUE. 46 |

47 | 48 | Essentially, the same computation is performed as that of 49 | KLTSelectGoodFeatures(), except that only the lost features are replaced, 50 | rather than all the features. All new features are guaranteed to be at least 51 | tc->mindist pixels away from each other and from all 52 | the existing features.

53 | 54 | Exactly like KLTSelectGoodFeatures(), if tc->writeInternalImages 55 | is TRUE, then 56 | the smoothed image and the image derivatives are written to 57 | "kltimg_sgfrlf.pgm", 58 | "kltimg_sgfrlf_gx.pgm", and 59 | "kltimg_sgfrlf_gy.pgm", respectively.

60 | 61 |


62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /Tracke/klt/doc/ref/select.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 |

KLTSelectGoodFeatures()

19 | 20 |

21 | 22 | void KLTSelectGoodFeatures(
23 | KLT_TrackingContext tc,
24 | KLT_PixelType *img,
25 | int ncols,
26 | int nrows,
27 | KLT_FeatureList fl);
28 |
29 |

30 | 31 | KLTSelectGoodFeatures() takes an image pointed to by 32 | img. (NOTE: KLT_PixelType 33 | is, unless modified by the user, an unsigned char.) If 34 | tc->smoothBeforeSelecting is set to TRUE, then the 35 | image is smoothed by 36 | convolving with a Gaussian of sigma = tc->smooth_sigma_fact * 37 | max(tc->window_width, tc->window_height); otherwise, the image 38 | is not smoothed. In either case, 39 | gradients are computed from the resulting image by convolving with the 40 | derivative of a Gaussian of sigma = tc->grad_sigma. These 41 | gradients (one in 42 | the x direction and the other in the y direction) are used 43 | to select the features.

44 | 45 | Pixels throughout the image are then measured as to their "goodness", which 46 | is a measure of their trackability. 47 | Generally each pixel within the image's interior is considered, where the 48 | interior is defined by tc->borderx and 49 | tc->bordery (i.e., setting these 50 | parameters to zero causes the interior to equal the whole image). 51 | The parameter tc->nSkippedPixels can be used to speed up the process in 52 | the following way: its default value is zero, in which case every pixel within 53 | the interior is considered; if it is set to one, 54 | then every other pixel within the interior is considered; setting 55 | it to two causes every third pixel to be considered; and similarly for 56 | higher values. Since neighboring 57 | pixels generally have similar goodness values, then skipping every 58 | other one will probably not noticeably decrease performance.

59 | 60 | The goodness of each pixel is measured as the minimum eigenvalue of 61 | the 2 by 2 gradient matrix computed from the tc->window_width by 62 | tc->window_height window around the pixel. After all the pixels have been 63 | considered, they are sorted in descending order according to goodness. 64 | Then, one by one the top fl->nFeatures 65 | features (or pixels) whose minimum eigenvalue is at least 66 | tc->min_eigenvalue are selected, ensuring that each new feature is at 67 | least tc->mindist pixels away from all the other features.

68 | 69 | If tc->writeInternalImages is TRUE, then 70 | the smoothed image and the image derivatives are written to 71 | "kltimg_sgfrlf.pgm", 72 | "kltimg_sgfrlf_gx.pgm", and 73 | "kltimg_sgfrlf_gy.pgm", respectively. 74 | This allows the user to more intelligently select the parameters 75 | for smoothing and differentiating. 76 | 77 |

78 |


79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /Tracke/klt/doc/ref/stop.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 |

KLTStopSequentialMode()

19 | 20 |

21 | 22 | void KLTStopSequentialMode(
23 | KLT_TrackingContext tc);
24 |
25 |

26 | 27 | KLTStopSequentialMode() must be called when it is desired to set 28 | tc->sequentialMode to FALSE. In addition to 29 | setting this value, 30 | the function frees the memory pointed to by the fields 31 | tc->pyramid_last, tc->pyramid_last_gradx, 32 | and tc->pyramid_last_grady. 33 | This memory is allocated when KLTTrackFeatures() is called with 34 | tc->sequentialMode to TRUE. Without calling 35 | the present function, 36 | KLTTrackFeatures() and KLTReplaceLostFeatures() will continue to use 37 | the old pyramids even though they are no longer valid.

38 | 39 |


40 | 41 | -------------------------------------------------------------------------------- /Tracke/klt/doc/ref/store.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 |

KLTStore...() / KLTExtract...()

19 | 20 |
21 | 22 |

23 | 24 | void KLTStoreFeatureList(
25 | KLT_FeatureList fl,
26 | KLT_FeatureTable ft,
27 | int frame);

28 | void KLTStoreFeatureHistory(
29 | KLT_FeatureHistory fh,
30 | KLT_FeatureTable ft,
31 | int feat);
32 |
33 |

34 | 35 | KLTStoreFeatureList() stores fl in the frame 36 | column of ft. The number frame must be between 0 and 37 | ft->nFrames - 1. The nFeatures field of both 38 | fl and ft 39 | must be the same.

40 | 41 | KLTStoreFeatureHistory() is similar, except that 42 | fh is stored in the feat 43 | row of ft.

44 | 45 |


46 | 47 |

48 | 49 | void KLTExtractFeatureList(
50 | KLT_FeatureList fl,
51 | KLT_FeatureTable ft,
52 | int frame);

53 | void KLTExtractFeatureHistory(
54 | KLT_FeatureHistory fh,
55 | KLT_FeatureTable ft,
56 | int feat);
57 |
58 |

59 | 60 | KLTExtractFeatureList() sets fl to the 61 | frame column 62 | of ft, while 63 | KLTExtractFeatureHistory() sets fh to the 64 | feat row 65 | of ft. The same restrictions apply as those of the 66 | KLTStore...() functions.

67 | 68 |


69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /Tracke/klt/doc/ref/track.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 |

KLTTrackFeatures()

19 | 20 |

21 | 22 | void KLTTrackFeatures(
23 | KLT_TrackingContext tc,
24 | KLT_PixelType *img1,
25 | KLT_PixelType *img2,
26 | int ncols,
27 | int nrows,
28 | KLT_FeatureList fl);
29 |
30 |

31 | 32 | KLTTrackFeatures() takes two images pointed to by img1 33 | and img2. (NOTE: KLT_PixelType 34 | is, unless modified by the user, an unsigned char.) If 35 | tc->sequentialMode is 36 | TRUE, and KLTTrackFeatures() has been previously called, then 37 | img1 is ignored 38 | and the first image is taken instead from 39 | tc->pyramid_last, tc->pyramid_last_gradx, and 40 | tc->pyramid_last_grady. 41 | In either case, the 42 | resulting images are smoothed by 43 | convolving with a Gaussian of sigma = 44 | tc->smooth_sigma_fact * 45 | max(tc->window_width, tc->window_height). Then a 46 | multi-resolution image pyramid is created with tc->nPyramidLevels 47 | levels and 48 | tc->subsampling pixels subsampled between each level; smoothing 49 | before sampling is accomplished 50 | with sigma = tc->subsampling * tc->pyramid_sigma_fact. 51 | Gradients are computed at each level 52 | of the pyramid by convolving with the 53 | derivative of a Gaussian of sigma = tc->grad_sigma. 54 |

55 | 56 | In the feature list, each feature that is not lost (i.e., whose value is nonnegative) 57 | is tracked beginning with the coarsest resolution and ending with the 58 | finest resolution, with each resolution providing the starting point for the 59 | subsequent resolution. At each resolution, tracking is accomplished 60 | by a Newton-Raphson iterative minimization between the intensities of the two 61 | windows, one window in each image. There are five conditions that cause the 62 | iterations to stop (only in the first case is the tracker successful): 63 |

    64 |
  1. the feature moves by no more than tc->min_displacement 65 |
  2. the determinant of the 2-by-2 gradient matrix is less than 66 | tc->min_determinant 67 |
  3. the number of iterations exceeds tc->max_iterations 68 |
  4. the feature is out of bounds (i.e., it is within tc->borderx 69 | or tc->bordery of the border of the image) 70 |
  5. the residue is too large (i.e., the average intensity difference 71 | between pixels in the two windows is greater than 72 | tc->max_residue) 73 |
74 | The value of the feature in these cases becomes KLT_TRACKED, 75 | KLT_SMALL_DET, KLT_MAX_ITERATIONS, 76 | KLT_OOB, and KLT_LARGE_RESIDUE, 77 | respectively, which are in turn equal to 0, 78 | -2, -3, -4, and -5. (See the reference page of 79 | KLT_Feature to see what a value of 80 | -1 means.)

81 | 82 | If tc->writeInternalImages is TRUE, then 83 | the smoothed image and the image derivatives at each level of the 84 | pyramid are written to 85 | "kltimg_tf_[I][n].pgm", 86 | "kltimg_tf_[I][n]_gx.pgm", and 87 | "kltimg_tf_[I][n]_gy.pgm", where [I] = i,j 88 | denotes either the first image or the second image, 89 | and [n] = 0,1,2,... denotes the level of the pyramid.

90 | 91 | After all the features are tracked, if tc->sequentialMode 92 | is TRUE, then the second image and its derivatives are stored in 93 | tc->pyramid_last, tc->pyramid_last_gradx, 94 | and tc->pyramid_last_grady.

95 | 96 |


97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /Tracke/klt/doc/ref/update_border.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 |

KLTUpdateTCBorder()

19 | 20 |

21 | 22 | void KLTUpdateTCBorder(
23 | KLT_TrackingContext tc);
24 |
25 |

26 | 27 | KLTUpdateTCBorder() is a convenience function that automatically recomputes 28 | and updates the borderx and bordery fields of the 29 | tracking context, so that the user doesn't have to ever touch these fields. 30 | Unless the user desires direct control over the border, 31 | this function should be called whenever 32 | smooth_sigma_fact, 33 | pyramid_sigma_fact, window_width, 34 | window_height, or 35 | subsampling is changed. 36 | 37 |
38 | 39 | -------------------------------------------------------------------------------- /Tracke/klt/doc/ref/verbosity.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 |

KLTSetVerbosity()

19 | 20 |

21 | 22 | void KLTSetVerbosity(
23 | int verbosity);
24 |
25 |

26 | 27 | KLTSetVerbosity() sets the verbosity. Currently there are only 28 | two levels: 29 |
    30 |
  • 0: forbids all printing to the screen 31 | (except for error and warning messages). 32 |
  • 1: provides feedback by printing sparse messages (the default). 33 |
34 | 35 |
36 | 37 | -------------------------------------------------------------------------------- /Tracke/klt/doc/ref/write.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 |

KLTWrite...() / KLTRead...()

19 | 20 |
21 | 22 |

23 | 24 | void KLTWriteFeatureListToPPM(
25 | KLT_TrackingContext tc,
26 | KLT_FeatureList fl,
27 | KLT_PixelType *greyimg,
28 | int ncols,
29 | int nrows,
30 | char *filename);
31 |
32 |

33 | 34 | KLTWriteFeatureListToPPM() writes the image pointed to by 35 | greyimg to the PPM file named 36 | filename. The features in 37 | fl are overlayed 38 | in red.

39 | 40 |


41 | 42 |

43 | 44 | void KLTWriteFeatureList(
45 | KLT_FeatureList fl,
46 | char *filename,
47 | char *fmt);

48 | void KLTWriteFeatureHistory(
49 | KLT_FeatureHistory fh,
50 | char *filename,
51 | char *fmt);

52 | void KLTWriteFeatureTable(
53 | KLT_FeatureTable ft,
54 | char *filename,
55 | char *fmt);

56 |
57 |

58 | 59 | These functions write feature lists, feature histories, and feature 60 | tables to a file named filename (or to stderr if filename is NULL). 61 | The third parameter, 'fmt', is either: 62 |
    63 |
  • NULL, indicating that a binary file is being created, or 64 |
  • a format string, indicating that a text file is being created. 65 | The string, which must begin with '%' and end with 'd' or 'f' (e.g., 66 | "%3d" or "%5.1f"), governs the printing of the feature 67 | locations (the feature values are always printed with "%5d"). 68 | For example, a particular feature 69 | will be written as "(128.2,364.8)= 7634" if 'fmt' is "%5.1f", or as 70 | "(128,365)= 7634" if 'fmt' is "%3d". 71 |
72 | Binary files are generally preferred since they are smaller and 73 | introduce no truncation error. However, text files permit easy 74 | viewing off-line. 75 |

76 | 77 |


78 | 79 |

80 | 81 | KLT_FeatureList KLTReadFeatureList(
82 | KLT_FeatureList fl,
83 | char *filename);

84 | KLT_FeatureHistory KLTReadFeatureHistory(
85 | KLT_FeatureHistory fh,
86 | char *filename);

87 | KLT_FeatureTable KLTReadFeatureTable(
88 | KLT_FeatureTable ft,
89 | char *filename);
90 |
91 |

92 | 93 | These functions read feature lists, feature histories, and feature 94 | tables from a file named 'filename' (The file may be either text or 95 | binary). If the first parameter is NULL, then a structure 96 | of the same size as that in the file is created, filled, 97 | and returned. Otherwise, the structure indicated by the first parameter 98 | is filled and returned. Note that 99 | the structure passed must be the same size as the structure in 100 | the file (i.e., the nFeatures field must be identical, as well as 101 | the nFrames field). 102 | 103 |
104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /Tracke/klt/doc/shi-tomasi-good-features-cvpr1994.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/doc/shi-tomasi-good-features-cvpr1994.pdf -------------------------------------------------------------------------------- /Tracke/klt/doc/toc_motif.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/doc/toc_motif.gif -------------------------------------------------------------------------------- /Tracke/klt/doc/up_motif.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/doc/up_motif.gif -------------------------------------------------------------------------------- /Tracke/klt/doc/user/backup: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | for file in `ls *.html` 4 | do 5 | cp $file `echo $file | sed s/'\.html'/"\.html~$1"/` 6 | done 7 | 8 | -------------------------------------------------------------------------------- /Tracke/klt/doc/user/chpt1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 |

Chapter 1: Introduction

20 | 21 | KLT has been designed to be easy to use. It should take no more than 22 | a few minutes to learn how to select and track features, and store 23 | and use the results. For those who wish to maximize performance, 24 | however, the program allows the flexibility of tweaking nearly every 25 | parameter that governs the computation, and it includes several 26 | methods to improve speed.

27 | 28 | This manual guides the user, in a tutorial fashion, through the 29 | essentials of KLT. Chapter 2 contains all that is needed to select 30 | good features, track them from one image to the next, and write the 31 | results. When features are lost (due to a large residue, drifting out 32 | of bounds, etc.), they can be replaced 33 | by finding features in the new image, a process which is described in 34 | Chapter 3. Chapter 4 explains a technique for speeding up the computation 35 | in the case of tracking through an image sequence. Chapter 5 describes 36 | an extension allowing the features from multiple frames to be stored 37 | in one data structure, which can then be saved to a file. Chapter 38 | 6 shows how to recall this structure and extract features from it. 39 | Finally, Chapter 7 shows how to customize the tracker by 40 | manually setting the various parameters.

41 | 42 | Most of these chapters contain example code, which is also provided with 43 | the distribution of KLT. To compile your own code, simply put the line 44 | #include "klt.h" near the top of your file, and link with 45 | the KLT library as in this example: cc file.c -lklt -lm.

46 | 47 |


48 | 49 | -------------------------------------------------------------------------------- /Tracke/klt/doc/user/chpt2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 |

Chapter 2: Selecting and Tracking Features

19 | 20 | Below is a sample program that selects the 100 best features in 21 | an image and tracks them in the next image. Instead of 22 | requiring images to be in a particular format, KLT needs only a 23 | pointer to the raw image data (in row-major format), along with 24 | the dimensions of the image. (The data is assumed to be unsigned 25 | char's, but this can be changed by 26 | modifying the code and recompiling.) We will now describe 27 | the code, line-by-line.

28 | 29 | The header file "pnmio.h" is necessary only for the helper 30 | function pgmReadFile, while "klt.h" must always be included 31 | in programs using KLT.

32 | 33 | KLTCreateTrackingContext() creates a tracking context, which 34 | is a structure containing various parameters (such as window size, 35 | sigma for Gaussian smoothing, minimum distance between features, etc.) 36 | that govern the computation. The nature of the structure is not 37 | important for now.

38 | 39 | KLTCreateFeatureList() creates a feature list, which is 40 | a structure containing all the features in a given image. 41 | The parameter of the function is the number of features desired.

42 | 43 | The helper function pgmReadFile() has been provided 44 | for reading PGM images, but it can be removed if the raw image 45 | data is obtained in another manner. Passing NULL as the second 46 | parameter causes pgmReadFile() to allocate memory for the image.

47 | 48 | KLTSelectGoodFeatures() finds the N best features 49 | in an image and stores them in a feature list in descending 50 | order of goodness. N is the size of the feature list (in this 51 | case 100). (Note: It is also possible to 52 | select all the features above a certain level of goodness, rather than 53 | just the N best features, by 54 | simply changing the min_eigenvalue field of the tracking context, 55 | as described in Chapter 7.)

56 | 57 | The for loop demonstrates how to access data in the 58 | feature list. 59 | A feature list is simply an array of fl->nFeatures 60 | features, where each feature has 61 | three members: x location, y location, and value. 62 | The first two are 63 | floats, and the second is an int. 64 | The location is given in pixels 65 | with the origin in the upper-left corner. The value is a constant 66 | multiplied by the minimum eigenvalue of the window surrounding the 67 | feature -- the larger the value, the better the feature. (NOTE: 68 | Because fl->nFeatures indicates the amount of memory allocated, 69 | it must not be changed by hand.)

70 | 71 | KLTWriteFeatureListToPPM() writes the grey-level image to 72 | a PPM file and overlays the features in red. This image can then 73 | be viewed with a tool like xv.

74 | 75 | KLTWriteFeatureList() writes the features to a file (If 76 | the second parameter is NULL, then the features are written to 77 | stderr instead). You will probably want to keep the 78 | third parameter NULL, which causes the file to be binary. Binary 79 | files are better because they are smaller and cause no truncation error. 80 | However, if a text file is desired, then the third parameter must be a 81 | string beginning with '%' and ending with either 'd' or 'f', as in 82 | "%3d" or "%5.1f", which specifies the format of the feature locations 83 | to be either decimal or floating point. 84 | Once the feature list is written, the file can be viewed off-line (if it 85 | is text) or read back into 86 | a feature list using the command KLTReadFeatureList().

87 | 88 | KLTTrackFeatures() tracks the features from the first image 89 | to the second image and overwrites the feature list. If a feature 90 | is successfully tracked, then its value becomes zero; otherwise, it becomes 91 | negative. Note that this function does not resort the features, 92 | but rather keeps them in place so that correspondences between the 93 | images are maintained. Chapter 5 describes the KLT_FeatureTable structure, 94 | which is useful for storing the feature list before it is overwritten.

95 | 96 | And that's all there is to selecting and tracking features. The remaining 97 | chapters describe various extensions that may be helpful.

98 | 99 |


100 | 101 |

Example 1

102 | 103 |
104 | /**********************************************************************
105 | Finds the 100 best features in an image, and tracks these
106 | features to the next image.  Saves the feature
107 | locations (before and after tracking) to text files and to PPM files, 
108 | and prints the features to the screen.
109 | **********************************************************************/
110 | 
111 | #include "pnmio.h"
112 | #include "klt.h"
113 | 
114 | void main()
115 | {
116 |      unsigned char *img1, *img2;
117 |      KLT_TrackingContext tc;
118 |      KLT_FeatureList fl;
119 |      int nFeatures = 100;
120 |      int ncols, nrows;
121 |      int i;
122 | 
123 |      tc = KLTCreateTrackingContext();
124 | 	KLTPrintTrackingContext(tc);
125 |      fl = KLTCreateFeatureList(nFeatures);
126 | 
127 |      img1 = pgmReadFile("img0.pgm", NULL, &ncols, &nrows);
128 |      img2 = pgmReadFile("img1.pgm", NULL, &ncols, &nrows);
129 | 
130 |      KLTSelectGoodFeatures(tc, img1, ncols, nrows, fl);
131 | 
132 |      printf("\nIn first image:\n");
133 |      for (i = 0 ; i < fl->nFeatures ; i++)  {
134 |           printf("Feature #%d:  (%f,%f) with value of %d\n",
135 |                i, fl->feature[i]->x, fl->feature[i]->y, fl->feature[i]->val);
136 |      }
137 | 
138 |      KLTWriteFeatureListToPPM(fl, img1, ncols, nrows, "feat1.ppm");
139 |      KLTWriteFeatureList(fl, "feat1.txt", "%3d");
140 | 
141 |      KLTTrackFeatures(tc, img1, img2, ncols, nrows, fl);
142 | 
143 |      printf("\nIn second image:\n");
144 |      for (i = 0 ; i < fl->nFeatures ; i++)  {
145 |           printf("Feature #%d:  (%f,%f) with value of %d\n",
146 |                i, fl->feature[i]->x, fl->feature[i]->y, fl->feature[i]->val);
147 |      }
148 | 
149 |      KLTWriteFeatureListToPPM(fl, img2, ncols, nrows, "feat2.ppm");
150 |      KLTWriteFeatureList(fl, "feat2.fl", NULL);  /* binary file */
151 |      KLTWriteFeatureList(fl, "feat2.txt", "%5.1f");  /* text file */
152 | }
153 | 
154 | 155 |
156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | -------------------------------------------------------------------------------- /Tracke/klt/doc/user/chpt3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 |

Chapter 3: Replacing Lost Features

19 | 20 | KLTTrackFeatures() sometimes loses features (either because 21 | they actually became occluded or go out of bounds, or because the computation fails 22 | for one reason or another). If it is desired to always maintain 23 | a certain number of features, e.g. 100, then the lost features can 24 | be replaced by calling KLTReplaceLostFeatures(). This function 25 | calls the same underlying computation as 26 | KLTSelectGoodFeatures() to 27 | find all the features in the image and rank them accordingly. 28 | Then, if k features have been lost, the k best 29 | features are used to replace them.

30 | 31 | Below is sample code using this function. 32 | 33 |


34 | 35 |

Example 2

36 | 37 |
38 | /**********************************************************************
39 | Finds the 100 best features in an image, tracks these
40 | features to the next image, and replaces the lost features with new
41 | features in the second image.  Saves the feature
42 | locations (before and after tracking) to text files and to PPM files.
43 | **********************************************************************/
44 | 
45 | #include "pnmio.h"
46 | #include "klt.h"
47 | 
48 | void main()
49 | {
50 |      unsigned char *img1, *img2;
51 |      KLT_TrackingContext tc;
52 |      KLT_FeatureList fl;
53 |      int nFeatures = 100;
54 |      int ncols, nrows;
55 | 
56 |      tc = KLTCreateTrackingContext();
57 |      fl = KLTCreateFeatureList(nFeatures);
58 | 
59 |      img1 = pgmReadFile("img0.pgm", NULL, &ncols, &nrows);
60 |      img2 = pgmReadFile("img1.pgm", NULL, &ncols, &nrows);
61 | 
62 |      KLTSelectGoodFeatures(tc, img1, ncols, nrows, fl);
63 | 
64 |      KLTWriteFeatureListToPPM(fl, img1, ncols, nrows, "feat1.ppm");
65 |      KLTWriteFeatureList(fl, "feat1.txt", "%3d");
66 | 
67 |      KLTTrackFeatures(tc, img1, img2, ncols, nrows, fl);
68 |      KLTReplaceLostFeatures(tc, img2, ncols, nrows, fl);
69 | 
70 |      KLTWriteFeatureListToPPM(fl, img2, ncols, nrows, "feat2.ppm");
71 |      KLTWriteFeatureList(fl, "feat2.txt", "%3d");
72 | }
73 | 
74 | 75 |
76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /Tracke/klt/doc/user/chpt4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 |

Chapter 4: Speeding Up the Process 19 | (of Tracking through an Image Sequence)

20 | 21 | In the two functions KLTTrackFeatures() and 22 | KLTReplaceLostFeatures(), the majority of the computing time is taken 23 | up by convolution, which 24 | is necessary both to smooth the image and to compute its gradients. 25 | Much of this convolution is unnecessary 26 | when an image sequence is being processed, 27 | because each image is processed more than once. For 28 | example, the features are tracked between frames 0 and 1, then between 29 | frames 1 and 2, then between frames 2 and 3, etc. During each iteration 30 | the second image, after being processed, can be stored and recalled 31 | the next time as the first image.

32 | 33 | The tracking context has a member called sequentialMode which, 34 | when set to TRUE, 35 | causes KLTTrackFeatures() to store the gradients of the second image, 36 | along with its smoothed version, into the tracking context. 37 | When KLTTrackFeatures() is called, it ignores its second parameter and 38 | replaces it with the previously stored image (except for the first 39 | time the function is called, in which case it must use both images); 40 | in the same way, KLTReplaceLostFeatures() also ignores its second parameter. 41 | The computation is identical, but the speed is improved.

42 | 43 | WARNING: If it is desired to turn the sequential mode off after 44 | it has been set 45 | and KLTTrackFeatures() has been called, do NOT simply set 46 | tc->sequentialMode to FALSE. You must call 47 | KLTStopSequentialMode(), which deletes the images. 48 | Otherwise, the next call to 49 | KLTTrackFeatures() will use the previously computed images, 50 | even though they are no longer valid.

51 | 52 | Sample code demonstrating the use of the sequential mode is 53 | delayed until the next chapter. 54 | 55 |


56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /Tracke/klt/doc/user/chpt5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 |

Chapter 5: Storing All the Features in a Single Structure/File

19 | 20 | Up to now, all the features have been contained in a feature list, 21 | which is overwritten when the features are tracked. Sometimes, however, 22 | it is desirable to keep the features from the last frame, or from the 23 | last few frames, or from all the frames. In these cases, it would be 24 | tedious to have to create a new feature list for each image. Instead, 25 | we create what is called a feature table. 26 | While a feature list is a one-dimensional array of features from a 27 | single image, a feature table is a two-dimensional array of features 28 | from many images. Each column of the table is a feature list.

29 | 30 | The sample code below shows the use of the sequential mode from the 31 | last chapter, as well as the use of a feature table. 32 | If the constant REPLACE is defined, then lost features 33 | are replaced; otherwise they are not. In the former case, new 34 | features can be identified in the table because they have positive 35 | (rather than zero) values. Now let us examine the unfamiliar lines of 36 | code.

37 | 38 | KLTCreateFeatureTable() creates a feature table, given the 39 | number of frames and the number 40 | of features to store. Although in this example the number of frames is 41 | the same as the total number of actual images, this does not have to be 42 | the case if all the features do not need to be stored.

43 | 44 | KLTStoreFeatureList() stores a feature list as the ith 45 | column of a feature table, where i is given by the third parameter 46 | (i must be between 0 and 47 | fl->nFeatures-1). 48 | The dimensions of the feature list and feature table must be compatible, 49 | meaning that they must both contain the same number of features. 50 | It is perfectly legal to overwrite a column that has already been used, 51 | although this is not done in the current example.

52 | 53 | KLTWriteFeatureTable() writes a feature table to a file, in 54 | a manner similar to that of KLTWriteFeatureList(), which was 55 | described in Chapter 2.

56 | 57 | NOTE: To facilitate easy distribution, only three images are included 58 | with the code, making this example less impressive than it otherwise 59 | would be; however, it does demonstrate the principle. If desired, more 60 | images can be obtained from the 61 | installation page (item 7), 62 | and the code below can be easily modified to track through all 63 | ten frames, by setting nFrames = 10.

64 | 65 |


66 | 67 |

Example 3

68 | 69 |
 70 | /**********************************************************************
 71 | Finds the 150 best features in an image and tracks them through the 
 72 | next two images.  The sequential mode is set in order to speed
 73 | processing.  The features are stored in a feature table, which is then
 74 | saved to a text file; each feature list is also written to a PPM file.
 75 | **********************************************************************/
 76 | 
 77 | #include <stdlib.h>
 78 | #include <stdio.h>
 79 | #include "pnmio.h"
 80 | #include "klt.h"
 81 | 
 82 | #define REPLACE
 83 | 
 84 | void main()
 85 | {
 86 |      unsigned char *img1, *img2;
 87 |      char fnamein[100], fnameout[100];
 88 |      KLT_TrackingContext tc;
 89 |      KLT_FeatureList fl;
 90 |      KLT_FeatureTable ft;
 91 |      int nFeatures = 150, nFrames = 3;
 92 |      int ncols, nrows;
 93 |      int i;
 94 | 
 95 |      tc = KLTCreateTrackingContext();
 96 |      fl = KLTCreateFeatureList(nFeatures);
 97 |      ft = KLTCreateFeatureTable(nFrames, nFeatures);
 98 |      tc->sequentialMode = TRUE;
 99 | 
100 |      img1 = pgmReadFile("img0.pgm", NULL, &ncols, &nrows);
101 |      img2 = (unsigned char *) malloc(ncols*nrows*sizeof(unsigned char));
102 | 
103 |      KLTSelectGoodFeatures(tc, img1, ncols, nrows, fl);
104 |      KLTStoreFeatureList(fl, ft, 0);
105 |      KLTWriteFeatureListToPPM(fl, img1, ncols, nrows, "feat0.ppm");
106 | 
107 |      for (i = 1 ; i < nFrames ; i++)  {
108 |           sprintf(fnamein, "img%d.pgm", i);
109 |           pgmReadFile(fnamein, img2, &ncols, &nrows);
110 |           KLTTrackFeatures(tc, img1, img2, ncols, nrows, fl);
111 | #ifdef REPLACE
112 |           KLTReplaceLostFeatures(tc, img2, ncols, nrows, fl);
113 | #endif
114 |           KLTStoreFeatureList(fl, ft, i);
115 |           sprintf(fnameout, "feat%d.ppm", i);
116 |           KLTWriteFeatureListToPPM(fl, img2, ncols, nrows, fnameout);
117 |      }
118 |      KLTWriteFeatureTable(ft, "features.txt", "%5.1f");
119 | }
120 | 
121 | 122 |
123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | -------------------------------------------------------------------------------- /Tracke/klt/doc/user/chpt6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 |

Chapter 6: Reading from Files and Storing/Extracting Between Structures

19 | 20 | Now that we have tracked the features through the entire image 21 | sequence and have saved the result to a file, we can read the 22 | file and access the data without having to process the images again. 23 | The following example shows how this is done. Once again, we will examine the 24 | unfamiliar lines.

25 | 26 | KLTReadFeatureTable() reads the feature table from the 27 | file "features.txt". Since the first parameter is NULL, a feature 28 | table of the appropriate size is created and returned.

29 | 30 | KLTExtractFeatureList() copies the (i+1)th column of 31 | a feature table into a feature list, where i is given by the 32 | third parameter (in this case 1). In other words, i=0 refers to 33 | the first column.

34 | 35 | Although in this example the call KLTReadFeatureList() is 36 | unnecessary, it is given here to show its syntax, which is identical 37 | to that of KLTReadFeatureTable(). Because the first parameter is 38 | not NULL, the data is written into the given feature list.

39 | 40 | KLTStoreFeatureList() copies a feature list into a 41 | particular column of a feature table (in this case the third column, for 42 | which i=2). Now, the 43 | second and third columns of the table are identical.

44 | 45 | The second half of this example involves a feature history, 46 | which is a single row of a feature table in the same way 47 | that a feature list is a single column. That is, a feature 48 | history contains a particular features' locations in all the 49 | frames. The syntax for dealing with a feature history is identical to 50 | that of a feature list and should be clear from the example.

51 | 52 | NOTE: Unlike this example, in which every KLTWriteFeature...() call 53 | produces a text file, you will most likely want to produce binary 54 | files. See the explanation in Chapter 2.

55 | 56 |


57 | 58 |

Example 4

59 | 60 |
 61 | /**********************************************************************
 62 | Reads the feature table from "features.txt", copies the features from 
 63 | the second frame to those of the third frame, writes the features to 
 64 | "feat2.txt", and writes the new feature table to "ft2.txt".  Then the
 65 | eighth feature is overwritten with the fifth feature, and the resulting
 66 | table is saved to "ft3.txt".
 67 | **********************************************************************/
 68 | 
 69 | #include <stdio.h>
 70 | #include "klt.h"
 71 | 
 72 | void main()
 73 | {
 74 |      KLT_FeatureList fl;
 75 |      KLT_FeatureHistory fh;
 76 |      KLT_FeatureTable ft;
 77 |      int i;
 78 | 
 79 |      ft = KLTReadFeatureTable(NULL, "features.txt");
 80 |      fl = KLTCreateFeatureList(ft->nFeatures);
 81 |      KLTExtractFeatureList(fl, ft, 1);
 82 |      KLTWriteFeatureList(fl, "feat1.txt", "%3d");
 83 |      KLTReadFeatureList(fl, "feat1.txt");
 84 |      KLTStoreFeatureList(fl, ft, 2);
 85 |      KLTWriteFeatureTable(ft, "ft2.txt", "%3d");
 86 | 
 87 |      fh = KLTCreateFeatureHistory(ft->nFrames);
 88 |      KLTExtractFeatureHistory(fh, ft, 5);
 89 | 
 90 |      printf("The feature history of feature number 5:\n\n");
 91 |      for (i = 0 ; i < fh->nFrames ; i++)
 92 |           printf("%d: (%5.1f,%5.1f) = %d\n",
 93 |                i, fh->feature[i]->x, fh->feature[i]->y, fh->feature[i]->val);
 94 | 
 95 |      KLTStoreFeatureHistory(fh, ft, 8);
 96 |      KLTWriteFeatureTable(ft, "ft3.txt", "%6.1f");
 97 | }
 98 | 
99 | 100 |
101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | -------------------------------------------------------------------------------- /Tracke/klt/doc/user/chpt7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 |

Chapter 7: Customizing the Tracker

19 | 20 | Because computer vision is an experimental science, feature tracking 21 | cannot be accomplished without introducing parameters that must 22 | be empirically determined. These parameters are hopefully stable 23 | enough that they can be considered constant and therefore ignored; 24 | nevertheless, KLT provides access to nearly all the parameters for those 25 | users who wish to change them. 26 | As mentioned in Chapters 1 and 2, these parameters 27 | are contained in the tracking context, whose members we now list, along 28 | with a brief description of each:

29 |

 30 | int mindist;              /* minimum distance between selected features */
 31 | int window_width;         /* dimensions of feature window */
 32 | int window_height;                       "
 33 | KLT_BOOL sequentialMode;  /* whether to save most recent image */
 34 | KLT_BOOL smoothBeforeSelecting; /* whether to smooth image before selecting features */
 35 | KLT_BOOL writeInternalImages;   /* whether to write internal images for later viewing */
 36 | int min_eigenvalue;       /* smallest eigenvalue allowed for selecting */
 37 | float min_determinant;    /* min determinant for declaring tracking failure */
 38 | float min_displacement;   /* amount of pixel shift for stopping tracking iterations */
 39 | int max_iterations;       /* max iterations before declaring tracking failure */
 40 | float max_residue;        /* max residue before declaring tracking failure */
 41 | float grad_sigma;         /* sigma of gaussian for computing gradient */
 42 | float smooth_sigma_fact;  /* sigma factor of gaussian for smoothing image */
 43 | float pyramid_sigma_fact; /* sigma factor of gaussian for computing image pyramid */
 44 | int nSkippedPixels;       /* used to speed up feature selection */
 45 | int borderx;              /* border in which features will not be selected, and */
 46 | int bordery;              /*    tracked features will be declared out-of-bounds */
 47 | int nPyramidLevels;       /* number of pyramid levels */
 48 | int subsampling;          /* amount of subsampling between pyramid levels */
 49 | 
50 | (There are three additional members which point to the most recent image 51 | when the sequential mode is set, but these should never be accessed directly 52 | by the user. A complete description of the tracking context parameters can be 53 | found in the reference manual.)

54 | 55 | All of these members are initialized to default values when the tracking 56 | context is created. Afterwards, they can be read and changed at leisure. 57 | The only exception is that sequentialMode must be set to FALSE 58 | via the function KLTStopSequentialMode().

59 | 60 | A convenience function named KLTChangeTCPyramid() is 61 | provided for changing nPyramidLevels and 62 | subsampling. This function 63 | accepts the maximum search range as input, and computes and changes the 64 | two members accordingly. Therefore, the user can control these rather 65 | low-level parameters from a more high-level, intuitive objective. If 66 | desired, however, these members can be changed directly.

67 | 68 | Another convenience function, KLTUpdateTCBorder(), automatically 69 | recomputes the borderx and bordery fields, 70 | which are dependent upon smooth_sigma_fact, 71 | pyramid_sigma_fact, window_width, 72 | window_height, 73 | and subsampling. 74 | Unless the user desires 75 | direct control over the border, 76 | this function should be called whenever 77 | one of these parameters is changed.

78 | 79 | The example below illustrates how to change some of the parameters. 80 | It should be self-explanatory.

81 | 82 |


83 | 84 |

Example 5

85 | 86 |
 87 | /**********************************************************************
 88 | Demonstrates manually tweaking the tracking context parameters.
 89 | **********************************************************************/
 90 | 
 91 | #include "pnmio.h"
 92 | #include "klt.h"
 93 | 
 94 | void main()
 95 | {
 96 |      unsigned char *img1, *img2;
 97 |      KLT_TrackingContext tc;
 98 |      KLT_FeatureList fl;
 99 |      int nFeatures = 100;
100 |      int ncols, nrows;
101 | 
102 |      tc = KLTCreateTrackingContext();
103 |      tc->mindist = 20;
104 |      tc->window_width  = 9;
105 |      tc->window_height = 9;
106 |      KLTChangeTCPyramid(tc, 15);
107 |      KLTUpdateTCBorder(tc);
108 |      fl = KLTCreateFeatureList(nFeatures);
109 | 
110 |      img1 = pgmReadFile("img0.pgm", NULL, &ncols, &nrows);
111 |      img2 = pgmReadFile("img2.pgm", NULL, &ncols, &nrows);
112 | 
113 |      KLTSelectGoodFeatures(tc, img1, ncols, nrows, fl);
114 | 
115 |      KLTWriteFeatureListToPPM(fl, img1, ncols, nrows, "feat1b.ppm");
116 | 
117 |      KLTTrackFeatures(tc, img1, img2, ncols, nrows, fl);
118 | 
119 |      KLTWriteFeatureListToPPM(fl, img2, ncols, nrows, "feat2b.ppm");
120 | }
121 | 
122 | 123 |
124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | -------------------------------------------------------------------------------- /Tracke/klt/doc/user/index.html: -------------------------------------------------------------------------------- 1 | KLT Tutorial / User's Manual 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 |

Tutorial / User's Manual

21 | 22 | 34 | 35 |
36 | -------------------------------------------------------------------------------- /Tracke/klt/doc/user/noUchar.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |

Using Image Data Other than Unsigned Chars

6 | 7 | Typically, grey-level images are stored as unsigned chars, and 8 | KLT assumes the same. However, if this is not the case, then 9 | KLT can be modified by changing the line 10 | 11 |
12 | typedef unsigned char KLT_PixelType; 13 |
14 | 15 | in the file klt.h. This has not been tested, but it 16 | should work. The only function that will no longer work properly 17 | is KLTWriteFeatureListToPPM, because the image will now contain 18 | more than eight bytes per pixel. 19 | 20 |
21 | 22 | -------------------------------------------------------------------------------- /Tracke/klt/klt_track.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WangLCG/Image_Process/e6ada3ee5785b39c97155cde6a8abc1c57cefb05/Tracke/klt/klt_track.gif --------------------------------------------------------------------------------