├── .gitattributes ├── .gitignore ├── CS549_ObjectDetection.sdf ├── CS549_ObjectDetection.sln ├── CS549_ObjectDetection.v12.suo ├── CS549_ObjectDetection ├── CS549_ObjectDetection.vcxproj ├── CS549_ObjectDetection.vcxproj.filters ├── ColorRecognition.cpp ├── Debug │ ├── CS549_Ob.0CEDAC80.tlog │ │ ├── CL.read.1.tlog │ │ ├── CL.write.1.tlog │ │ ├── CS549_ObjectDetection.lastbuildstate │ │ ├── cl.command.1.tlog │ │ ├── link.command.1.tlog │ │ ├── link.read.1.tlog │ │ └── link.write.1.tlog │ ├── CS549_ObjectDetection.Build.CppClean.log │ ├── CS549_ObjectDetection.log │ └── vc120.idb ├── Global.cpp ├── Global.h ├── ImageDisplay.cpp ├── Main.cpp ├── PeopleDetect.cpp ├── Res │ └── genfiles │ │ └── svmparam.txt ├── Shape_Multi.cpp ├── TriangleImage.cpp ├── Utility.h ├── cam_color.cpp ├── libsvm │ └── libsvm.h └── svmlight │ ├── kernel.h │ ├── svm_classify.c │ ├── svm_common.c │ ├── svm_common.h │ ├── svm_hideo.c │ ├── svm_learn.c │ ├── svm_learn.h │ └── svmlight.h ├── Debug ├── Res │ └── genfiles │ │ └── svmparam.txt ├── opencv_calib3d2410d.dll ├── opencv_contrib2410d.dll ├── opencv_core2410d.dll ├── opencv_features2d2410d.dll ├── opencv_flann2410d.dll ├── opencv_gpu2410d.dll ├── opencv_highgui2410d.dll ├── opencv_imgproc2410d.dll ├── opencv_legacy2410d.dll ├── opencv_ml2410d.dll ├── opencv_nonfree2410d.dll ├── opencv_objdetect2410d.dll ├── opencv_ocl2410d.dll ├── opencv_photo2410d.dll ├── opencv_stitching2410d.dll ├── opencv_superres2410d.dll ├── opencv_video2410d.dll └── opencv_videostab2410d.dll ├── OpenCV ├── ReadMe.txt ├── bin │ ├── opencv_calib3d2410.dll │ ├── opencv_calib3d2410d.dll │ ├── opencv_contrib2410.dll │ ├── opencv_contrib2410d.dll │ ├── opencv_core2410.dll │ ├── opencv_core2410d.dll │ ├── opencv_features2d2410.dll │ ├── opencv_features2d2410d.dll │ ├── opencv_flann2410.dll │ ├── opencv_flann2410d.dll │ ├── opencv_gpu2410.dll │ ├── opencv_gpu2410d.dll │ ├── opencv_highgui2410.dll │ ├── opencv_highgui2410d.dll │ ├── opencv_imgproc2410.dll │ ├── opencv_imgproc2410d.dll │ ├── opencv_legacy2410.dll │ ├── opencv_legacy2410d.dll │ ├── opencv_ml2410.dll │ ├── opencv_ml2410d.dll │ ├── opencv_objdetect2410.dll │ ├── opencv_objdetect2410d.dll │ ├── opencv_video2410.dll │ └── opencv_video2410d.dll ├── include │ ├── opencv │ │ ├── cv.h │ │ ├── cv.hpp │ │ ├── cvaux.h │ │ ├── cvaux.hpp │ │ ├── cvwimage.h │ │ ├── cxcore.h │ │ ├── cxcore.hpp │ │ ├── cxeigen.hpp │ │ ├── cxmisc.h │ │ ├── highgui.h │ │ └── ml.h │ └── opencv2 │ │ ├── calib3d │ │ └── calib3d.hpp │ │ ├── contrib │ │ ├── contrib.hpp │ │ ├── detection_based_tracker.hpp │ │ ├── hybridtracker.hpp │ │ ├── openfabmap.hpp │ │ └── retina.hpp │ │ ├── core │ │ ├── affine.hpp │ │ ├── core.hpp │ │ ├── core_c.h │ │ ├── cuda_devptrs.hpp │ │ ├── devmem2d.hpp │ │ ├── eigen.hpp │ │ ├── gpumat.hpp │ │ ├── internal.hpp │ │ ├── mat.hpp │ │ ├── opengl_interop.hpp │ │ ├── opengl_interop_deprecated.hpp │ │ ├── operations.hpp │ │ ├── types_c.h │ │ ├── version.hpp │ │ └── wimage.hpp │ │ ├── features2d │ │ └── features2d.hpp │ │ ├── flann │ │ ├── all_indices.h │ │ ├── allocator.h │ │ ├── any.h │ │ ├── autotuned_index.h │ │ ├── composite_index.h │ │ ├── config.h │ │ ├── defines.h │ │ ├── dist.h │ │ ├── dummy.h │ │ ├── dynamic_bitset.h │ │ ├── flann.hpp │ │ ├── flann_base.hpp │ │ ├── general.h │ │ ├── ground_truth.h │ │ ├── hdf5.h │ │ ├── heap.h │ │ ├── hierarchical_clustering_index.h │ │ ├── index_testing.h │ │ ├── kdtree_index.h │ │ ├── kdtree_single_index.h │ │ ├── kmeans_index.h │ │ ├── linear_index.h │ │ ├── logger.h │ │ ├── lsh_index.h │ │ ├── lsh_table.h │ │ ├── matrix.h │ │ ├── miniflann.hpp │ │ ├── nn_index.h │ │ ├── object_factory.h │ │ ├── params.h │ │ ├── random.h │ │ ├── result_set.h │ │ ├── sampling.h │ │ ├── saving.h │ │ ├── simplex_downhill.h │ │ └── timer.h │ │ ├── gpu │ │ ├── device │ │ │ ├── block.hpp │ │ │ ├── border_interpolate.hpp │ │ │ ├── color.hpp │ │ │ ├── common.hpp │ │ │ ├── datamov_utils.hpp │ │ │ ├── detail │ │ │ │ ├── color_detail.hpp │ │ │ │ ├── reduce.hpp │ │ │ │ ├── reduce_key_val.hpp │ │ │ │ ├── transform_detail.hpp │ │ │ │ ├── type_traits_detail.hpp │ │ │ │ └── vec_distance_detail.hpp │ │ │ ├── dynamic_smem.hpp │ │ │ ├── emulation.hpp │ │ │ ├── filters.hpp │ │ │ ├── funcattrib.hpp │ │ │ ├── functional.hpp │ │ │ ├── limits.hpp │ │ │ ├── reduce.hpp │ │ │ ├── saturate_cast.hpp │ │ │ ├── scan.hpp │ │ │ ├── simd_functions.hpp │ │ │ ├── static_check.hpp │ │ │ ├── transform.hpp │ │ │ ├── type_traits.hpp │ │ │ ├── utility.hpp │ │ │ ├── vec_distance.hpp │ │ │ ├── vec_math.hpp │ │ │ ├── vec_traits.hpp │ │ │ ├── warp.hpp │ │ │ ├── warp_reduce.hpp │ │ │ └── warp_shuffle.hpp │ │ ├── devmem2d.hpp │ │ ├── gpu.hpp │ │ ├── gpumat.hpp │ │ └── stream_accessor.hpp │ │ ├── highgui │ │ ├── cap_ios.h │ │ ├── highgui.hpp │ │ ├── highgui_c.h │ │ └── ios.h │ │ ├── imgproc │ │ ├── imgproc.hpp │ │ ├── imgproc_c.h │ │ └── types_c.h │ │ ├── legacy │ │ ├── blobtrack.hpp │ │ ├── compat.hpp │ │ ├── legacy.hpp │ │ └── streams.hpp │ │ ├── ml │ │ └── ml.hpp │ │ ├── nonfree │ │ ├── features2d.hpp │ │ ├── gpu.hpp │ │ ├── nonfree.hpp │ │ └── ocl.hpp │ │ ├── objdetect │ │ └── objdetect.hpp │ │ ├── ocl │ │ ├── matrix_operations.hpp │ │ └── ocl.hpp │ │ ├── opencv.hpp │ │ ├── opencv_modules.hpp │ │ ├── photo │ │ ├── photo.hpp │ │ └── photo_c.h │ │ ├── stitching │ │ ├── detail │ │ │ ├── autocalib.hpp │ │ │ ├── blenders.hpp │ │ │ ├── camera.hpp │ │ │ ├── exposure_compensate.hpp │ │ │ ├── matchers.hpp │ │ │ ├── motion_estimators.hpp │ │ │ ├── seam_finders.hpp │ │ │ ├── util.hpp │ │ │ ├── util_inl.hpp │ │ │ ├── warpers.hpp │ │ │ └── warpers_inl.hpp │ │ ├── stitcher.hpp │ │ └── warpers.hpp │ │ ├── superres │ │ ├── optical_flow.hpp │ │ └── superres.hpp │ │ ├── ts │ │ ├── gpu_perf.hpp │ │ ├── gpu_test.hpp │ │ ├── ts.hpp │ │ ├── ts_gtest.h │ │ └── ts_perf.hpp │ │ ├── video │ │ ├── background_segm.hpp │ │ ├── tracking.hpp │ │ └── video.hpp │ │ └── videostab │ │ ├── deblurring.hpp │ │ ├── fast_marching.hpp │ │ ├── fast_marching_inl.hpp │ │ ├── frame_source.hpp │ │ ├── global_motion.hpp │ │ ├── inpainting.hpp │ │ ├── log.hpp │ │ ├── motion_stabilizing.hpp │ │ ├── optical_flow.hpp │ │ ├── stabilizer.hpp │ │ └── videostab.hpp ├── lib - backup │ ├── opencv_calib3d2410.lib │ ├── opencv_calib3d2410d.lib │ ├── opencv_contrib2410.lib │ ├── opencv_contrib2410d.lib │ ├── opencv_core2410.lib │ ├── opencv_core2410d.lib │ ├── opencv_features2d2410.lib │ ├── opencv_features2d2410d.lib │ ├── opencv_flann2410.lib │ ├── opencv_flann2410d.lib │ ├── opencv_gpu2410.lib │ ├── opencv_gpu2410d.lib │ ├── opencv_highgui2410.lib │ ├── opencv_highgui2410d.lib │ ├── opencv_imgproc2410.lib │ ├── opencv_imgproc2410d.lib │ ├── opencv_legacy2410.lib │ ├── opencv_legacy2410d.lib │ ├── opencv_ml2410.lib │ ├── opencv_ml2410d.lib │ ├── opencv_objdetect2410.lib │ ├── opencv_objdetect2410d.lib │ ├── opencv_video2410.lib │ └── opencv_video2410d.lib └── lib │ ├── opencv_calib3d2410.lib │ ├── opencv_calib3d2410d.lib │ ├── opencv_contrib2410.lib │ ├── opencv_contrib2410d.lib │ ├── opencv_core2410.lib │ ├── opencv_core2410d.lib │ ├── opencv_features2d2410.lib │ ├── opencv_features2d2410d.lib │ ├── opencv_flann2410.lib │ ├── opencv_flann2410d.lib │ ├── opencv_gpu2410.lib │ ├── opencv_gpu2410d.lib │ ├── opencv_highgui2410.lib │ ├── opencv_highgui2410d.lib │ ├── opencv_imgproc2410.lib │ ├── opencv_imgproc2410d.lib │ ├── opencv_legacy2410.lib │ ├── opencv_legacy2410d.lib │ ├── opencv_ml2410.lib │ ├── opencv_ml2410d.lib │ ├── opencv_nonfree2410.lib │ ├── opencv_nonfree2410d.lib │ ├── opencv_objdetect2410.lib │ ├── opencv_objdetect2410d.lib │ ├── opencv_ocl2410.lib │ ├── opencv_ocl2410d.lib │ ├── opencv_photo2410.lib │ ├── opencv_photo2410d.lib │ ├── opencv_stitching2410.lib │ ├── opencv_stitching2410d.lib │ ├── opencv_superres2410.lib │ ├── opencv_superres2410d.lib │ ├── opencv_ts2410.lib │ ├── opencv_ts2410d.lib │ ├── opencv_video2410.lib │ ├── opencv_video2410d.lib │ ├── opencv_videostab2410.lib │ └── opencv_videostab2410d.lib ├── README.md └── Release ├── opencv_calib3d2410.dll ├── opencv_contrib2410.dll ├── opencv_core2410.dll ├── opencv_features2d2410.dll ├── opencv_ffmpeg2410.dll ├── opencv_flann2410.dll ├── opencv_gpu2410.dll ├── opencv_highgui2410.dll ├── opencv_imgproc2410.dll ├── opencv_legacy2410.dll ├── opencv_ml2410.dll ├── opencv_nonfree2410.dll ├── opencv_objdetect2410.dll ├── opencv_ocl2410.dll ├── opencv_photo2410.dll ├── opencv_stitching2410.dll ├── opencv_superres2410.dll ├── opencv_video2410.dll └── opencv_videostab2410.dll /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | #Resource 18 | *.jpg 19 | *.JPG 20 | *.png 21 | *.PNG 22 | *.dat 23 | *.pdb 24 | *.exe 25 | *.ilk 26 | *.obj 27 | 28 | # ========================= 29 | # Operating System Files 30 | # ========================= 31 | 32 | # OSX 33 | # ========================= 34 | 35 | .DS_Store 36 | .AppleDouble 37 | .LSOverride 38 | 39 | # Icon must end with two \r 40 | Icon 41 | 42 | # Thumbnails 43 | ._* 44 | 45 | # Files that might appear on external disk 46 | .Spotlight-V100 47 | .Trashes 48 | 49 | # Directories potentially created on remote AFP share 50 | .AppleDB 51 | .AppleDesktop 52 | Network Trash Folder 53 | Temporary Items 54 | .apdisk 55 | -------------------------------------------------------------------------------- /CS549_ObjectDetection.sdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/CS549_ObjectDetection.sdf -------------------------------------------------------------------------------- /CS549_ObjectDetection.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.21005.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CS549_ObjectDetection", "CS549_ObjectDetection\CS549_ObjectDetection.vcxproj", "{0CEDAC80-9557-46FE-9536-D0DD660A98DB}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {0CEDAC80-9557-46FE-9536-D0DD660A98DB}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {0CEDAC80-9557-46FE-9536-D0DD660A98DB}.Debug|Win32.Build.0 = Debug|Win32 16 | {0CEDAC80-9557-46FE-9536-D0DD660A98DB}.Release|Win32.ActiveCfg = Release|Win32 17 | {0CEDAC80-9557-46FE-9536-D0DD660A98DB}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /CS549_ObjectDetection.v12.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/CS549_ObjectDetection.v12.suo -------------------------------------------------------------------------------- /CS549_ObjectDetection/CS549_ObjectDetection.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 | {6da58137-3f3d-435c-8494-018cb2ba6843} 18 | 19 | 20 | {fb8d7856-37ac-4404-b7ad-63897967210a} 21 | 22 | 23 | 24 | 25 | Header Files 26 | 27 | 28 | Resource Files\SVM 29 | 30 | 31 | Resource Files\SVM 32 | 33 | 34 | Resource Files\SVM 35 | 36 | 37 | Resource Files\SVM 38 | 39 | 40 | Resource Files\SVM 41 | 42 | 43 | Header Files 44 | 45 | 46 | 47 | 48 | Source Files 49 | 50 | 51 | Source Files 52 | 53 | 54 | Resource Files\SVM 55 | 56 | 57 | Resource Files\SVM 58 | 59 | 60 | Resource Files\SVM 61 | 62 | 63 | Resource Files\SVM 64 | 65 | 66 | Source Files 67 | 68 | 69 | Resource Files\Samples 70 | 71 | 72 | Resource Files\Samples 73 | 74 | 75 | Resource Files\Samples 76 | 77 | 78 | Resource Files\Samples 79 | 80 | 81 | Resource Files\Samples 82 | 83 | 84 | -------------------------------------------------------------------------------- /CS549_ObjectDetection/ColorRecognition.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Description : Color recognition, detecting red color with video capture. 3 | Source : http://opencv-srf.blogspot.ro/2010/09/object-detection-using-color-seperation.html 4 | */ 5 | 6 | #include"Utility.h" 7 | 8 | #ifdef SAMPLE_COLOR 9 | int main() 10 | #else 11 | int sample_color_main() 12 | #endif 13 | { 14 | VideoCapture cap(0); //capture the video from web cam 15 | 16 | if (!cap.isOpened()) // if not success, exit program 17 | { 18 | cout << "Cannot open the web cam" << endl; 19 | return -1; 20 | } 21 | 22 | namedWindow("Control", CV_WINDOW_AUTOSIZE); //create a window called "Control" 23 | 24 | int iLowH = 0; 25 | int iHighH = 179; 26 | 27 | int iLowS = 0; 28 | int iHighS = 255; 29 | 30 | int iLowV = 0; 31 | int iHighV = 255; 32 | 33 | //Create trackbars in "Control" window 34 | cvCreateTrackbar("LowH", "Control", &iLowH, 179); //Hue (0 - 179) 35 | cvCreateTrackbar("HighH", "Control", &iHighH, 179); 36 | 37 | cvCreateTrackbar("LowS", "Control", &iLowS, 255); //Saturation (0 - 255) 38 | cvCreateTrackbar("HighS", "Control", &iHighS, 255); 39 | 40 | cvCreateTrackbar("LowV", "Control", &iLowV, 255);//Value (0 - 255) 41 | cvCreateTrackbar("HighV", "Control", &iHighV, 255); 42 | 43 | while (true) 44 | { 45 | Mat imgOriginal; 46 | 47 | bool bSuccess = cap.read(imgOriginal); // read a new frame from video 48 | 49 | if (!bSuccess) //if not success, break loop 50 | { 51 | cout << "Cannot read a frame from video stream" << endl; 52 | break; 53 | } 54 | 55 | Mat imgHSV; 56 | 57 | cvtColor(imgOriginal, imgHSV, COLOR_BGR2HSV); //Convert the captured frame from BGR to HSV 58 | 59 | Mat imgThresholded; 60 | 61 | inRange(imgHSV, Scalar(iLowH, iLowS, iLowV), Scalar(iHighH, iHighS, iHighV), imgThresholded); //Threshold the image 62 | 63 | //morphological opening (removes small objects from the foreground) 64 | erode(imgThresholded, imgThresholded, getStructuringElement(MORPH_ELLIPSE, Size(5, 5))); 65 | dilate(imgThresholded, imgThresholded, getStructuringElement(MORPH_ELLIPSE, Size(5, 5))); 66 | 67 | //morphological closing (removes small holes from the foreground) 68 | dilate(imgThresholded, imgThresholded, getStructuringElement(MORPH_ELLIPSE, Size(5, 5))); 69 | erode(imgThresholded, imgThresholded, getStructuringElement(MORPH_ELLIPSE, Size(5, 5))); 70 | 71 | imshow("Thresholded Image", imgThresholded); //show the thresholded image 72 | imshow("Original", imgOriginal); //show the original image 73 | 74 | if (waitKey(30) == 27) //wait for 'esc' key press for 30ms. If 'esc' key is pressed, break loop 75 | { 76 | cout << "esc key is pressed by user" << endl; 77 | break; 78 | } 79 | } 80 | 81 | return 0; 82 | } -------------------------------------------------------------------------------- /CS549_ObjectDetection/Debug/CS549_Ob.0CEDAC80.tlog/CL.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/CS549_ObjectDetection/Debug/CS549_Ob.0CEDAC80.tlog/CL.read.1.tlog -------------------------------------------------------------------------------- /CS549_ObjectDetection/Debug/CS549_Ob.0CEDAC80.tlog/CL.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/CS549_ObjectDetection/Debug/CS549_Ob.0CEDAC80.tlog/CL.write.1.tlog -------------------------------------------------------------------------------- /CS549_ObjectDetection/Debug/CS549_Ob.0CEDAC80.tlog/CS549_ObjectDetection.lastbuildstate: -------------------------------------------------------------------------------- 1 | #TargetFrameworkVersion=v4.0:PlatformToolSet=v120:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit 2 | Debug|Win32|D:\Projects\OpenCV\ObjectDetection\| 3 | -------------------------------------------------------------------------------- /CS549_ObjectDetection/Debug/CS549_Ob.0CEDAC80.tlog/cl.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/CS549_ObjectDetection/Debug/CS549_Ob.0CEDAC80.tlog/cl.command.1.tlog -------------------------------------------------------------------------------- /CS549_ObjectDetection/Debug/CS549_Ob.0CEDAC80.tlog/link.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/CS549_ObjectDetection/Debug/CS549_Ob.0CEDAC80.tlog/link.command.1.tlog -------------------------------------------------------------------------------- /CS549_ObjectDetection/Debug/CS549_Ob.0CEDAC80.tlog/link.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/CS549_ObjectDetection/Debug/CS549_Ob.0CEDAC80.tlog/link.read.1.tlog -------------------------------------------------------------------------------- /CS549_ObjectDetection/Debug/CS549_Ob.0CEDAC80.tlog/link.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/CS549_ObjectDetection/Debug/CS549_Ob.0CEDAC80.tlog/link.write.1.tlog -------------------------------------------------------------------------------- /CS549_ObjectDetection/Debug/CS549_ObjectDetection.Build.CppClean.log: -------------------------------------------------------------------------------- 1 | d:\projects\opencv\cs549_objectdetection\cs549_objectdetection\debug\vc120.pdb 2 | d:\projects\opencv\cs549_objectdetection\cs549_objectdetection\debug\vc120.idb 3 | d:\projects\opencv\cs549_objectdetection\cs549_objectdetection\debug\colorrecognition.obj 4 | d:\projects\opencv\cs549_objectdetection\cs549_objectdetection\debug\imagedisplay.obj 5 | d:\projects\opencv\cs549_objectdetection\cs549_objectdetection\debug\main.obj 6 | d:\projects\opencv\cs549_objectdetection\cs549_objectdetection\debug\peopledetect.obj 7 | d:\projects\opencv\cs549_objectdetection\cs549_objectdetection\debug\shape_multi.obj 8 | d:\projects\opencv\cs549_objectdetection\cs549_objectdetection\debug\triangleimage.obj 9 | d:\projects\opencv\cs549_objectdetection\cs549_objectdetection\debug\cam_color.obj 10 | d:\projects\opencv\cs549_objectdetection\cs549_objectdetection\debug\svm_classify.obj 11 | d:\projects\opencv\cs549_objectdetection\cs549_objectdetection\debug\svm_common.obj 12 | d:\projects\opencv\cs549_objectdetection\cs549_objectdetection\debug\svm_hideo.obj 13 | d:\projects\opencv\cs549_objectdetection\cs549_objectdetection\debug\svm_learn.obj 14 | d:\projects\opencv\cs549_objectdetection\cs549_objectdetection\debug\global.obj 15 | d:\projects\opencv\cs549_objectdetection\debug\cs549_objectdetection.pdb 16 | d:\projects\opencv\cs549_objectdetection\cs549_objectdetection\debug\cs549_ob.0cedac80.tlog\cl.command.1.tlog 17 | d:\projects\opencv\cs549_objectdetection\cs549_objectdetection\debug\cs549_ob.0cedac80.tlog\cl.read.1.tlog 18 | d:\projects\opencv\cs549_objectdetection\cs549_objectdetection\debug\cs549_ob.0cedac80.tlog\cl.write.1.tlog 19 | d:\projects\opencv\cs549_objectdetection\cs549_objectdetection\debug\cs549_ob.0cedac80.tlog\link-cvtres.read.1.tlog 20 | d:\projects\opencv\cs549_objectdetection\cs549_objectdetection\debug\cs549_ob.0cedac80.tlog\link-cvtres.write.1.tlog 21 | d:\projects\opencv\cs549_objectdetection\cs549_objectdetection\debug\cs549_ob.0cedac80.tlog\link-rc.read.1.tlog 22 | d:\projects\opencv\cs549_objectdetection\cs549_objectdetection\debug\cs549_ob.0cedac80.tlog\link-rc.write.1.tlog 23 | d:\projects\opencv\cs549_objectdetection\cs549_objectdetection\debug\cs549_ob.0cedac80.tlog\link.671808-cvtres.read.1.tlog 24 | d:\projects\opencv\cs549_objectdetection\cs549_objectdetection\debug\cs549_ob.0cedac80.tlog\link.671808-cvtres.write.1.tlog 25 | d:\projects\opencv\cs549_objectdetection\cs549_objectdetection\debug\cs549_ob.0cedac80.tlog\link.671808-rc.read.1.tlog 26 | d:\projects\opencv\cs549_objectdetection\cs549_objectdetection\debug\cs549_ob.0cedac80.tlog\link.671808-rc.write.1.tlog 27 | d:\projects\opencv\cs549_objectdetection\cs549_objectdetection\debug\cs549_ob.0cedac80.tlog\link.671808.read.1.tlog 28 | d:\projects\opencv\cs549_objectdetection\cs549_objectdetection\debug\cs549_ob.0cedac80.tlog\link.671808.write.1.tlog 29 | d:\projects\opencv\cs549_objectdetection\cs549_objectdetection\debug\cs549_ob.0cedac80.tlog\link.command.1.tlog 30 | d:\projects\opencv\cs549_objectdetection\cs549_objectdetection\debug\cs549_ob.0cedac80.tlog\link.read.1.tlog 31 | d:\projects\opencv\cs549_objectdetection\cs549_objectdetection\debug\cs549_ob.0cedac80.tlog\link.write.1.tlog 32 | -------------------------------------------------------------------------------- /CS549_ObjectDetection/Debug/CS549_ObjectDetection.log: -------------------------------------------------------------------------------- 1 | Build started 12/17/2014 10:20:06 AM. 2 | 1>Project "D:\Projects\OpenCV\ObjectDetection\CS549_ObjectDetection\CS549_ObjectDetection.vcxproj" on node 2 (Build target(s)). 3 | 1>ClCompile: 4 | C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\CL.exe /c /I..\OpenCV\include /ZI /nologo /W3 /WX- /sdl /Od /Oy- /D WIN32 /D _DEBUG /D _CONSOLE /D _LIB /D _CRT_SECURE_NO_DEPRECATE /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Debug\\" /Fd"Debug\vc120.pdb" /Gd /TP /analyze- /errorReport:prompt Main.cpp 5 | Main.cpp 6 | 1>d:\projects\opencv\objectdetection\cs549_objectdetection\utility.h(79): warning C4018: '<' : signed/unsigned mismatch 7 | 1>d:\projects\opencv\objectdetection\cs549_objectdetection\utility.h(102): warning C4018: '<' : signed/unsigned mismatch 8 | 1>d:\projects\opencv\objectdetection\cs549_objectdetection\svmlight\svmlight.h(136): warning C4018: '<' : signed/unsigned mismatch 9 | 1>d:\projects\opencv\objectdetection\cs549_objectdetection\svmlight\svmlight.h(138): warning C4244: '+=' : conversion from 'double' to 'float', possible loss of data 10 | 1>d:\projects\opencv\objectdetection\cs549_objectdetection\svmlight\svmlight.h(148): warning C4244: 'return' : conversion from 'double' to 'float', possible loss of data 11 | 1>d:\projects\opencv\objectdetection\cs549_objectdetection\global.h(227): warning C4244: '=' : conversion from 'unsigned long' to 'float', possible loss of data 12 | 1>d:\projects\opencv\objectdetection\cs549_objectdetection\global.h(273): warning C4018: '<' : signed/unsigned mismatch 13 | 1>d:\projects\opencv\objectdetection\cs549_objectdetection\global.h(275): warning C4244: '=' : conversion from 'unsigned int' to 'float', possible loss of data 14 | 1>d:\projects\opencv\objectdetection\cs549_objectdetection\global.h(294): warning C4101: 'percent' : unreferenced local variable 15 | 1>d:\projects\opencv\objectdetection\cs549_objectdetection\global.h(440): warning C4018: '<' : signed/unsigned mismatch 16 | 1>d:\projects\opencv\objectdetection\cs549_objectdetection\global.h(189): warning C4715: 'importImageSamples' : not all control paths return a value 17 | 1>d:\projects\opencv\objectdetection\cs549_objectdetection\global.h(256): warning C4715: 'getSamplesToGenerateFeatures' : not all control paths return a value 18 | Link: 19 | C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"D:\Projects\OpenCV\ObjectDetection\Debug\CS549_ObjectDetection.exe" /INCREMENTAL /NOLOGO /LIBPATH:..\OpenCV\lib opencv_calib3d2410d.lib opencv_contrib2410.lib opencv_core2410d.lib opencv_features2d2410d.lib opencv_flann2410d.lib opencv_highgui2410d.lib opencv_gpu2410d.lib opencv_imgproc2410d.lib opencv_legacy2410d.lib opencv_ml2410d.lib opencv_objdetect2410d.lib opencv_video2410d.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 /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"D:\Projects\OpenCV\ObjectDetection\Debug\CS549_ObjectDetection.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"D:\Projects\OpenCV\ObjectDetection\Debug\CS549_ObjectDetection.lib" /MACHINE:X86 Debug\cam_color.obj 20 | Debug\ColorRecognition.obj 21 | Debug\Global.obj 22 | Debug\ImageDisplay.obj 23 | Debug\Main.obj 24 | Debug\PeopleDetect.obj 25 | Debug\Shape_Multi.obj 26 | Debug\svm_classify.obj 27 | Debug\svm_common.obj 28 | Debug\svm_hideo.obj 29 | Debug\svm_learn.obj 30 | Debug\TriangleImage.obj 31 | CS549_ObjectDetection.vcxproj -> D:\Projects\OpenCV\ObjectDetection\Debug\CS549_ObjectDetection.exe 32 | 1>Done Building Project "D:\Projects\OpenCV\ObjectDetection\CS549_ObjectDetection\CS549_ObjectDetection.vcxproj" (Build target(s)). 33 | 34 | Build succeeded. 35 | 36 | Time Elapsed 00:00:02.38 37 | -------------------------------------------------------------------------------- /CS549_ObjectDetection/Debug/vc120.idb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/CS549_ObjectDetection/Debug/vc120.idb -------------------------------------------------------------------------------- /CS549_ObjectDetection/Global.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/CS549_ObjectDetection/Global.cpp -------------------------------------------------------------------------------- /CS549_ObjectDetection/ImageDisplay.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Description : Simple image display 3 | */ 4 | 5 | #include"Utility.h" 6 | 7 | #ifdef SAMPLE_IMAGE 8 | int main() 9 | #else 10 | int sample_image_main() 11 | #endif 12 | { 13 | Mat image = cvLoadImage("Res\\image\\Capture.PNG"); //notice the path of the image file 14 | Mat HSV; 15 | cvtColor(image, HSV, CV_BGR2HSV); 16 | Point center = Point(150,280); 17 | Vec3b hsv = HSV.at(center); 18 | Vec3i max = hsv; 19 | Vec3i min = hsv; 20 | 21 | int b = 5; 22 | for (int i = -b; i < b; i++) 23 | { 24 | for (int j = -b; j < b; j++) 25 | { 26 | hsv = HSV.at(center + Point(i, j)); 27 | cout << "HSV" << (int)hsv.val[0] << " " << (int)hsv.val[1] << " " << (int)hsv.val[2] << endl; 28 | for (int t = 0; t < 3; t++) 29 | { 30 | if (hsv.val[t] < min[t]) 31 | { 32 | min[t] = hsv.val[t]; 33 | } 34 | if (hsv.val[t]>max[t]) 35 | { 36 | max[t] = hsv.val[t]; 37 | } 38 | } 39 | } 40 | } 41 | rectangle(image, center - Point(b, b), center + Point(b, b), cv::Scalar(0, 255, 0), 2); 42 | cout << "Max: " << max << endl; 43 | cout << "Min: " << min << endl; 44 | imshow("Test", image); 45 | 46 | cvWaitKey(0); 47 | image.release(); 48 | //cvReleaseImage(&image); 49 | //cvDestroyWindow("Hello World"); 50 | return 0; 51 | } -------------------------------------------------------------------------------- /CS549_ObjectDetection/PeopleDetect.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Description : People detection based on HOG feature and SVM classifier, 3 | with video capture and green rectangle display. 4 | Source : http://www.magicandlove.com/blog/2011/08/26/people-detection-in-opencv-again/ 5 | */ 6 | #include"Utility.h" 7 | 8 | #ifdef SAMPLE_PEOPLE 9 | int main(int argc, char** argv) 10 | #else 11 | int sample_people_main(int argc, char** argv) 12 | #endif 13 | { 14 | VideoCapture cap(CV_CAP_ANY); 15 | cap.set(CV_CAP_PROP_FRAME_WIDTH, 320); 16 | cap.set(CV_CAP_PROP_FRAME_HEIGHT, 240); 17 | if (!cap.isOpened()) 18 | return -1; 19 | 20 | Mat img; 21 | HOGDescriptor hog; 22 | hog.setSVMDetector(HOGDescriptor::getDefaultPeopleDetector()); 23 | 24 | namedWindow("video capture", CV_WINDOW_AUTOSIZE); 25 | while (true) 26 | { 27 | cap >> img; 28 | if (!img.data) 29 | continue; 30 | 31 | vector found, found_filtered; 32 | hog.detectMultiScale(img, found, 0, Size(8, 8), Size(32, 32), 1.05, 2); 33 | 34 | size_t i, j; 35 | for (i = 0; i= 0) 55 | break; 56 | } 57 | return 0; 58 | } 59 | 60 | -------------------------------------------------------------------------------- /CS549_ObjectDetection/Res/genfiles/svmparam.txt: -------------------------------------------------------------------------------- 1 | 1.23 -------------------------------------------------------------------------------- /CS549_ObjectDetection/Shape_Multi.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Description : Multiple shapes detection, with image. 3 | Source : http://opencv-srf.blogspot.com/2011/09/object-detection-tracking-using-contours.html 4 | */ 5 | 6 | #include"Utility.h" 7 | 8 | /* 9 | - greyscale only 10 | */ 11 | 12 | #ifdef SAMPLE_MULTIPLESHAPES 13 | int main() 14 | #else 15 | int sample_multiple_shapes_main() 16 | #endif 17 | { 18 | 19 | IplImage* img = cvLoadImage("Res\\image\\FindingContours_Multi.png"); 20 | 21 | //show the original image 22 | cvNamedWindow("Raw"); 23 | cvShowImage("Raw", img); 24 | 25 | //converting the original image into grayscale 26 | IplImage* imgGrayScale = cvCreateImage(cvGetSize(img), 8, 1); 27 | cvCvtColor(img, imgGrayScale, CV_BGR2GRAY); 28 | 29 | //thresholding the grayscale image to get better results 30 | cvThreshold(imgGrayScale, imgGrayScale, 128, 255, CV_THRESH_BINARY); 31 | 32 | CvSeq* contours; //hold the pointer to a contour in the memory block 33 | CvSeq* result; //hold sequence of points of a contour 34 | CvMemStorage *storage = cvCreateMemStorage(0); //storage area for all contours 35 | 36 | //finding all contours in the image 37 | cvFindContours(imgGrayScale, storage, &contours, sizeof(CvContour), CV_RETR_LIST, CV_CHAIN_APPROX_SIMPLE, cvPoint(0, 0)); 38 | 39 | //iterating through each contour 40 | while (contours) 41 | { 42 | //obtain a sequence of points of contour, pointed by the variable 'contour' 43 | result = cvApproxPoly(contours, sizeof(CvContour), storage, CV_POLY_APPROX_DP, cvContourPerimeter(contours)*0.02, 0); 44 | 45 | //if there are 3 vertices in the contour(It should be a triangle) 46 | if (result->total == 3) 47 | { 48 | //iterating through each point 49 | CvPoint *pt[3]; 50 | for (int i = 0; i<3; i++){ 51 | pt[i] = (CvPoint*)cvGetSeqElem(result, i); 52 | } 53 | 54 | //drawing lines around the triangle 55 | cvLine(img, *pt[0], *pt[1], cvScalar(255, 0, 0), 4); 56 | cvLine(img, *pt[1], *pt[2], cvScalar(255, 0, 0), 4); 57 | cvLine(img, *pt[2], *pt[0], cvScalar(255, 0, 0), 4); 58 | 59 | } 60 | 61 | //if there are 4 vertices in the contour(It should be a quadrilateral) 62 | else if (result->total == 4) 63 | { 64 | //iterating through each point 65 | CvPoint *pt[4]; 66 | for (int i = 0; i<4; i++){ 67 | pt[i] = (CvPoint*)cvGetSeqElem(result, i); 68 | } 69 | 70 | //drawing lines around the quadrilateral 71 | cvLine(img, *pt[0], *pt[1], cvScalar(0, 255, 0), 4); 72 | cvLine(img, *pt[1], *pt[2], cvScalar(0, 255, 0), 4); 73 | cvLine(img, *pt[2], *pt[3], cvScalar(0, 255, 0), 4); 74 | cvLine(img, *pt[3], *pt[0], cvScalar(0, 255, 0), 4); 75 | } 76 | 77 | //if there are 7 vertices in the contour(It should be a heptagon) 78 | else if (result->total == 7) 79 | { 80 | //iterating through each point 81 | CvPoint *pt[7]; 82 | for (int i = 0; i<7; i++){ 83 | pt[i] = (CvPoint*)cvGetSeqElem(result, i); 84 | } 85 | 86 | //drawing lines around the heptagon 87 | cvLine(img, *pt[0], *pt[1], cvScalar(0, 0, 255), 4); 88 | cvLine(img, *pt[1], *pt[2], cvScalar(0, 0, 255), 4); 89 | cvLine(img, *pt[2], *pt[3], cvScalar(0, 0, 255), 4); 90 | cvLine(img, *pt[3], *pt[4], cvScalar(0, 0, 255), 4); 91 | cvLine(img, *pt[4], *pt[5], cvScalar(0, 0, 255), 4); 92 | cvLine(img, *pt[5], *pt[6], cvScalar(0, 0, 255), 4); 93 | cvLine(img, *pt[6], *pt[0], cvScalar(0, 0, 255), 4); 94 | } 95 | 96 | //obtain the next contour 97 | contours = contours->h_next; 98 | } 99 | 100 | //show the image in which identified shapes are marked 101 | cvNamedWindow("Tracked"); 102 | cvShowImage("Tracked", img); 103 | 104 | cvWaitKey(0); //wait for a key press 105 | 106 | //cleaning up 107 | cvDestroyAllWindows(); 108 | cvReleaseMemStorage(&storage); 109 | cvReleaseImage(&img); 110 | cvReleaseImage(&imgGrayScale); 111 | 112 | return 0; 113 | } -------------------------------------------------------------------------------- /CS549_ObjectDetection/TriangleImage.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Description : Triangle detection, with image. 3 | Source : http://opencv-srf.blogspot.com/2011/09/object-detection-tracking-using-contours.html 4 | */ 5 | 6 | #include"Utility.h" 7 | 8 | #ifdef SAMPLE_TRIANGLE 9 | int main() 10 | #else 11 | int sample_triangle_main() 12 | #endif 13 | { 14 | 15 | IplImage* img = cvLoadImage("Res\\image\\DetectingContours.jpg"); 16 | 17 | //show the original image 18 | cvNamedWindow("Original"); 19 | cvShowImage("Original", img); 20 | 21 | //smooth the original image using Gaussian kernel to remove noise 22 | cvSmooth(img, img, CV_GAUSSIAN, 3, 3); 23 | 24 | //converting the original image into grayscale 25 | IplImage* imgGrayScale = cvCreateImage(cvGetSize(img), 8, 1); 26 | cvCvtColor(img, imgGrayScale, CV_BGR2GRAY); 27 | 28 | cvNamedWindow("GrayScale Image"); 29 | cvShowImage("GrayScale Image", imgGrayScale); 30 | 31 | //thresholding the grayscale image to get better results 32 | cvThreshold(imgGrayScale, imgGrayScale, 100, 255, CV_THRESH_BINARY_INV); 33 | 34 | cvNamedWindow("Thresholded Image"); 35 | cvShowImage("Thresholded Image", imgGrayScale); 36 | 37 | CvSeq* contour; //hold the pointer to a contour 38 | CvSeq* result; //hold sequence of points of a contour 39 | CvMemStorage *storage = cvCreateMemStorage(0); //storage area for all contours 40 | 41 | //finding all contours in the image 42 | cvFindContours(imgGrayScale, storage, &contour, sizeof(CvContour), CV_RETR_LIST, CV_CHAIN_APPROX_SIMPLE, cvPoint(0, 0)); 43 | 44 | //iterating through each contour 45 | while (contour) 46 | { 47 | //obtain a sequence of points of the countour, pointed by the variable 'countour' 48 | result = cvApproxPoly(contour, sizeof(CvContour), storage, CV_POLY_APPROX_DP, cvContourPerimeter(contour)*0.02, 0); 49 | 50 | //if there are 3 vertices in the contour and the area of the triangle is more than 100 pixels 51 | if (result->total == 3 && fabs(cvContourArea(result, CV_WHOLE_SEQ))>100) 52 | { 53 | //iterating through each point 54 | CvPoint *pt[3]; 55 | for (int i = 0; i<3; i++){ 56 | pt[i] = (CvPoint*)cvGetSeqElem(result, i); 57 | } 58 | 59 | //drawing lines around the triangle 60 | cvLine(img, *pt[0], *pt[1], cvScalar(255, 0, 0), 4); 61 | cvLine(img, *pt[1], *pt[2], cvScalar(255, 0, 0), 4); 62 | cvLine(img, *pt[2], *pt[0], cvScalar(255, 0, 0), 4); 63 | 64 | } 65 | 66 | //obtain the next contour 67 | contour = contour->h_next; 68 | } 69 | 70 | //show the image in which identified shapes are marked 71 | cvNamedWindow("Tracked"); 72 | cvShowImage("Tracked", img); 73 | 74 | cvWaitKey(0); //wait for a key press 75 | 76 | //cleaning up 77 | cvDestroyAllWindows(); 78 | cvReleaseMemStorage(&storage); 79 | cvReleaseImage(&img); 80 | cvReleaseImage(&imgGrayScale); 81 | 82 | return 0; 83 | } -------------------------------------------------------------------------------- /CS549_ObjectDetection/Utility.h: -------------------------------------------------------------------------------- 1 | /* 2 | Description : Definitions and include files. 3 | */ 4 | #pragma once 5 | 6 | /* 7 | * Definitions 8 | */ 9 | #define MAIN 10 | //#define COLOR_PRE 11 | 12 | //#define SAMPLE_PEOPLE 13 | //#define SAMPLE_TRIANGLE 14 | //#define SAMPLE_MULTIPLESHAPES 15 | //#define SAMPLE_IMAGE 16 | //#define SAMPLE_COLOR 17 | 18 | 19 | 20 | /* 21 | * Include files 22 | */ 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | #include 30 | #include 31 | #include 32 | #include "opencv2/imgproc/imgproc.hpp" 33 | #include "opencv2/objdetect/objdetect.hpp" 34 | #include "opencv2/highgui/highgui.hpp" 35 | //training 36 | #include 37 | 38 | using namespace cv; 39 | using namespace std; 40 | 41 | 42 | /*Important: svmlight.h should be included after the namespce is defined, 43 | and should make distinction for svmlight::WORD to identify it to std::WORD*/ 44 | 45 | 46 | enum LOGTYPE {LOG, ERROR, MESSAGE}; 47 | //log type strings should be consistant with LOGTYPE 48 | static vector logTypeStr = { "[LOG]: ", "[ERROR]: ", "[MESSAGE]: " }; 49 | 50 | class Utility 51 | { 52 | public: 53 | 54 | static void log(string logStr, int type = LOGTYPE::LOG) 55 | { 56 | cout << logTypeStr[type] << logStr << endl; 57 | } 58 | 59 | /* ----------------------------------------------------------------------- */ 60 | /* Function : Utility::split 61 | * 62 | * Description : split a string using a pattern 63 | * 64 | * Parameters : string str : the input string 65 | * string pattern: the split pattern 66 | * 67 | * Returns : vector : a list of strings 68 | */ 69 | static vector split(string str, string pattern) 70 | { 71 | std::string::size_type pos; 72 | std::vector result; 73 | str += pattern; //add a pattern at the end 74 | int size = str.size(); 75 | 76 | for (int i = 0; i < size; i++) 77 | { 78 | pos = str.find(pattern, i); 79 | if (pos < size) 80 | { 81 | std::string s = str.substr(i, pos - i); 82 | if (s != "") 83 | { 84 | result.push_back(s); 85 | } 86 | i = pos + pattern.size() - 1; 87 | } 88 | } 89 | return result; 90 | } 91 | 92 | static bool getFilesInDirectory(string dirStr, vector& fileList, vector validExt) 93 | { 94 | DIR *dir; 95 | struct dirent *ent; 96 | if ((dir = opendir(dirStr.c_str())) != NULL) { 97 | /* print all the files and directories within directory */ 98 | while ((ent = readdir(dir)) != NULL) { 99 | vector name = Utility::split(ent->d_name, "."); 100 | if (name.size() < 2) 101 | continue; 102 | for (int index = 0; index < validExt.size(); index++) 103 | { 104 | //turn ext to lowercase 105 | transform(name[1].begin(), name[1].end(), name[1].begin(), tolower); 106 | if (name[1] == validExt[index]) 107 | { 108 | fileList.push_back(dirStr + ent->d_name); 109 | } 110 | } 111 | 112 | } 113 | Utility::log(to_string(fileList.size()) + " files got from foler " + dirStr); 114 | closedir(dir); 115 | return true; 116 | } 117 | else { 118 | /* could not open directory */ 119 | perror("Could not open the directory."); 120 | return false; 121 | } 122 | } 123 | }; 124 | 125 | -------------------------------------------------------------------------------- /CS549_ObjectDetection/cam_color.cpp: -------------------------------------------------------------------------------- 1 | #include"Utility.h" 2 | #include 3 | 4 | using namespace cv; 5 | using namespace std; 6 | 7 | #ifdef COLOR_PRE 8 | int main(int argc, char** argv) 9 | #else 10 | int color_main(int argc, char** argv) 11 | #endif 12 | 13 | { 14 | VideoCapture cap(0); //capture the video from web cam 15 | 16 | if ( !cap.isOpened() ) // if not success, exit program 17 | { 18 | cout << "Cannot open the web cam" << endl; 19 | return -1; 20 | } 21 | 22 | int yLowH = 22; //22 23 | int yHighH = 38; //38 24 | 25 | int yLowS = 200; //160 26 | int yHighS = 255; //255 27 | 28 | int yLowV = 100; //60 29 | int yHighV = 255; //255 30 | 31 | int cLowH = 86; 32 | int cHighH = 106; 33 | 34 | int cLowS = 100; 35 | int cHighS = 255; 36 | 37 | int cLowV = 100; 38 | int cHighV = 255; 39 | 40 | while (true) 41 | { 42 | Mat imgOriginal; 43 | bool bSuccess = cap.read(imgOriginal); // read a new frame from video 44 | 45 | if (!bSuccess) //if not success, break loop 46 | { 47 | cout << "Cannot read a frame from video stream" << endl; 48 | break; 49 | } 50 | 51 | //imgOriginal = imread( argv[1], 1 ); 52 | //resize(imgOriginal,imgOriginal,Size(imgOriginal.cols/4,imgOriginal.rows/4)); 53 | Mat imgHSV; 54 | 55 | cvtColor(imgOriginal, imgHSV, COLOR_BGR2HSV); //Convert the captured frame from BGR to HSV 56 | 57 | Mat imgThresholded,imgThresholdedC,imgThresholdedY,edge; 58 | 59 | //Threshold the image 60 | inRange(imgHSV, Scalar(cLowH, cLowS, cLowV), Scalar(cHighH, cHighS, cHighV), imgThresholdedC); 61 | //inRange(imgHSV, Scalar(yLowH, yLowS, yLowV), Scalar(yHighH, yHighS, yHighV), imgThresholdedY); 62 | 63 | imgThresholded = imgThresholdedC; 64 | 65 | //morphological opening (remove small objects from the foreground) 66 | erode(imgThresholded, imgThresholded, getStructuringElement(MORPH_ELLIPSE, Size(5, 5)) ); 67 | dilate( imgThresholded, imgThresholded, getStructuringElement(MORPH_ELLIPSE, Size(5, 5)) ); 68 | 69 | //morphological closing (fill small holes in the foreground) 70 | dilate( imgThresholded, imgThresholded, getStructuringElement(MORPH_ELLIPSE, Size(5, 5)) ); 71 | erode(imgThresholded, imgThresholded, getStructuringElement(MORPH_ELLIPSE, Size(7, 7)) ); 72 | 73 | imshow("Thresholded Image", imgThresholded); //show the thresholded image 74 | /// Convert it to gray 75 | // Canny( imgThresholded,edge, 150, 100,3 ); 76 | // imshow("Edge", edge); //show the original image 77 | 78 | vector > contours; 79 | // find 80 | findContours( imgThresholded,contours,CV_RETR_EXTERNAL,CV_CHAIN_APPROX_NONE); 81 | drawContours( imgOriginal,contours,-1,Scalar(0,0,255),2); 82 | imshow("Original", imgOriginal); //show the original image 83 | 84 | //Canny 85 | Mat src = imgOriginal; 86 | Mat src1 = src.clone(); 87 | Canny( src, src, 150, 100,3 ); 88 | imshow("showcase Canny edge", src); 89 | Mat dst,gray; 90 | 91 | // dst has same size with src 92 | dst.create( src1.size(), src1.type() ); 93 | 94 | // grey scale 95 | cvtColor( src1, gray, CV_BGR2GRAY ); 96 | 97 | // 3*3 blur 98 | blur( gray, edge, Size(3,3) ); 99 | 100 | // canny edge detection 101 | Canny( edge, edge, 3, 9,3 ); 102 | 103 | // 104 | dst = Scalar::all(0); 105 | 106 | // 107 | src1.copyTo( dst, edge); 108 | 109 | // 110 | imshow("showcaseCanny edge2", dst); 111 | 112 | 113 | if (waitKey(30) == 27) //wait for 'esc' key press for 30ms. If 'esc' key is pressed, break loop 114 | { 115 | cout << "esc key is pressed by user" << endl; 116 | break; 117 | } } 118 | return 0; 119 | 120 | } 121 | 122 | -------------------------------------------------------------------------------- /CS549_ObjectDetection/svmlight/kernel.h: -------------------------------------------------------------------------------- 1 | /************************************************************************/ 2 | /* */ 3 | /* kernel.h */ 4 | /* */ 5 | /* User defined kernel function. Feel free to plug in your own. */ 6 | /* */ 7 | /* Copyright: Thorsten Joachims */ 8 | /* Date: 16.12.97 */ 9 | /* */ 10 | /************************************************************************/ 11 | 12 | /* KERNEL_PARM is defined in svm_common.h The field 'custom' is reserved for */ 13 | /* parameters of the user defined kernel. You can also access and use */ 14 | /* the parameters of the other kernels. Just replace the line 15 | return((double)(1.0)); 16 | with your own kernel. */ 17 | 18 | /* Example: The following computes the polynomial kernel. sprod_ss 19 | computes the inner product between two sparse vectors. 20 | 21 | return((CFLOAT)pow(kernel_parm->coef_lin*sprod_ss(a->words,b->words) 22 | +kernel_parm->coef_const,(double)kernel_parm->poly_degree)); 23 | */ 24 | 25 | /* If you are implementing a kernel that is not based on a 26 | feature/value representation, you might want to make use of the 27 | field "userdefined" in SVECTOR. By default, this field will contain 28 | whatever string you put behind a # sign in the example file. So, if 29 | a line in your training file looks like 30 | 31 | -1 1:3 5:6 #abcdefg 32 | 33 | then the SVECTOR field "words" will contain the vector 1:3 5:6, and 34 | "userdefined" will contain the string "abcdefg". */ 35 | 36 | double custom_kernel(KERNEL_PARM *kernel_parm, SVECTOR *a, SVECTOR *b) 37 | /* plug in you favorite kernel */ 38 | { 39 | return((double)(1.0)); 40 | } 41 | -------------------------------------------------------------------------------- /Debug/Res/genfiles/svmparam.txt: -------------------------------------------------------------------------------- 1 | 1.23 -------------------------------------------------------------------------------- /Debug/opencv_calib3d2410d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Debug/opencv_calib3d2410d.dll -------------------------------------------------------------------------------- /Debug/opencv_contrib2410d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Debug/opencv_contrib2410d.dll -------------------------------------------------------------------------------- /Debug/opencv_core2410d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Debug/opencv_core2410d.dll -------------------------------------------------------------------------------- /Debug/opencv_features2d2410d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Debug/opencv_features2d2410d.dll -------------------------------------------------------------------------------- /Debug/opencv_flann2410d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Debug/opencv_flann2410d.dll -------------------------------------------------------------------------------- /Debug/opencv_gpu2410d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Debug/opencv_gpu2410d.dll -------------------------------------------------------------------------------- /Debug/opencv_highgui2410d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Debug/opencv_highgui2410d.dll -------------------------------------------------------------------------------- /Debug/opencv_imgproc2410d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Debug/opencv_imgproc2410d.dll -------------------------------------------------------------------------------- /Debug/opencv_legacy2410d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Debug/opencv_legacy2410d.dll -------------------------------------------------------------------------------- /Debug/opencv_ml2410d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Debug/opencv_ml2410d.dll -------------------------------------------------------------------------------- /Debug/opencv_nonfree2410d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Debug/opencv_nonfree2410d.dll -------------------------------------------------------------------------------- /Debug/opencv_objdetect2410d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Debug/opencv_objdetect2410d.dll -------------------------------------------------------------------------------- /Debug/opencv_ocl2410d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Debug/opencv_ocl2410d.dll -------------------------------------------------------------------------------- /Debug/opencv_photo2410d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Debug/opencv_photo2410d.dll -------------------------------------------------------------------------------- /Debug/opencv_stitching2410d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Debug/opencv_stitching2410d.dll -------------------------------------------------------------------------------- /Debug/opencv_superres2410d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Debug/opencv_superres2410d.dll -------------------------------------------------------------------------------- /Debug/opencv_video2410d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Debug/opencv_video2410d.dll -------------------------------------------------------------------------------- /Debug/opencv_videostab2410d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Debug/opencv_videostab2410d.dll -------------------------------------------------------------------------------- /OpenCV/ReadMe.txt: -------------------------------------------------------------------------------- 1 | OpenCV 2.4.10 2 | x86 3 | Visual Studio 2013 -------------------------------------------------------------------------------- /OpenCV/bin/opencv_calib3d2410.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/bin/opencv_calib3d2410.dll -------------------------------------------------------------------------------- /OpenCV/bin/opencv_calib3d2410d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/bin/opencv_calib3d2410d.dll -------------------------------------------------------------------------------- /OpenCV/bin/opencv_contrib2410.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/bin/opencv_contrib2410.dll -------------------------------------------------------------------------------- /OpenCV/bin/opencv_contrib2410d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/bin/opencv_contrib2410d.dll -------------------------------------------------------------------------------- /OpenCV/bin/opencv_core2410.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/bin/opencv_core2410.dll -------------------------------------------------------------------------------- /OpenCV/bin/opencv_core2410d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/bin/opencv_core2410d.dll -------------------------------------------------------------------------------- /OpenCV/bin/opencv_features2d2410.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/bin/opencv_features2d2410.dll -------------------------------------------------------------------------------- /OpenCV/bin/opencv_features2d2410d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/bin/opencv_features2d2410d.dll -------------------------------------------------------------------------------- /OpenCV/bin/opencv_flann2410.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/bin/opencv_flann2410.dll -------------------------------------------------------------------------------- /OpenCV/bin/opencv_flann2410d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/bin/opencv_flann2410d.dll -------------------------------------------------------------------------------- /OpenCV/bin/opencv_gpu2410.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/bin/opencv_gpu2410.dll -------------------------------------------------------------------------------- /OpenCV/bin/opencv_gpu2410d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/bin/opencv_gpu2410d.dll -------------------------------------------------------------------------------- /OpenCV/bin/opencv_highgui2410.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/bin/opencv_highgui2410.dll -------------------------------------------------------------------------------- /OpenCV/bin/opencv_highgui2410d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/bin/opencv_highgui2410d.dll -------------------------------------------------------------------------------- /OpenCV/bin/opencv_imgproc2410.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/bin/opencv_imgproc2410.dll -------------------------------------------------------------------------------- /OpenCV/bin/opencv_imgproc2410d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/bin/opencv_imgproc2410d.dll -------------------------------------------------------------------------------- /OpenCV/bin/opencv_legacy2410.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/bin/opencv_legacy2410.dll -------------------------------------------------------------------------------- /OpenCV/bin/opencv_legacy2410d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/bin/opencv_legacy2410d.dll -------------------------------------------------------------------------------- /OpenCV/bin/opencv_ml2410.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/bin/opencv_ml2410.dll -------------------------------------------------------------------------------- /OpenCV/bin/opencv_ml2410d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/bin/opencv_ml2410d.dll -------------------------------------------------------------------------------- /OpenCV/bin/opencv_objdetect2410.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/bin/opencv_objdetect2410.dll -------------------------------------------------------------------------------- /OpenCV/bin/opencv_objdetect2410d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/bin/opencv_objdetect2410d.dll -------------------------------------------------------------------------------- /OpenCV/bin/opencv_video2410.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/bin/opencv_video2410.dll -------------------------------------------------------------------------------- /OpenCV/bin/opencv_video2410d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/bin/opencv_video2410d.dll -------------------------------------------------------------------------------- /OpenCV/include/opencv/cv.h: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_OLD_CV_H__ 44 | #define __OPENCV_OLD_CV_H__ 45 | 46 | #if defined(_MSC_VER) 47 | #define CV_DO_PRAGMA(x) __pragma(x) 48 | #define __CVSTR2__(x) #x 49 | #define __CVSTR1__(x) __CVSTR2__(x) 50 | #define __CVMSVCLOC__ __FILE__ "("__CVSTR1__(__LINE__)") : " 51 | #define CV_MSG_PRAGMA(_msg) CV_DO_PRAGMA(message (__CVMSVCLOC__ _msg)) 52 | #elif defined(__GNUC__) 53 | #define CV_DO_PRAGMA(x) _Pragma (#x) 54 | #define CV_MSG_PRAGMA(_msg) CV_DO_PRAGMA(message (_msg)) 55 | #else 56 | #define CV_DO_PRAGMA(x) 57 | #define CV_MSG_PRAGMA(_msg) 58 | #endif 59 | #define CV_WARNING(x) CV_MSG_PRAGMA("Warning: " #x) 60 | 61 | //CV_WARNING("This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module") 62 | 63 | #include "opencv2/core/core_c.h" 64 | #include "opencv2/core/core.hpp" 65 | #include "opencv2/imgproc/imgproc_c.h" 66 | #include "opencv2/imgproc/imgproc.hpp" 67 | #include "opencv2/video/tracking.hpp" 68 | #include "opencv2/features2d/features2d.hpp" 69 | #include "opencv2/flann/flann.hpp" 70 | #include "opencv2/calib3d/calib3d.hpp" 71 | #include "opencv2/objdetect/objdetect.hpp" 72 | #include "opencv2/legacy/compat.hpp" 73 | 74 | #if !defined(CV_IMPL) 75 | #define CV_IMPL extern "C" 76 | #endif //CV_IMPL 77 | 78 | #if defined(__cplusplus) 79 | #include "opencv2/core/internal.hpp" 80 | #endif //__cplusplus 81 | 82 | #endif // __OPENCV_OLD_CV_H_ 83 | -------------------------------------------------------------------------------- /OpenCV/include/opencv/cv.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_OLD_CV_HPP__ 44 | #define __OPENCV_OLD_CV_HPP__ 45 | 46 | //#if defined(__GNUC__) 47 | //#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module" 48 | //#endif 49 | 50 | #include 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /OpenCV/include/opencv/cvaux.h: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // Intel License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000, Intel Corporation, all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of Intel Corporation may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the Intel Corporation or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | #ifndef __OPENCV_OLD_AUX_H__ 43 | #define __OPENCV_OLD_AUX_H__ 44 | 45 | //#if defined(__GNUC__) 46 | //#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module" 47 | //#endif 48 | 49 | #include "opencv2/core/core_c.h" 50 | #include "opencv2/core/core.hpp" 51 | #include "opencv2/imgproc/imgproc_c.h" 52 | #include "opencv2/imgproc/imgproc.hpp" 53 | #include "opencv2/video/tracking.hpp" 54 | #include "opencv2/video/background_segm.hpp" 55 | #include "opencv2/features2d/features2d.hpp" 56 | #include "opencv2/calib3d/calib3d.hpp" 57 | #include "opencv2/objdetect/objdetect.hpp" 58 | #include "opencv2/legacy/legacy.hpp" 59 | #include "opencv2/legacy/compat.hpp" 60 | #include "opencv2/legacy/blobtrack.hpp" 61 | #include "opencv2/contrib/contrib.hpp" 62 | 63 | #endif 64 | 65 | /* End of file. */ 66 | -------------------------------------------------------------------------------- /OpenCV/include/opencv/cvaux.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // Intel License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000, Intel Corporation, all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of Intel Corporation may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the Intel Corporation or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | #ifndef __OPENCV_OLD_AUX_HPP__ 43 | #define __OPENCV_OLD_AUX_HPP__ 44 | 45 | //#if defined(__GNUC__) 46 | //#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module" 47 | //#endif 48 | 49 | #include 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /OpenCV/include/opencv/cvwimage.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 3 | // 4 | // By downloading, copying, installing or using the software you agree to 5 | // this license. If you do not agree to this license, do not download, 6 | // install, copy or use the software. 7 | // 8 | // License Agreement 9 | // For Open Source Computer Vision Library 10 | // 11 | // Copyright (C) 2008, Google, all rights reserved. 12 | // Third party copyrights are property of their respective owners. 13 | // 14 | // Redistribution and use in source and binary forms, with or without 15 | // modification, are permitted provided that the following conditions are met: 16 | // 17 | // * Redistribution's of source code must retain the above copyright notice, 18 | // this list of conditions and the following disclaimer. 19 | // 20 | // * Redistribution's in binary form must reproduce the above copyright notice, 21 | // this list of conditions and the following disclaimer in the documentation 22 | // and/or other materials provided with the distribution. 23 | // 24 | // * The name of Intel Corporation or contributors may not be used to endorse 25 | // or promote products derived from this software without specific 26 | // prior written permission. 27 | // 28 | // This software is provided by the copyright holders and contributors "as is" 29 | // and any express or implied warranties, including, but not limited to, the 30 | // implied warranties of merchantability and fitness for a particular purpose 31 | // are disclaimed. In no event shall the Intel Corporation or contributors be 32 | // liable for any direct, indirect, incidental, special, exemplary, or 33 | // consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | 40 | 41 | #ifndef __OPENCV_OLD_WIMAGE_HPP__ 42 | #define __OPENCV_OLD_WIMAGE_HPP__ 43 | 44 | #include "opencv2/core/wimage.hpp" 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /OpenCV/include/opencv/cxcore.h: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_OLD_CXCORE_H__ 44 | #define __OPENCV_OLD_CXCORE_H__ 45 | 46 | //#if defined(__GNUC__) 47 | //#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module" 48 | //#endif 49 | 50 | #include "opencv2/core/core_c.h" 51 | #include "opencv2/core/core.hpp" 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /OpenCV/include/opencv/cxcore.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_OLD_CXCORE_HPP__ 44 | #define __OPENCV_OLD_CXCORE_HPP__ 45 | 46 | //#if defined(__GNUC__) 47 | //#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module" 48 | //#endif 49 | 50 | #include 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /OpenCV/include/opencv/cxeigen.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_OLD_EIGEN_HPP__ 44 | #define __OPENCV_OLD_EIGEN_HPP__ 45 | 46 | #include "opencv2/core/eigen.hpp" 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /OpenCV/include/opencv/cxmisc.h: -------------------------------------------------------------------------------- 1 | #ifndef __OPENCV_OLD_CXMISC_H__ 2 | #define __OPENCV_OLD_CXMISC_H__ 3 | 4 | #include "opencv2/core/internal.hpp" 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /OpenCV/include/opencv/highgui.h: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // Intel License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000, Intel Corporation, all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of Intel Corporation may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the Intel Corporation or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | #ifndef __OPENCV_OLD_HIGHGUI_H__ 43 | #define __OPENCV_OLD_HIGHGUI_H__ 44 | 45 | #include "opencv2/core/core_c.h" 46 | #include "opencv2/core/core.hpp" 47 | #include "opencv2/highgui/highgui_c.h" 48 | #include "opencv2/highgui/highgui.hpp" 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /OpenCV/include/opencv/ml.h: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // Intel License Agreement 11 | // 12 | // Copyright (C) 2000, Intel Corporation, all rights reserved. 13 | // Third party copyrights are property of their respective owners. 14 | // 15 | // Redistribution and use in source and binary forms, with or without modification, 16 | // are permitted provided that the following conditions are met: 17 | // 18 | // * Redistribution's of source code must retain the above copyright notice, 19 | // this list of conditions and the following disclaimer. 20 | // 21 | // * Redistribution's in binary form must reproduce the above copyright notice, 22 | // this list of conditions and the following disclaimer in the documentation 23 | // and/or other materials provided with the distribution. 24 | // 25 | // * The name of Intel Corporation may not be used to endorse or promote products 26 | // derived from this software without specific prior written permission. 27 | // 28 | // This software is provided by the copyright holders and contributors "as is" and 29 | // any express or implied warranties, including, but not limited to, the implied 30 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 31 | // In no event shall the Intel Corporation or contributors be liable for any direct, 32 | // indirect, incidental, special, exemplary, or consequential damages 33 | // (including, but not limited to, procurement of substitute goods or services; 34 | // loss of use, data, or profits; or business interruption) however caused 35 | // and on any theory of liability, whether in contract, strict liability, 36 | // or tort (including negligence or otherwise) arising in any way out of 37 | // the use of this software, even if advised of the possibility of such damage. 38 | // 39 | //M*/ 40 | 41 | #ifndef __OPENCV_OLD_ML_H__ 42 | #define __OPENCV_OLD_ML_H__ 43 | 44 | #include "opencv2/core/core_c.h" 45 | #include "opencv2/core/core.hpp" 46 | #include "opencv2/ml/ml.hpp" 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/contrib/detection_based_tracker.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if defined(__linux__) || defined(LINUX) || defined(__APPLE__) || defined(ANDROID) 4 | 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | class DetectionBasedTracker 11 | { 12 | public: 13 | struct Parameters 14 | { 15 | int minObjectSize; 16 | int maxObjectSize; 17 | double scaleFactor; 18 | int maxTrackLifetime; 19 | int minNeighbors; 20 | int minDetectionPeriod; //the minimal time between run of the big object detector (on the whole frame) in ms (1000 mean 1 sec), default=0 21 | 22 | Parameters(); 23 | }; 24 | 25 | DetectionBasedTracker(const std::string& cascadeFilename, const Parameters& params); 26 | virtual ~DetectionBasedTracker(); 27 | 28 | virtual bool run(); 29 | virtual void stop(); 30 | virtual void resetTracking(); 31 | 32 | virtual void process(const cv::Mat& imageGray); 33 | 34 | bool setParameters(const Parameters& params); 35 | const Parameters& getParameters(); 36 | 37 | 38 | typedef std::pair Object; 39 | virtual void getObjects(std::vector& result) const; 40 | virtual void getObjects(std::vector& result) const; 41 | 42 | protected: 43 | class SeparateDetectionWork; 44 | cv::Ptr separateDetectionWork; 45 | friend void* workcycleObjectDetectorFunction(void* p); 46 | 47 | 48 | struct InnerParameters 49 | { 50 | int numLastPositionsToTrack; 51 | int numStepsToWaitBeforeFirstShow; 52 | int numStepsToTrackWithoutDetectingIfObjectHasNotBeenShown; 53 | int numStepsToShowWithoutDetecting; 54 | 55 | float coeffTrackingWindowSize; 56 | float coeffObjectSizeToTrack; 57 | float coeffObjectSpeedUsingInPrediction; 58 | 59 | InnerParameters(); 60 | }; 61 | Parameters parameters; 62 | InnerParameters innerParameters; 63 | 64 | struct TrackedObject 65 | { 66 | typedef std::vector PositionsVector; 67 | 68 | PositionsVector lastPositions; 69 | 70 | int numDetectedFrames; 71 | int numFramesNotDetected; 72 | int id; 73 | 74 | TrackedObject(const cv::Rect& rect):numDetectedFrames(1), numFramesNotDetected(0) 75 | { 76 | lastPositions.push_back(rect); 77 | id=getNextId(); 78 | }; 79 | 80 | static int getNextId() 81 | { 82 | static int _id=0; 83 | return _id++; 84 | } 85 | }; 86 | 87 | int numTrackedSteps; 88 | std::vector trackedObjects; 89 | 90 | std::vector weightsPositionsSmoothing; 91 | std::vector weightsSizesSmoothing; 92 | 93 | cv::CascadeClassifier cascadeForTracking; 94 | 95 | 96 | void updateTrackedObjects(const std::vector& detectedObjects); 97 | cv::Rect calcTrackedObjectPositionToShow(int i) const; 98 | void detectInRegion(const cv::Mat& img, const cv::Rect& r, std::vector& detectedObjectsInRegions); 99 | }; 100 | 101 | namespace cv 102 | { 103 | using ::DetectionBasedTracker; 104 | } //end of cv namespace 105 | 106 | #endif 107 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/core/devmem2d.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #include "opencv2/core/cuda_devptrs.hpp" 44 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/core/version.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // Intel License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright( C) 2000, Intel Corporation, all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of Intel Corporation may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the Intel Corporation or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | //(including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort(including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | /* 43 | definition of the current version of OpenCV 44 | Usefull to test in user programs 45 | */ 46 | 47 | #ifndef __OPENCV_VERSION_HPP__ 48 | #define __OPENCV_VERSION_HPP__ 49 | 50 | #define CV_VERSION_EPOCH 2 51 | #define CV_VERSION_MAJOR 4 52 | #define CV_VERSION_MINOR 10 53 | #define CV_VERSION_REVISION 0 54 | 55 | #define CVAUX_STR_EXP(__A) #__A 56 | #define CVAUX_STR(__A) CVAUX_STR_EXP(__A) 57 | 58 | #define CVAUX_STRW_EXP(__A) L#__A 59 | #define CVAUX_STRW(__A) CVAUX_STRW_EXP(__A) 60 | 61 | #if CV_VERSION_REVISION 62 | # define CV_VERSION CVAUX_STR(CV_VERSION_EPOCH) "." CVAUX_STR(CV_VERSION_MAJOR) "." CVAUX_STR(CV_VERSION_MINOR) "." CVAUX_STR(CV_VERSION_REVISION) 63 | #else 64 | # define CV_VERSION CVAUX_STR(CV_VERSION_EPOCH) "." CVAUX_STR(CV_VERSION_MAJOR) "." CVAUX_STR(CV_VERSION_MINOR) 65 | #endif 66 | 67 | /* old style version constants*/ 68 | #define CV_MAJOR_VERSION CV_VERSION_EPOCH 69 | #define CV_MINOR_VERSION CV_VERSION_MAJOR 70 | #define CV_SUBMINOR_VERSION CV_VERSION_MINOR 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/flann/config.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | *************************************************************************/ 28 | 29 | 30 | #ifndef OPENCV_FLANN_CONFIG_H_ 31 | #define OPENCV_FLANN_CONFIG_H_ 32 | 33 | #ifdef FLANN_VERSION_ 34 | #undef FLANN_VERSION_ 35 | #endif 36 | #define FLANN_VERSION_ "1.6.10" 37 | 38 | #endif /* OPENCV_FLANN_CONFIG_H_ */ 39 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/flann/dummy.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef OPENCV_FLANN_DUMMY_H_ 3 | #define OPENCV_FLANN_DUMMY_H_ 4 | 5 | namespace cvflann 6 | { 7 | 8 | #if (defined WIN32 || defined _WIN32 || defined WINCE) && defined CVAPI_EXPORTS 9 | __declspec(dllexport) 10 | #endif 11 | void dummyfunc(); 12 | 13 | } 14 | 15 | 16 | #endif /* OPENCV_FLANN_DUMMY_H_ */ 17 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/flann/general.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef OPENCV_FLANN_GENERAL_H_ 32 | #define OPENCV_FLANN_GENERAL_H_ 33 | 34 | #include "defines.h" 35 | #include 36 | #include 37 | 38 | namespace cvflann 39 | { 40 | 41 | class FLANNException : public std::runtime_error 42 | { 43 | public: 44 | FLANNException(const char* message) : std::runtime_error(message) { } 45 | 46 | FLANNException(const std::string& message) : std::runtime_error(message) { } 47 | }; 48 | 49 | } 50 | 51 | 52 | #endif /* OPENCV_FLANN_GENERAL_H_ */ 53 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/flann/ground_truth.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef OPENCV_FLANN_GROUND_TRUTH_H_ 32 | #define OPENCV_FLANN_GROUND_TRUTH_H_ 33 | 34 | #include "dist.h" 35 | #include "matrix.h" 36 | 37 | 38 | namespace cvflann 39 | { 40 | 41 | template 42 | void find_nearest(const Matrix& dataset, typename Distance::ElementType* query, int* matches, int nn, 43 | int skip = 0, Distance distance = Distance()) 44 | { 45 | typedef typename Distance::ResultType DistanceType; 46 | int n = nn + skip; 47 | 48 | std::vector match(n); 49 | std::vector dists(n); 50 | 51 | dists[0] = distance(dataset[0], query, dataset.cols); 52 | match[0] = 0; 53 | int dcnt = 1; 54 | 55 | for (size_t i=1; i=1 && dists[j] 83 | void compute_ground_truth(const Matrix& dataset, const Matrix& testset, Matrix& matches, 84 | int skip=0, Distance d = Distance()) 85 | { 86 | for (size_t i=0; i(dataset, testset[i], matches[i], (int)matches.cols, skip, d); 88 | } 89 | } 90 | 91 | 92 | } 93 | 94 | #endif //OPENCV_FLANN_GROUND_TRUTH_H_ 95 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/flann/linear_index.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef OPENCV_FLANN_LINEAR_INDEX_H_ 32 | #define OPENCV_FLANN_LINEAR_INDEX_H_ 33 | 34 | #include "general.h" 35 | #include "nn_index.h" 36 | 37 | namespace cvflann 38 | { 39 | 40 | struct LinearIndexParams : public IndexParams 41 | { 42 | LinearIndexParams() 43 | { 44 | (* this)["algorithm"] = FLANN_INDEX_LINEAR; 45 | } 46 | }; 47 | 48 | template 49 | class LinearIndex : public NNIndex 50 | { 51 | public: 52 | 53 | typedef typename Distance::ElementType ElementType; 54 | typedef typename Distance::ResultType DistanceType; 55 | 56 | 57 | LinearIndex(const Matrix& inputData, const IndexParams& params = LinearIndexParams(), 58 | Distance d = Distance()) : 59 | dataset_(inputData), index_params_(params), distance_(d) 60 | { 61 | } 62 | 63 | LinearIndex(const LinearIndex&); 64 | LinearIndex& operator=(const LinearIndex&); 65 | 66 | flann_algorithm_t getType() const 67 | { 68 | return FLANN_INDEX_LINEAR; 69 | } 70 | 71 | 72 | size_t size() const 73 | { 74 | return dataset_.rows; 75 | } 76 | 77 | size_t veclen() const 78 | { 79 | return dataset_.cols; 80 | } 81 | 82 | 83 | int usedMemory() const 84 | { 85 | return 0; 86 | } 87 | 88 | void buildIndex() 89 | { 90 | /* nothing to do here for linear search */ 91 | } 92 | 93 | void saveIndex(FILE*) 94 | { 95 | /* nothing to do here for linear search */ 96 | } 97 | 98 | 99 | void loadIndex(FILE*) 100 | { 101 | /* nothing to do here for linear search */ 102 | 103 | index_params_["algorithm"] = getType(); 104 | } 105 | 106 | void findNeighbors(ResultSet& resultSet, const ElementType* vec, const SearchParams& /*searchParams*/) 107 | { 108 | ElementType* data = dataset_.data; 109 | for (size_t i = 0; i < dataset_.rows; ++i, data += dataset_.cols) { 110 | DistanceType dist = distance_(data, vec, dataset_.cols); 111 | resultSet.addPoint(dist, (int)i); 112 | } 113 | } 114 | 115 | IndexParams getParameters() const 116 | { 117 | return index_params_; 118 | } 119 | 120 | private: 121 | /** The dataset */ 122 | const Matrix dataset_; 123 | /** Index parameters */ 124 | IndexParams index_params_; 125 | /** Index distance */ 126 | Distance distance_; 127 | 128 | }; 129 | 130 | } 131 | 132 | #endif // OPENCV_FLANN_LINEAR_INDEX_H_ 133 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/flann/logger.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef OPENCV_FLANN_LOGGER_H 32 | #define OPENCV_FLANN_LOGGER_H 33 | 34 | #include 35 | #include 36 | 37 | #include "defines.h" 38 | 39 | 40 | namespace cvflann 41 | { 42 | 43 | class Logger 44 | { 45 | Logger() : stream(stdout), logLevel(FLANN_LOG_WARN) {} 46 | 47 | ~Logger() 48 | { 49 | if ((stream!=NULL)&&(stream!=stdout)) { 50 | fclose(stream); 51 | } 52 | } 53 | 54 | static Logger& instance() 55 | { 56 | static Logger logger; 57 | return logger; 58 | } 59 | 60 | void _setDestination(const char* name) 61 | { 62 | if (name==NULL) { 63 | stream = stdout; 64 | } 65 | else { 66 | stream = fopen(name,"w"); 67 | if (stream == NULL) { 68 | stream = stdout; 69 | } 70 | } 71 | } 72 | 73 | int _log(int level, const char* fmt, va_list arglist) 74 | { 75 | if (level > logLevel ) return -1; 76 | int ret = vfprintf(stream, fmt, arglist); 77 | return ret; 78 | } 79 | 80 | public: 81 | /** 82 | * Sets the logging level. All messages with lower priority will be ignored. 83 | * @param level Logging level 84 | */ 85 | static void setLevel(int level) { instance().logLevel = level; } 86 | 87 | /** 88 | * Sets the logging destination 89 | * @param name Filename or NULL for console 90 | */ 91 | static void setDestination(const char* name) { instance()._setDestination(name); } 92 | 93 | /** 94 | * Print log message 95 | * @param level Log level 96 | * @param fmt Message format 97 | * @return 98 | */ 99 | static int log(int level, const char* fmt, ...) 100 | { 101 | va_list arglist; 102 | va_start(arglist, fmt); 103 | int ret = instance()._log(level,fmt,arglist); 104 | va_end(arglist); 105 | return ret; 106 | } 107 | 108 | #define LOG_METHOD(NAME,LEVEL) \ 109 | static int NAME(const char* fmt, ...) \ 110 | { \ 111 | va_list ap; \ 112 | va_start(ap, fmt); \ 113 | int ret = instance()._log(LEVEL, fmt, ap); \ 114 | va_end(ap); \ 115 | return ret; \ 116 | } 117 | 118 | LOG_METHOD(fatal, FLANN_LOG_FATAL) 119 | LOG_METHOD(error, FLANN_LOG_ERROR) 120 | LOG_METHOD(warn, FLANN_LOG_WARN) 121 | LOG_METHOD(info, FLANN_LOG_INFO) 122 | 123 | private: 124 | FILE* stream; 125 | int logLevel; 126 | }; 127 | 128 | } 129 | 130 | #endif //OPENCV_FLANN_LOGGER_H 131 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/flann/matrix.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef OPENCV_FLANN_DATASET_H_ 32 | #define OPENCV_FLANN_DATASET_H_ 33 | 34 | #include 35 | 36 | #include "general.h" 37 | 38 | namespace cvflann 39 | { 40 | 41 | /** 42 | * Class that implements a simple rectangular matrix stored in a memory buffer and 43 | * provides convenient matrix-like access using the [] operators. 44 | */ 45 | template 46 | class Matrix 47 | { 48 | public: 49 | typedef T type; 50 | 51 | size_t rows; 52 | size_t cols; 53 | size_t stride; 54 | T* data; 55 | 56 | Matrix() : rows(0), cols(0), stride(0), data(NULL) 57 | { 58 | } 59 | 60 | Matrix(T* data_, size_t rows_, size_t cols_, size_t stride_ = 0) : 61 | rows(rows_), cols(cols_), stride(stride_), data(data_) 62 | { 63 | if (stride==0) stride = cols; 64 | } 65 | 66 | /** 67 | * Convenience function for deallocating the storage data. 68 | */ 69 | FLANN_DEPRECATED void free() 70 | { 71 | fprintf(stderr, "The cvflann::Matrix::free() method is deprecated " 72 | "and it does not do any memory deallocation any more. You are" 73 | "responsible for deallocating the matrix memory (by doing" 74 | "'delete[] matrix.data' for example)"); 75 | } 76 | 77 | /** 78 | * Operator that return a (pointer to a) row of the data. 79 | */ 80 | T* operator[](size_t index) const 81 | { 82 | return data+index*stride; 83 | } 84 | }; 85 | 86 | 87 | class UntypedMatrix 88 | { 89 | public: 90 | size_t rows; 91 | size_t cols; 92 | void* data; 93 | flann_datatype_t type; 94 | 95 | UntypedMatrix(void* data_, long rows_, long cols_) : 96 | rows(rows_), cols(cols_), data(data_) 97 | { 98 | } 99 | 100 | ~UntypedMatrix() 101 | { 102 | } 103 | 104 | 105 | template 106 | Matrix as() 107 | { 108 | return Matrix((T*)data, rows, cols); 109 | } 110 | }; 111 | 112 | 113 | 114 | } 115 | 116 | #endif //OPENCV_FLANN_DATASET_H_ 117 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/flann/object_factory.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef OPENCV_FLANN_OBJECT_FACTORY_H_ 32 | #define OPENCV_FLANN_OBJECT_FACTORY_H_ 33 | 34 | #include 35 | 36 | namespace cvflann 37 | { 38 | 39 | class CreatorNotFound 40 | { 41 | }; 42 | 43 | template 46 | class ObjectFactory 47 | { 48 | typedef ObjectFactory ThisClass; 49 | typedef std::map ObjectRegistry; 50 | 51 | // singleton class, private constructor 52 | ObjectFactory() {} 53 | 54 | public: 55 | 56 | bool subscribe(UniqueIdType id, ObjectCreator creator) 57 | { 58 | if (object_registry.find(id) != object_registry.end()) return false; 59 | 60 | object_registry[id] = creator; 61 | return true; 62 | } 63 | 64 | bool unregister(UniqueIdType id) 65 | { 66 | return object_registry.erase(id) == 1; 67 | } 68 | 69 | ObjectCreator create(UniqueIdType id) 70 | { 71 | typename ObjectRegistry::const_iterator iter = object_registry.find(id); 72 | 73 | if (iter == object_registry.end()) { 74 | throw CreatorNotFound(); 75 | } 76 | 77 | return iter->second; 78 | } 79 | 80 | static ThisClass& instance() 81 | { 82 | static ThisClass the_factory; 83 | return the_factory; 84 | } 85 | private: 86 | ObjectRegistry object_registry; 87 | }; 88 | 89 | } 90 | 91 | #endif /* OPENCV_FLANN_OBJECT_FACTORY_H_ */ 92 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/flann/params.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | *************************************************************************/ 28 | 29 | 30 | #ifndef OPENCV_FLANN_PARAMS_H_ 31 | #define OPENCV_FLANN_PARAMS_H_ 32 | 33 | #include "any.h" 34 | #include "general.h" 35 | #include 36 | #include 37 | 38 | 39 | namespace cvflann 40 | { 41 | 42 | typedef std::map IndexParams; 43 | 44 | struct SearchParams : public IndexParams 45 | { 46 | SearchParams(int checks = 32, float eps = 0, bool sorted = true ) 47 | { 48 | // how many leafs to visit when searching for neighbours (-1 for unlimited) 49 | (*this)["checks"] = checks; 50 | // search for eps-approximate neighbours (default: 0) 51 | (*this)["eps"] = eps; 52 | // only for radius search, require neighbours sorted by distance (default: true) 53 | (*this)["sorted"] = sorted; 54 | } 55 | }; 56 | 57 | 58 | template 59 | T get_param(const IndexParams& params, std::string name, const T& default_value) 60 | { 61 | IndexParams::const_iterator it = params.find(name); 62 | if (it != params.end()) { 63 | return it->second.cast(); 64 | } 65 | else { 66 | return default_value; 67 | } 68 | } 69 | 70 | template 71 | T get_param(const IndexParams& params, std::string name) 72 | { 73 | IndexParams::const_iterator it = params.find(name); 74 | if (it != params.end()) { 75 | return it->second.cast(); 76 | } 77 | else { 78 | throw FLANNException(std::string("Missing parameter '")+name+std::string("' in the parameters given")); 79 | } 80 | } 81 | 82 | inline void print_params(const IndexParams& params, std::ostream& stream) 83 | { 84 | IndexParams::const_iterator it; 85 | 86 | for(it=params.begin(); it!=params.end(); ++it) { 87 | stream << it->first << " : " << it->second << std::endl; 88 | } 89 | } 90 | 91 | inline void print_params(const IndexParams& params) 92 | { 93 | print_params(params, std::cout); 94 | } 95 | 96 | } 97 | 98 | 99 | #endif /* OPENCV_FLANN_PARAMS_H_ */ 100 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/flann/random.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef OPENCV_FLANN_RANDOM_H 32 | #define OPENCV_FLANN_RANDOM_H 33 | 34 | #include 35 | #include 36 | #include 37 | 38 | #include "general.h" 39 | 40 | namespace cvflann 41 | { 42 | 43 | /** 44 | * Seeds the random number generator 45 | * @param seed Random seed 46 | */ 47 | inline void seed_random(unsigned int seed) 48 | { 49 | srand(seed); 50 | } 51 | 52 | /* 53 | * Generates a random double value. 54 | */ 55 | /** 56 | * Generates a random double value. 57 | * @param high Upper limit 58 | * @param low Lower limit 59 | * @return Random double value 60 | */ 61 | inline double rand_double(double high = 1.0, double low = 0) 62 | { 63 | return low + ((high-low) * (std::rand() / (RAND_MAX + 1.0))); 64 | } 65 | 66 | /** 67 | * Generates a random integer value. 68 | * @param high Upper limit 69 | * @param low Lower limit 70 | * @return Random integer value 71 | */ 72 | inline int rand_int(int high = RAND_MAX, int low = 0) 73 | { 74 | return low + (int) ( double(high-low) * (std::rand() / (RAND_MAX + 1.0))); 75 | } 76 | 77 | /** 78 | * Random number generator that returns a distinct number from 79 | * the [0,n) interval each time. 80 | */ 81 | class UniqueRandom 82 | { 83 | std::vector vals_; 84 | int size_; 85 | int counter_; 86 | 87 | public: 88 | /** 89 | * Constructor. 90 | * @param n Size of the interval from which to generate 91 | * @return 92 | */ 93 | UniqueRandom(int n) 94 | { 95 | init(n); 96 | } 97 | 98 | /** 99 | * Initializes the number generator. 100 | * @param n the size of the interval from which to generate random numbers. 101 | */ 102 | void init(int n) 103 | { 104 | // create and initialize an array of size n 105 | vals_.resize(n); 106 | size_ = n; 107 | for (int i = 0; i < size_; ++i) vals_[i] = i; 108 | 109 | // shuffle the elements in the array 110 | std::random_shuffle(vals_.begin(), vals_.end()); 111 | 112 | counter_ = 0; 113 | } 114 | 115 | /** 116 | * Return a distinct random integer in greater or equal to 0 and less 117 | * than 'n' on each call. It should be called maximum 'n' times. 118 | * Returns: a random integer 119 | */ 120 | int next() 121 | { 122 | if (counter_ == size_) { 123 | return -1; 124 | } 125 | else { 126 | return vals_[counter_++]; 127 | } 128 | } 129 | }; 130 | 131 | } 132 | 133 | #endif //OPENCV_FLANN_RANDOM_H 134 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/flann/sampling.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | *************************************************************************/ 28 | 29 | 30 | #ifndef OPENCV_FLANN_SAMPLING_H_ 31 | #define OPENCV_FLANN_SAMPLING_H_ 32 | 33 | #include "matrix.h" 34 | #include "random.h" 35 | 36 | namespace cvflann 37 | { 38 | 39 | template 40 | Matrix random_sample(Matrix& srcMatrix, long size, bool remove = false) 41 | { 42 | Matrix newSet(new T[size * srcMatrix.cols], size,srcMatrix.cols); 43 | 44 | T* src,* dest; 45 | for (long i=0; i 63 | Matrix random_sample(const Matrix& srcMatrix, size_t size) 64 | { 65 | UniqueRandom rand((int)srcMatrix.rows); 66 | Matrix newSet(new T[size * srcMatrix.cols], size,srcMatrix.cols); 67 | 68 | T* src,* dest; 69 | for (size_t i=0; i 35 | 36 | 37 | namespace cvflann 38 | { 39 | 40 | /** 41 | * A start-stop timer class. 42 | * 43 | * Can be used to time portions of code. 44 | */ 45 | class StartStopTimer 46 | { 47 | clock_t startTime; 48 | 49 | public: 50 | /** 51 | * Value of the timer. 52 | */ 53 | double value; 54 | 55 | 56 | /** 57 | * Constructor. 58 | */ 59 | StartStopTimer() 60 | { 61 | reset(); 62 | } 63 | 64 | /** 65 | * Starts the timer. 66 | */ 67 | void start() 68 | { 69 | startTime = clock(); 70 | } 71 | 72 | /** 73 | * Stops the timer and updates timer value. 74 | */ 75 | void stop() 76 | { 77 | clock_t stopTime = clock(); 78 | value += ( (double)stopTime - startTime) / CLOCKS_PER_SEC; 79 | } 80 | 81 | /** 82 | * Resets the timer value to 0. 83 | */ 84 | void reset() 85 | { 86 | value = 0; 87 | } 88 | 89 | }; 90 | 91 | } 92 | 93 | #endif // FLANN_TIMER_H 94 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/gpu/device/dynamic_smem.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_GPU_DYNAMIC_SMEM_HPP__ 44 | #define __OPENCV_GPU_DYNAMIC_SMEM_HPP__ 45 | 46 | namespace cv { namespace gpu { namespace device 47 | { 48 | template struct DynamicSharedMem 49 | { 50 | __device__ __forceinline__ operator T*() 51 | { 52 | extern __shared__ int __smem[]; 53 | return (T*)__smem; 54 | } 55 | 56 | __device__ __forceinline__ operator const T*() const 57 | { 58 | extern __shared__ int __smem[]; 59 | return (T*)__smem; 60 | } 61 | }; 62 | 63 | // specialize for double to avoid unaligned memory access compile errors 64 | template<> struct DynamicSharedMem 65 | { 66 | __device__ __forceinline__ operator double*() 67 | { 68 | extern __shared__ double __smem_d[]; 69 | return (double*)__smem_d; 70 | } 71 | 72 | __device__ __forceinline__ operator const double*() const 73 | { 74 | extern __shared__ double __smem_d[]; 75 | return (double*)__smem_d; 76 | } 77 | }; 78 | }}} 79 | 80 | #endif // __OPENCV_GPU_DYNAMIC_SMEM_HPP__ 81 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/gpu/device/funcattrib.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_GPU_DEVICE_FUNCATTRIB_HPP_ 44 | #define __OPENCV_GPU_DEVICE_FUNCATTRIB_HPP_ 45 | 46 | #include 47 | 48 | namespace cv { namespace gpu { namespace device 49 | { 50 | template 51 | void printFuncAttrib(Func& func) 52 | { 53 | 54 | cudaFuncAttributes attrs; 55 | cudaFuncGetAttributes(&attrs, func); 56 | 57 | printf("=== Function stats ===\n"); 58 | printf("Name: \n"); 59 | printf("sharedSizeBytes = %d\n", attrs.sharedSizeBytes); 60 | printf("constSizeBytes = %d\n", attrs.constSizeBytes); 61 | printf("localSizeBytes = %d\n", attrs.localSizeBytes); 62 | printf("maxThreadsPerBlock = %d\n", attrs.maxThreadsPerBlock); 63 | printf("numRegs = %d\n", attrs.numRegs); 64 | printf("ptxVersion = %d\n", attrs.ptxVersion); 65 | printf("binaryVersion = %d\n", attrs.binaryVersion); 66 | printf("\n"); 67 | fflush(stdout); 68 | } 69 | }}} // namespace cv { namespace gpu { namespace device 70 | 71 | #endif /* __OPENCV_GPU_DEVICE_FUNCATTRIB_HPP_ */ 72 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/gpu/device/static_check.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_GPU_GPU_DEVICE_STATIC_CHECK_HPP__ 44 | #define __OPENCV_GPU_GPU_DEVICE_STATIC_CHECK_HPP__ 45 | 46 | #if defined(__CUDACC__) 47 | #define __OPENCV_GPU_HOST_DEVICE__ __host__ __device__ __forceinline__ 48 | #else 49 | #define __OPENCV_GPU_HOST_DEVICE__ 50 | #endif 51 | 52 | namespace cv { namespace gpu 53 | { 54 | namespace device 55 | { 56 | template struct Static {}; 57 | 58 | template<> struct Static 59 | { 60 | __OPENCV_GPU_HOST_DEVICE__ static void check() {}; 61 | }; 62 | } 63 | }} 64 | 65 | #undef __OPENCV_GPU_HOST_DEVICE__ 66 | 67 | #endif /* __OPENCV_GPU_GPU_DEVICE_STATIC_CHECK_HPP__ */ 68 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/gpu/device/transform.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_GPU_TRANSFORM_HPP__ 44 | #define __OPENCV_GPU_TRANSFORM_HPP__ 45 | 46 | #include "common.hpp" 47 | #include "utility.hpp" 48 | #include "detail/transform_detail.hpp" 49 | 50 | namespace cv { namespace gpu { namespace device 51 | { 52 | template 53 | static inline void transform(PtrStepSz src, PtrStepSz dst, UnOp op, const Mask& mask, cudaStream_t stream) 54 | { 55 | typedef TransformFunctorTraits ft; 56 | transform_detail::TransformDispatcher::cn == 1 && VecTraits::cn == 1 && ft::smart_shift != 1>::call(src, dst, op, mask, stream); 57 | } 58 | 59 | template 60 | static inline void transform(PtrStepSz src1, PtrStepSz src2, PtrStepSz dst, BinOp op, const Mask& mask, cudaStream_t stream) 61 | { 62 | typedef TransformFunctorTraits ft; 63 | transform_detail::TransformDispatcher::cn == 1 && VecTraits::cn == 1 && VecTraits::cn == 1 && ft::smart_shift != 1>::call(src1, src2, dst, op, mask, stream); 64 | } 65 | }}} 66 | 67 | #endif // __OPENCV_GPU_TRANSFORM_HPP__ 68 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/gpu/device/warp_reduce.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef OPENCV_GPU_WARP_REDUCE_HPP__ 44 | #define OPENCV_GPU_WARP_REDUCE_HPP__ 45 | 46 | namespace cv { namespace gpu { namespace device 47 | { 48 | template 49 | __device__ __forceinline__ T warp_reduce(volatile T *ptr , const unsigned int tid = threadIdx.x) 50 | { 51 | const unsigned int lane = tid & 31; // index of thread in warp (0..31) 52 | 53 | if (lane < 16) 54 | { 55 | T partial = ptr[tid]; 56 | 57 | ptr[tid] = partial = partial + ptr[tid + 16]; 58 | ptr[tid] = partial = partial + ptr[tid + 8]; 59 | ptr[tid] = partial = partial + ptr[tid + 4]; 60 | ptr[tid] = partial = partial + ptr[tid + 2]; 61 | ptr[tid] = partial = partial + ptr[tid + 1]; 62 | } 63 | 64 | return ptr[tid - lane]; 65 | } 66 | }}} // namespace cv { namespace gpu { namespace device { 67 | 68 | #endif /* OPENCV_GPU_WARP_REDUCE_HPP__ */ 69 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/gpu/devmem2d.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #include "opencv2/core/cuda_devptrs.hpp" 44 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/gpu/gpumat.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #include "opencv2/core/gpumat.hpp" 44 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/gpu/stream_accessor.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_GPU_STREAM_ACCESSOR_HPP__ 44 | #define __OPENCV_GPU_STREAM_ACCESSOR_HPP__ 45 | 46 | #include "opencv2/gpu/gpu.hpp" 47 | #include "cuda_runtime_api.h" 48 | 49 | namespace cv 50 | { 51 | namespace gpu 52 | { 53 | // This is only header file that depends on Cuda. All other headers are independent. 54 | // So if you use OpenCV binaries you do noot need to install Cuda Toolkit. 55 | // But of you wanna use GPU by yourself, may get cuda stream instance using the class below. 56 | // In this case you have to install Cuda Toolkit. 57 | struct StreamAccessor 58 | { 59 | CV_EXPORTS static cudaStream_t getStream(const Stream& stream); 60 | }; 61 | } 62 | } 63 | 64 | #endif /* __OPENCV_GPU_STREAM_ACCESSOR_HPP__ */ 65 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/highgui/ios.h: -------------------------------------------------------------------------------- 1 | 2 | /*M/////////////////////////////////////////////////////////////////////////////////////// 3 | // 4 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 5 | // 6 | // By downloading, copying, installing or using the software you agree to this license. 7 | // If you do not agree to this license, do not download, install, 8 | // copy or use the software. 9 | // 10 | // 11 | // License Agreement 12 | // For Open Source Computer Vision Library 13 | // 14 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 15 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #include "opencv2/core/core.hpp" 45 | #import "opencv2/highgui/cap_ios.h" 46 | 47 | UIImage* MatToUIImage(const cv::Mat& image); 48 | void UIImageToMat(const UIImage* image, 49 | cv::Mat& m, bool alphaExist = false); 50 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/nonfree/nonfree.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2012, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_NONFREE_HPP__ 44 | #define __OPENCV_NONFREE_HPP__ 45 | 46 | #include "opencv2/nonfree/features2d.hpp" 47 | 48 | namespace cv 49 | { 50 | 51 | CV_EXPORTS_W bool initModule_nonfree(); 52 | 53 | } 54 | 55 | #endif 56 | 57 | /* End of file. */ 58 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/opencv.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2010, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_ALL_HPP__ 44 | #define __OPENCV_ALL_HPP__ 45 | 46 | #include "opencv2/core/core_c.h" 47 | #include "opencv2/core/core.hpp" 48 | #include "opencv2/flann/miniflann.hpp" 49 | #include "opencv2/imgproc/imgproc_c.h" 50 | #include "opencv2/imgproc/imgproc.hpp" 51 | #include "opencv2/photo/photo.hpp" 52 | #include "opencv2/video/video.hpp" 53 | #include "opencv2/features2d/features2d.hpp" 54 | #include "opencv2/objdetect/objdetect.hpp" 55 | #include "opencv2/calib3d/calib3d.hpp" 56 | #include "opencv2/ml/ml.hpp" 57 | #include "opencv2/highgui/highgui_c.h" 58 | #include "opencv2/highgui/highgui.hpp" 59 | #include "opencv2/contrib/contrib.hpp" 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/opencv_modules.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * ** File generated automatically, do not modify ** 3 | * 4 | * This file defines the list of modules available in current build configuration 5 | * 6 | * 7 | */ 8 | 9 | #define HAVE_OPENCV_CALIB3D 10 | #define HAVE_OPENCV_CONTRIB 11 | #define HAVE_OPENCV_CORE 12 | #define HAVE_OPENCV_FEATURES2D 13 | #define HAVE_OPENCV_FLANN 14 | #define HAVE_OPENCV_GPU 15 | #define HAVE_OPENCV_HIGHGUI 16 | #define HAVE_OPENCV_IMGPROC 17 | #define HAVE_OPENCV_LEGACY 18 | #define HAVE_OPENCV_ML 19 | #define HAVE_OPENCV_NONFREE 20 | #define HAVE_OPENCV_OBJDETECT 21 | #define HAVE_OPENCV_OCL 22 | #define HAVE_OPENCV_PHOTO 23 | #define HAVE_OPENCV_STITCHING 24 | #define HAVE_OPENCV_SUPERRES 25 | #define HAVE_OPENCV_TS 26 | #define HAVE_OPENCV_VIDEO 27 | #define HAVE_OPENCV_VIDEOSTAB 28 | 29 | 30 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/photo/photo.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2008-2012, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_PHOTO_HPP__ 44 | #define __OPENCV_PHOTO_HPP__ 45 | 46 | #include "opencv2/core/core.hpp" 47 | #include "opencv2/imgproc/imgproc.hpp" 48 | 49 | #include "opencv2/photo/photo_c.h" 50 | 51 | #ifdef __cplusplus 52 | 53 | /*! \namespace cv 54 | Namespace where all the C++ OpenCV functionality resides 55 | */ 56 | namespace cv 57 | { 58 | 59 | //! the inpainting algorithm 60 | enum 61 | { 62 | INPAINT_NS=CV_INPAINT_NS, // Navier-Stokes algorithm 63 | INPAINT_TELEA=CV_INPAINT_TELEA // A. Telea algorithm 64 | }; 65 | 66 | //! restores the damaged image areas using one of the available intpainting algorithms 67 | CV_EXPORTS_W void inpaint( InputArray src, InputArray inpaintMask, 68 | OutputArray dst, double inpaintRadius, int flags ); 69 | 70 | 71 | CV_EXPORTS_W void fastNlMeansDenoising( InputArray src, OutputArray dst, float h = 3, 72 | int templateWindowSize = 7, int searchWindowSize = 21); 73 | 74 | CV_EXPORTS_W void fastNlMeansDenoisingColored( InputArray src, OutputArray dst, 75 | float h = 3, float hColor = 3, 76 | int templateWindowSize = 7, int searchWindowSize = 21); 77 | 78 | CV_EXPORTS_W void fastNlMeansDenoisingMulti( InputArrayOfArrays srcImgs, OutputArray dst, 79 | int imgToDenoiseIndex, int temporalWindowSize, 80 | float h = 3, int templateWindowSize = 7, int searchWindowSize = 21); 81 | 82 | CV_EXPORTS_W void fastNlMeansDenoisingColoredMulti( InputArrayOfArrays srcImgs, OutputArray dst, 83 | int imgToDenoiseIndex, int temporalWindowSize, 84 | float h = 3, float hColor = 3, 85 | int templateWindowSize = 7, int searchWindowSize = 21); 86 | 87 | } 88 | 89 | #endif //__cplusplus 90 | 91 | #endif 92 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/photo/photo_c.h: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2008-2012, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_PHOTO_C_H__ 44 | #define __OPENCV_PHOTO_C_H__ 45 | 46 | #include "opencv2/core/core_c.h" 47 | 48 | #ifdef __cplusplus 49 | extern "C" { 50 | #endif 51 | 52 | /* Inpainting algorithms */ 53 | enum 54 | { 55 | CV_INPAINT_NS =0, 56 | CV_INPAINT_TELEA =1 57 | }; 58 | 59 | 60 | /* Inpaints the selected region in the image */ 61 | CVAPI(void) cvInpaint( const CvArr* src, const CvArr* inpaint_mask, 62 | CvArr* dst, double inpaintRange, int flags ); 63 | 64 | 65 | #ifdef __cplusplus 66 | } //extern "C" 67 | #endif 68 | 69 | #endif //__OPENCV_PHOTO_C_H__ 70 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/stitching/detail/autocalib.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_STITCHING_AUTOCALIB_HPP__ 44 | #define __OPENCV_STITCHING_AUTOCALIB_HPP__ 45 | 46 | #include "opencv2/core/core.hpp" 47 | #include "matchers.hpp" 48 | 49 | namespace cv { 50 | namespace detail { 51 | 52 | // See "Construction of Panoramic Image Mosaics with Global and Local Alignment" 53 | // by Heung-Yeung Shum and Richard Szeliski. 54 | void CV_EXPORTS focalsFromHomography(const Mat &H, double &f0, double &f1, bool &f0_ok, bool &f1_ok); 55 | 56 | void CV_EXPORTS estimateFocal(const std::vector &features, 57 | const std::vector &pairwise_matches, 58 | std::vector &focals); 59 | 60 | bool CV_EXPORTS calibrateRotatingCamera(const std::vector &Hs, Mat &K); 61 | 62 | } // namespace detail 63 | } // namespace cv 64 | 65 | #endif // __OPENCV_STITCHING_AUTOCALIB_HPP__ 66 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/stitching/detail/camera.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_STITCHING_CAMERA_HPP__ 44 | #define __OPENCV_STITCHING_CAMERA_HPP__ 45 | 46 | #include "opencv2/core/core.hpp" 47 | 48 | namespace cv { 49 | namespace detail { 50 | 51 | struct CV_EXPORTS CameraParams 52 | { 53 | CameraParams(); 54 | CameraParams(const CameraParams& other); 55 | const CameraParams& operator =(const CameraParams& other); 56 | Mat K() const; 57 | 58 | double focal; // Focal length 59 | double aspect; // Aspect ratio 60 | double ppx; // Principal point X 61 | double ppy; // Principal point Y 62 | Mat R; // Rotation 63 | Mat t; // Translation 64 | }; 65 | 66 | } // namespace detail 67 | } // namespace cv 68 | 69 | #endif // #ifndef __OPENCV_STITCHING_CAMERA_HPP__ 70 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/superres/optical_flow.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_SUPERRES_OPTICAL_FLOW_HPP__ 44 | #define __OPENCV_SUPERRES_OPTICAL_FLOW_HPP__ 45 | 46 | #include "opencv2/core/core.hpp" 47 | 48 | namespace cv 49 | { 50 | namespace superres 51 | { 52 | class CV_EXPORTS DenseOpticalFlowExt : public cv::Algorithm 53 | { 54 | public: 55 | virtual void calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2 = noArray()) = 0; 56 | virtual void collectGarbage() = 0; 57 | }; 58 | 59 | CV_EXPORTS Ptr createOptFlow_Farneback(); 60 | CV_EXPORTS Ptr createOptFlow_Farneback_GPU(); 61 | CV_EXPORTS Ptr createOptFlow_Farneback_OCL(); 62 | 63 | CV_EXPORTS Ptr createOptFlow_Simple(); 64 | 65 | CV_EXPORTS Ptr createOptFlow_DualTVL1(); 66 | CV_EXPORTS Ptr createOptFlow_DualTVL1_GPU(); 67 | CV_EXPORTS Ptr createOptFlow_DualTVL1_OCL(); 68 | 69 | CV_EXPORTS Ptr createOptFlow_Brox_GPU(); 70 | 71 | CV_EXPORTS Ptr createOptFlow_PyrLK_GPU(); 72 | CV_EXPORTS Ptr createOptFlow_PyrLK_OCL(); 73 | } 74 | } 75 | 76 | #endif // __OPENCV_SUPERRES_OPTICAL_FLOW_HPP__ 77 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/video/video.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_VIDEO_HPP__ 44 | #define __OPENCV_VIDEO_HPP__ 45 | 46 | #include "opencv2/video/tracking.hpp" 47 | #include "opencv2/video/background_segm.hpp" 48 | 49 | #ifdef __cplusplus 50 | namespace cv 51 | { 52 | 53 | CV_EXPORTS bool initModule_video(void); 54 | 55 | } 56 | #endif 57 | 58 | #endif //__OPENCV_VIDEO_HPP__ 59 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/videostab/fast_marching.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_VIDEOSTAB_FAST_MARCHING_HPP__ 44 | #define __OPENCV_VIDEOSTAB_FAST_MARCHING_HPP__ 45 | 46 | #include 47 | #include 48 | #include 49 | #include "opencv2/core/core.hpp" 50 | 51 | namespace cv 52 | { 53 | namespace videostab 54 | { 55 | 56 | // See http://iwi.eldoc.ub.rug.nl/FILES/root/2004/JGraphToolsTelea/2004JGraphToolsTelea.pdf 57 | class CV_EXPORTS FastMarchingMethod 58 | { 59 | public: 60 | FastMarchingMethod() : inf_(1e6f) {} 61 | 62 | template 63 | Inpaint run(const Mat &mask, Inpaint inpaint); 64 | 65 | Mat distanceMap() const { return dist_; } 66 | 67 | private: 68 | enum { INSIDE = 0, BAND = 1, KNOWN = 255 }; 69 | 70 | struct DXY 71 | { 72 | float dist; 73 | int x, y; 74 | 75 | DXY() : dist(0), x(0), y(0) {} 76 | DXY(float _dist, int _x, int _y) : dist(_dist), x(_x), y(_y) {} 77 | bool operator <(const DXY &dxy) const { return dist < dxy.dist; } 78 | }; 79 | 80 | float solve(int x1, int y1, int x2, int y2) const; 81 | int& indexOf(const DXY &dxy) { return index_(dxy.y, dxy.x); } 82 | 83 | void heapUp(int idx); 84 | void heapDown(int idx); 85 | void heapAdd(const DXY &dxy); 86 | void heapRemoveMin(); 87 | 88 | float inf_; 89 | 90 | cv::Mat_ flag_; // flag map 91 | cv::Mat_ dist_; // distance map 92 | 93 | cv::Mat_ index_; // index of point in the narrow band 94 | std::vector narrowBand_; // narrow band heap 95 | int size_; // narrow band size 96 | }; 97 | 98 | } // namespace videostab 99 | } // namespace cv 100 | 101 | #include "fast_marching_inl.hpp" 102 | 103 | #endif 104 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/videostab/frame_source.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_VIDEOSTAB_FRAME_SOURCE_HPP__ 44 | #define __OPENCV_VIDEOSTAB_FRAME_SOURCE_HPP__ 45 | 46 | #include 47 | #include 48 | #include "opencv2/core/core.hpp" 49 | #include "opencv2/highgui/highgui.hpp" 50 | 51 | namespace cv 52 | { 53 | namespace videostab 54 | { 55 | 56 | class CV_EXPORTS IFrameSource 57 | { 58 | public: 59 | virtual ~IFrameSource() {} 60 | virtual void reset() = 0; 61 | virtual Mat nextFrame() = 0; 62 | }; 63 | 64 | class CV_EXPORTS NullFrameSource : public IFrameSource 65 | { 66 | public: 67 | virtual void reset() {} 68 | virtual Mat nextFrame() { return Mat(); } 69 | }; 70 | 71 | class CV_EXPORTS VideoFileSource : public IFrameSource 72 | { 73 | public: 74 | VideoFileSource(const std::string &path, bool volatileFrame = false); 75 | 76 | virtual void reset(); 77 | virtual Mat nextFrame(); 78 | 79 | int frameCount() { return static_cast(reader_.get(CV_CAP_PROP_FRAME_COUNT)); } 80 | double fps() { return reader_.get(CV_CAP_PROP_FPS); } 81 | 82 | private: 83 | std::string path_; 84 | bool volatileFrame_; 85 | VideoCapture reader_; 86 | }; 87 | 88 | } // namespace videostab 89 | } // namespace cv 90 | 91 | #endif 92 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/videostab/log.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_VIDEOSTAB_LOG_HPP__ 44 | #define __OPENCV_VIDEOSTAB_LOG_HPP__ 45 | 46 | #include "opencv2/core/core.hpp" 47 | 48 | namespace cv 49 | { 50 | namespace videostab 51 | { 52 | 53 | class CV_EXPORTS ILog 54 | { 55 | public: 56 | virtual ~ILog() {} 57 | virtual void print(const char *format, ...) = 0; 58 | }; 59 | 60 | class CV_EXPORTS NullLog : public ILog 61 | { 62 | public: 63 | virtual void print(const char * /*format*/, ...) {} 64 | }; 65 | 66 | class CV_EXPORTS LogToStdout : public ILog 67 | { 68 | public: 69 | virtual void print(const char *format, ...); 70 | }; 71 | 72 | } // namespace videostab 73 | } // namespace cv 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/videostab/motion_stabilizing.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_VIDEOSTAB_MOTION_STABILIZING_HPP__ 44 | #define __OPENCV_VIDEOSTAB_MOTION_STABILIZING_HPP__ 45 | 46 | #include 47 | #include "opencv2/core/core.hpp" 48 | 49 | namespace cv 50 | { 51 | namespace videostab 52 | { 53 | 54 | class CV_EXPORTS IMotionStabilizer 55 | { 56 | public: 57 | virtual void stabilize(const Mat *motions, int size, Mat *stabilizationMotions) const = 0; 58 | 59 | #ifdef OPENCV_CAN_BREAK_BINARY_COMPATIBILITY 60 | virtual ~IMotionStabilizer() {} 61 | #endif 62 | }; 63 | 64 | class CV_EXPORTS MotionFilterBase : public IMotionStabilizer 65 | { 66 | public: 67 | MotionFilterBase() : radius_(0) {} 68 | virtual ~MotionFilterBase() {} 69 | 70 | virtual void setRadius(int val) { radius_ = val; } 71 | virtual int radius() const { return radius_; } 72 | 73 | virtual void update() {} 74 | 75 | virtual Mat stabilize(int index, const Mat *motions, int size) const = 0; 76 | virtual void stabilize(const Mat *motions, int size, Mat *stabilizationMotions) const; 77 | 78 | protected: 79 | int radius_; 80 | }; 81 | 82 | class CV_EXPORTS GaussianMotionFilter : public MotionFilterBase 83 | { 84 | public: 85 | GaussianMotionFilter() : stdev_(-1.f) {} 86 | 87 | void setStdev(float val) { stdev_ = val; } 88 | float stdev() const { return stdev_; } 89 | 90 | virtual void update(); 91 | 92 | virtual Mat stabilize(int index, const Mat *motions, int size) const; 93 | 94 | private: 95 | float stdev_; 96 | std::vector weight_; 97 | }; 98 | 99 | CV_EXPORTS Mat ensureInclusionConstraint(const Mat &M, Size size, float trimRatio); 100 | 101 | CV_EXPORTS float estimateOptimalTrimRatio(const Mat &M, Size size); 102 | 103 | } // namespace videostab 104 | } // namespace 105 | 106 | #endif 107 | -------------------------------------------------------------------------------- /OpenCV/include/opencv2/videostab/videostab.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_VIDEOSTAB_HPP__ 44 | #define __OPENCV_VIDEOSTAB_HPP__ 45 | 46 | #include "opencv2/videostab/stabilizer.hpp" 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /OpenCV/lib - backup/opencv_calib3d2410.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib - backup/opencv_calib3d2410.lib -------------------------------------------------------------------------------- /OpenCV/lib - backup/opencv_calib3d2410d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib - backup/opencv_calib3d2410d.lib -------------------------------------------------------------------------------- /OpenCV/lib - backup/opencv_contrib2410.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib - backup/opencv_contrib2410.lib -------------------------------------------------------------------------------- /OpenCV/lib - backup/opencv_contrib2410d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib - backup/opencv_contrib2410d.lib -------------------------------------------------------------------------------- /OpenCV/lib - backup/opencv_core2410.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib - backup/opencv_core2410.lib -------------------------------------------------------------------------------- /OpenCV/lib - backup/opencv_core2410d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib - backup/opencv_core2410d.lib -------------------------------------------------------------------------------- /OpenCV/lib - backup/opencv_features2d2410.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib - backup/opencv_features2d2410.lib -------------------------------------------------------------------------------- /OpenCV/lib - backup/opencv_features2d2410d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib - backup/opencv_features2d2410d.lib -------------------------------------------------------------------------------- /OpenCV/lib - backup/opencv_flann2410.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib - backup/opencv_flann2410.lib -------------------------------------------------------------------------------- /OpenCV/lib - backup/opencv_flann2410d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib - backup/opencv_flann2410d.lib -------------------------------------------------------------------------------- /OpenCV/lib - backup/opencv_gpu2410.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib - backup/opencv_gpu2410.lib -------------------------------------------------------------------------------- /OpenCV/lib - backup/opencv_gpu2410d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib - backup/opencv_gpu2410d.lib -------------------------------------------------------------------------------- /OpenCV/lib - backup/opencv_highgui2410.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib - backup/opencv_highgui2410.lib -------------------------------------------------------------------------------- /OpenCV/lib - backup/opencv_highgui2410d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib - backup/opencv_highgui2410d.lib -------------------------------------------------------------------------------- /OpenCV/lib - backup/opencv_imgproc2410.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib - backup/opencv_imgproc2410.lib -------------------------------------------------------------------------------- /OpenCV/lib - backup/opencv_imgproc2410d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib - backup/opencv_imgproc2410d.lib -------------------------------------------------------------------------------- /OpenCV/lib - backup/opencv_legacy2410.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib - backup/opencv_legacy2410.lib -------------------------------------------------------------------------------- /OpenCV/lib - backup/opencv_legacy2410d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib - backup/opencv_legacy2410d.lib -------------------------------------------------------------------------------- /OpenCV/lib - backup/opencv_ml2410.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib - backup/opencv_ml2410.lib -------------------------------------------------------------------------------- /OpenCV/lib - backup/opencv_ml2410d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib - backup/opencv_ml2410d.lib -------------------------------------------------------------------------------- /OpenCV/lib - backup/opencv_objdetect2410.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib - backup/opencv_objdetect2410.lib -------------------------------------------------------------------------------- /OpenCV/lib - backup/opencv_objdetect2410d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib - backup/opencv_objdetect2410d.lib -------------------------------------------------------------------------------- /OpenCV/lib - backup/opencv_video2410.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib - backup/opencv_video2410.lib -------------------------------------------------------------------------------- /OpenCV/lib - backup/opencv_video2410d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib - backup/opencv_video2410d.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_calib3d2410.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_calib3d2410.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_calib3d2410d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_calib3d2410d.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_contrib2410.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_contrib2410.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_contrib2410d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_contrib2410d.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_core2410.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_core2410.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_core2410d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_core2410d.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_features2d2410.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_features2d2410.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_features2d2410d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_features2d2410d.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_flann2410.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_flann2410.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_flann2410d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_flann2410d.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_gpu2410.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_gpu2410.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_gpu2410d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_gpu2410d.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_highgui2410.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_highgui2410.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_highgui2410d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_highgui2410d.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_imgproc2410.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_imgproc2410.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_imgproc2410d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_imgproc2410d.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_legacy2410.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_legacy2410.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_legacy2410d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_legacy2410d.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_ml2410.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_ml2410.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_ml2410d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_ml2410d.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_nonfree2410.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_nonfree2410.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_nonfree2410d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_nonfree2410d.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_objdetect2410.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_objdetect2410.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_objdetect2410d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_objdetect2410d.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_ocl2410.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_ocl2410.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_ocl2410d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_ocl2410d.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_photo2410.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_photo2410.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_photo2410d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_photo2410d.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_stitching2410.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_stitching2410.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_stitching2410d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_stitching2410d.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_superres2410.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_superres2410.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_superres2410d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_superres2410d.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_ts2410.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_ts2410.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_ts2410d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_ts2410d.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_video2410.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_video2410.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_video2410d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_video2410d.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_videostab2410.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_videostab2410.lib -------------------------------------------------------------------------------- /OpenCV/lib/opencv_videostab2410d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/OpenCV/lib/opencv_videostab2410d.lib -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Hello Bird! 2 | An object detection program -- detecting the Goofy Bird 3 | 4 | ### Quick Links 5 | - [Demo Video](http://users.wpi.edu/~mfeng2/diy/hellobird/hellobird.html) 6 | - [Blogpost: (for Windows) OpenCV Installation and Visual Studio Project Configuration](http://www.mifeng.name/2014/11/24/Install-OpenCV-&-Configure-Visual-Studio-Project.html) 7 | 8 | ### Detection Technique 9 | - Histogram of Oriented Gradients (HoG) 10 | - Support Vector Machine (SVM) 11 | - Color Detection using HSL Color Model 12 | 13 | ### Environment and Libraries 14 | - OpenCV v2.4.10 (useful libs and dlls are included in the project folder) 15 | - Visual Studio 2013 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Release/opencv_calib3d2410.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Release/opencv_calib3d2410.dll -------------------------------------------------------------------------------- /Release/opencv_contrib2410.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Release/opencv_contrib2410.dll -------------------------------------------------------------------------------- /Release/opencv_core2410.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Release/opencv_core2410.dll -------------------------------------------------------------------------------- /Release/opencv_features2d2410.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Release/opencv_features2d2410.dll -------------------------------------------------------------------------------- /Release/opencv_ffmpeg2410.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Release/opencv_ffmpeg2410.dll -------------------------------------------------------------------------------- /Release/opencv_flann2410.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Release/opencv_flann2410.dll -------------------------------------------------------------------------------- /Release/opencv_gpu2410.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Release/opencv_gpu2410.dll -------------------------------------------------------------------------------- /Release/opencv_highgui2410.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Release/opencv_highgui2410.dll -------------------------------------------------------------------------------- /Release/opencv_imgproc2410.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Release/opencv_imgproc2410.dll -------------------------------------------------------------------------------- /Release/opencv_legacy2410.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Release/opencv_legacy2410.dll -------------------------------------------------------------------------------- /Release/opencv_ml2410.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Release/opencv_ml2410.dll -------------------------------------------------------------------------------- /Release/opencv_nonfree2410.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Release/opencv_nonfree2410.dll -------------------------------------------------------------------------------- /Release/opencv_objdetect2410.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Release/opencv_objdetect2410.dll -------------------------------------------------------------------------------- /Release/opencv_ocl2410.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Release/opencv_ocl2410.dll -------------------------------------------------------------------------------- /Release/opencv_photo2410.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Release/opencv_photo2410.dll -------------------------------------------------------------------------------- /Release/opencv_stitching2410.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Release/opencv_stitching2410.dll -------------------------------------------------------------------------------- /Release/opencv_superres2410.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Release/opencv_superres2410.dll -------------------------------------------------------------------------------- /Release/opencv_video2410.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Release/opencv_video2410.dll -------------------------------------------------------------------------------- /Release/opencv_videostab2410.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mia-mifeng/ObjectDetection/495c7a2b891bdb330ca8dea0f4161ca3b5c105db/Release/opencv_videostab2410.dll --------------------------------------------------------------------------------