├── README.md ├── Tracking.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── Tracking.xccheckout │ └── xcuserdata │ │ └── FloodSurge.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── FloodSurge.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── Tracking.xcscheme │ └── xcschememanagement.plist ├── Tracking ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard ├── CMT │ ├── CMT.cpp │ ├── CMT.h │ ├── Consensus.cpp │ ├── Consensus.h │ ├── Fusion.cpp │ ├── Fusion.h │ ├── LICENSE │ ├── Matcher.cpp │ ├── Matcher.h │ ├── Tracker.cpp │ ├── Tracker.h │ ├── common.cpp │ ├── common.h │ ├── fastcluster.cpp │ └── fastcluster.h ├── Camshift │ ├── Camshift.cpp │ └── Camshift.h ├── ColorTracker │ ├── color_tracker.cpp │ ├── color_tracker.h │ ├── color_tracker_parameters.cpp │ ├── color_tracker_parameters.h │ └── w2crs.txt ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── TLD │ ├── BB.cpp │ ├── BB.h │ ├── BBPredict.cpp │ ├── BBPredict.h │ ├── Clustering.cpp │ ├── Clustering.h │ ├── DetectionResult.cpp │ ├── DetectionResult.h │ ├── DetectorCascade.cpp │ ├── DetectorCascade.h │ ├── EnsembleClassifier.cpp │ ├── EnsembleClassifier.h │ ├── FBTrack.cpp │ ├── FBTrack.h │ ├── ForegroundDetector.cpp │ ├── ForegroundDetector.h │ ├── IntegralImage.h │ ├── Lk.cpp │ ├── Lk.h │ ├── Median.cpp │ ├── Median.h │ ├── MedianFlowTracker.cpp │ ├── MedianFlowTracker.h │ ├── NNClassifier.cpp │ ├── NNClassifier.h │ ├── NormalizedPatch.h │ ├── TLD.cpp │ ├── TLD.h │ ├── TLDUtil.cpp │ ├── TLDUtil.h │ ├── VarianceFilter.cpp │ ├── VarianceFilter.h │ ├── config-sample.cfg │ └── cvBlob │ │ ├── BlobContour.h │ │ ├── BlobContour.mm │ │ ├── BlobLibraryConfiguration.h │ │ ├── BlobOperators.h │ │ ├── BlobOperators.mm │ │ ├── BlobProperties.h │ │ ├── BlobProperties.mm │ │ ├── BlobResult.h │ │ ├── BlobResult.mm │ │ ├── ComponentLabeling.h │ │ ├── ComponentLabeling.mm │ │ ├── README │ │ ├── blob.h │ │ ├── blob.mm │ │ └── cxtypes.h ├── ViewController.h ├── ViewController.mm ├── ct │ ├── CompressiveTracker.cpp │ └── CompressiveTracker.h ├── main.m └── struck │ ├── Config.cpp │ ├── Config.h │ ├── Eigen │ ├── Array │ ├── CMakeLists.txt │ ├── Cholesky │ ├── Core │ ├── Dense │ ├── Eigen │ ├── Geometry │ ├── LU │ ├── LeastSquares │ ├── NewStdVector │ ├── QR │ ├── QtAlignedMalloc │ ├── SVD │ ├── Sparse │ ├── StdVector │ └── src │ │ ├── Array │ │ ├── BooleanRedux.h │ │ ├── CMakeLists.txt │ │ ├── CwiseOperators.h │ │ ├── Functors.h │ │ ├── Norms.h │ │ ├── PartialRedux.h │ │ ├── Random.h │ │ └── Select.h │ │ ├── CMakeLists.txt │ │ ├── Cholesky │ │ ├── CMakeLists.txt │ │ ├── CholeskyInstantiations.cpp │ │ ├── LDLT.h │ │ └── LLT.h │ │ ├── Core │ │ ├── Assign.h │ │ ├── Block.h │ │ ├── CMakeLists.txt │ │ ├── CacheFriendlyProduct.h │ │ ├── Coeffs.h │ │ ├── CommaInitializer.h │ │ ├── CoreInstantiations.cpp │ │ ├── Cwise.h │ │ ├── CwiseBinaryOp.h │ │ ├── CwiseNullaryOp.h │ │ ├── CwiseUnaryOp.h │ │ ├── DiagonalCoeffs.h │ │ ├── DiagonalMatrix.h │ │ ├── DiagonalProduct.h │ │ ├── Dot.h │ │ ├── Flagged.h │ │ ├── Functors.h │ │ ├── Fuzzy.h │ │ ├── GenericPacketMath.h │ │ ├── IO.h │ │ ├── Map.h │ │ ├── MapBase.h │ │ ├── MathFunctions.h │ │ ├── Matrix.h │ │ ├── MatrixBase.h │ │ ├── MatrixStorage.h │ │ ├── Minor.h │ │ ├── NestByValue.h │ │ ├── NumTraits.h │ │ ├── Part.h │ │ ├── Product.h │ │ ├── Redux.h │ │ ├── SolveTriangular.h │ │ ├── Sum.h │ │ ├── Swap.h │ │ ├── Transpose.h │ │ ├── Visitor.h │ │ ├── arch │ │ │ ├── AltiVec │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── PacketMath.h │ │ │ ├── CMakeLists.txt │ │ │ └── SSE │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── PacketMath.h │ │ └── util │ │ │ ├── CMakeLists.txt │ │ │ ├── Constants.h │ │ │ ├── DisableMSVCWarnings.h │ │ │ ├── EnableMSVCWarnings.h │ │ │ ├── ForwardDeclarations.h │ │ │ ├── Macros.h │ │ │ ├── Memory.h │ │ │ ├── Meta.h │ │ │ ├── StaticAssert.h │ │ │ └── XprHelper.h │ │ ├── Geometry │ │ ├── AlignedBox.h │ │ ├── AngleAxis.h │ │ ├── CMakeLists.txt │ │ ├── EulerAngles.h │ │ ├── Hyperplane.h │ │ ├── OrthoMethods.h │ │ ├── ParametrizedLine.h │ │ ├── Quaternion.h │ │ ├── Rotation2D.h │ │ ├── RotationBase.h │ │ ├── Scaling.h │ │ ├── Transform.h │ │ └── Translation.h │ │ ├── LU │ │ ├── CMakeLists.txt │ │ ├── Determinant.h │ │ ├── Inverse.h │ │ └── LU.h │ │ ├── LeastSquares │ │ ├── CMakeLists.txt │ │ └── LeastSquares.h │ │ ├── QR │ │ ├── CMakeLists.txt │ │ ├── EigenSolver.h │ │ ├── HessenbergDecomposition.h │ │ ├── QR.h │ │ ├── QrInstantiations.cpp │ │ ├── SelfAdjointEigenSolver.h │ │ └── Tridiagonalization.h │ │ ├── SVD │ │ ├── CMakeLists.txt │ │ └── SVD.h │ │ └── Sparse │ │ ├── AmbiVector.h │ │ ├── CMakeLists.txt │ │ ├── CholmodSupport.h │ │ ├── CompressedStorage.h │ │ ├── CoreIterators.h │ │ ├── DynamicSparseMatrix.h │ │ ├── MappedSparseMatrix.h │ │ ├── RandomSetter.h │ │ ├── SparseAssign.h │ │ ├── SparseBlock.h │ │ ├── SparseCwise.h │ │ ├── SparseCwiseBinaryOp.h │ │ ├── SparseCwiseUnaryOp.h │ │ ├── SparseDiagonalProduct.h │ │ ├── SparseDot.h │ │ ├── SparseFlagged.h │ │ ├── SparseFuzzy.h │ │ ├── SparseLDLT.h │ │ ├── SparseLLT.h │ │ ├── SparseLU.h │ │ ├── SparseMatrix.h │ │ ├── SparseMatrixBase.h │ │ ├── SparseProduct.h │ │ ├── SparseRedux.h │ │ ├── SparseTranspose.h │ │ ├── SparseUtil.h │ │ ├── SparseVector.h │ │ ├── SuperLUSupport.h │ │ ├── TaucsSupport.h │ │ ├── TriangularSolver.h │ │ └── UmfPackSupport.h │ ├── Features.cpp │ ├── Features.h │ ├── GraphUtils │ ├── GraphUtils.cpp │ └── GraphUtils.h │ ├── HaarFeature.cpp │ ├── HaarFeature.h │ ├── HaarFeatures.cpp │ ├── HaarFeatures.h │ ├── HistogramFeatures.cpp │ ├── HistogramFeatures.h │ ├── ImageRep.cpp │ ├── ImageRep.h │ ├── Kernels.h │ ├── LaRank.cpp │ ├── LaRank.h │ ├── MultiFeatures.cpp │ ├── MultiFeatures.h │ ├── RawFeatures.cpp │ ├── RawFeatures.h │ ├── Sample.h │ ├── Sampler.cpp │ ├── Sampler.h │ ├── StruckRect.h │ ├── StruckTracker.cpp │ ├── StruckTracker.h │ ├── config.txt │ └── main.cpp ├── TrackingTests ├── Info.plist └── TrackingTests.m └── opencv2.framework ├── Headers ├── Resources ├── Versions ├── A │ ├── Headers │ │ ├── calib3d.hpp │ │ ├── calib3d │ │ │ ├── calib3d.hpp │ │ │ └── calib3d_c.h │ │ ├── core.hpp │ │ ├── core │ │ │ ├── affine.hpp │ │ │ ├── base.hpp │ │ │ ├── bufferpool.hpp │ │ │ ├── core.hpp │ │ │ ├── core_c.h │ │ │ ├── cuda.hpp │ │ │ ├── cuda.inl.hpp │ │ │ ├── cuda_stream_accessor.hpp │ │ │ ├── cuda_types.hpp │ │ │ ├── cvdef.h │ │ │ ├── cvstd.hpp │ │ │ ├── cvstd.inl.hpp │ │ │ ├── directx.hpp │ │ │ ├── eigen.hpp │ │ │ ├── ippasync.hpp │ │ │ ├── mat.hpp │ │ │ ├── mat.inl.hpp │ │ │ ├── matx.hpp │ │ │ ├── ocl.hpp │ │ │ ├── ocl_genbase.hpp │ │ │ ├── opengl.hpp │ │ │ ├── operations.hpp │ │ │ ├── optim.hpp │ │ │ ├── persistence.hpp │ │ │ ├── private.cuda.hpp │ │ │ ├── private.hpp │ │ │ ├── ptr.inl.hpp │ │ │ ├── traits.hpp │ │ │ ├── types.hpp │ │ │ ├── types_c.h │ │ │ ├── utility.hpp │ │ │ ├── version.hpp │ │ │ └── wimage.hpp │ │ ├── features2d.hpp │ │ ├── features2d │ │ │ └── features2d.hpp │ │ ├── flann.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 │ │ ├── highgui.hpp │ │ ├── highgui │ │ │ ├── highgui.hpp │ │ │ └── highgui_c.h │ │ ├── imgcodecs.hpp │ │ ├── imgcodecs │ │ │ ├── imgcodecs.hpp │ │ │ ├── imgcodecs_c.h │ │ │ └── ios.h │ │ ├── imgproc.hpp │ │ ├── imgproc │ │ │ ├── imgproc.hpp │ │ │ ├── imgproc_c.h │ │ │ └── types_c.h │ │ ├── ml.hpp │ │ ├── ml │ │ │ └── ml.hpp │ │ ├── objdetect.hpp │ │ ├── objdetect │ │ │ ├── detection_based_tracker.hpp │ │ │ ├── objdetect.hpp │ │ │ └── objdetect_c.h │ │ ├── opencv.hpp │ │ ├── opencv_modules.hpp │ │ ├── photo.hpp │ │ ├── photo │ │ │ ├── cuda.hpp │ │ │ ├── photo.hpp │ │ │ └── photo_c.h │ │ ├── shape.hpp │ │ ├── shape │ │ │ ├── emdL1.hpp │ │ │ ├── hist_cost.hpp │ │ │ ├── shape.hpp │ │ │ ├── shape_distance.hpp │ │ │ └── shape_transformer.hpp │ │ ├── stitching.hpp │ │ ├── stitching │ │ │ ├── detail │ │ │ │ ├── autocalib.hpp │ │ │ │ ├── blenders.hpp │ │ │ │ ├── camera.hpp │ │ │ │ ├── exposure_compensate.hpp │ │ │ │ ├── matchers.hpp │ │ │ │ ├── motion_estimators.hpp │ │ │ │ ├── seam_finders.hpp │ │ │ │ ├── timelapsers.hpp │ │ │ │ ├── util.hpp │ │ │ │ ├── util_inl.hpp │ │ │ │ ├── warpers.hpp │ │ │ │ └── warpers_inl.hpp │ │ │ └── warpers.hpp │ │ ├── video.hpp │ │ ├── video │ │ │ ├── background_segm.hpp │ │ │ ├── tracking.hpp │ │ │ ├── tracking_c.h │ │ │ └── video.hpp │ │ ├── videoio.hpp │ │ ├── videoio │ │ │ ├── cap_ios.h │ │ │ ├── videoio.hpp │ │ │ └── videoio_c.h │ │ ├── videostab.hpp │ │ ├── videostab │ │ │ ├── deblurring.hpp │ │ │ ├── fast_marching.hpp │ │ │ ├── fast_marching_inl.hpp │ │ │ ├── frame_source.hpp │ │ │ ├── global_motion.hpp │ │ │ ├── inpainting.hpp │ │ │ ├── log.hpp │ │ │ ├── motion_core.hpp │ │ │ ├── motion_stabilizing.hpp │ │ │ ├── optical_flow.hpp │ │ │ ├── outlier_rejection.hpp │ │ │ ├── ring_buffer.hpp │ │ │ ├── stabilizer.hpp │ │ │ └── wobble_suppression.hpp │ │ └── world.hpp │ ├── Resources │ │ └── Info.plist │ └── opencv2 └── Current └── opencv2 /README.md: -------------------------------------------------------------------------------- 1 | # Tracking-on-iOS 2 | Test Several Visual Object Tracking Algorithm on iOS include TLD,CMT,CT,Camshift,Color Tracking,Struck 3 | The Result is CMT is the best Tracking Algorithm that could be implemented in real device in real time. 4 | -------------------------------------------------------------------------------- /Tracking.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Tracking.xcodeproj/project.xcworkspace/xcshareddata/Tracking.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | E75949AD-3750-42E7-BEB8-FD9C44CE53E5 9 | IDESourceControlProjectName 10 | Tracking 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | CF1429F9EC4D2E28FB8C92E24BDD6627FE0C522A 14 | https://github.com/songrotek/Tracking-on-iOS.git 15 | 16 | IDESourceControlProjectPath 17 | Tracking.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | CF1429F9EC4D2E28FB8C92E24BDD6627FE0C522A 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/songrotek/Tracking-on-iOS.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | CF1429F9EC4D2E28FB8C92E24BDD6627FE0C522A 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | CF1429F9EC4D2E28FB8C92E24BDD6627FE0C522A 36 | IDESourceControlWCCName 37 | Tracking 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Tracking.xcodeproj/project.xcworkspace/xcuserdata/FloodSurge.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/floodsung/Tracking-on-iOS/e87e420a8a24ee5ea47b1af930742e9c97dacc7b/Tracking.xcodeproj/project.xcworkspace/xcuserdata/FloodSurge.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Tracking.xcodeproj/xcuserdata/FloodSurge.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Tracking.xcodeproj/xcuserdata/FloodSurge.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Tracking.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 445C819E1B6EF4050051413A 16 | 17 | primary 18 | 19 | 20 | 445C81B71B6EF4060051413A 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Tracking/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // Tracking 4 | // 5 | // Created by FloodSurge on 8/3/15. 6 | // Copyright (c) 2015 FloodSurge. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /Tracking/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // Tracking 4 | // 5 | // Created by FloodSurge on 8/3/15. 6 | // Copyright (c) 2015 FloodSurge. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Tracking/CMT/CMT.h: -------------------------------------------------------------------------------- 1 | #ifndef CMT_H 2 | 3 | #define CMT_H 4 | 5 | #include "common.h" 6 | #include "Consensus.h" 7 | #include "Fusion.h" 8 | #include "Matcher.h" 9 | #include "Tracker.h" 10 | 11 | #include 12 | 13 | using cv::FeatureDetector; 14 | using cv::DescriptorExtractor; 15 | 16 | using cv::RotatedRect; 17 | using cv::Size2f; 18 | 19 | namespace cmt 20 | { 21 | 22 | class CMT 23 | { 24 | public: 25 | CMT() : str_detector("FAST"), str_descriptor("BRISK") {}; 26 | void initialize(const Mat im_gray, const cv::Rect rect); 27 | void processFrame(const Mat im_gray); 28 | 29 | Fusion fusion; // 数据融合器 30 | Matcher matcher; // 特征匹配器 31 | Tracker tracker; // 跟踪器 32 | Consensus consensus; // 一致检查器 33 | 34 | string str_detector; 35 | string str_descriptor; 36 | 37 | vector points_active; //public for visualization purposes 有效特征点 38 | RotatedRect bb_rot; 39 | 40 | private: 41 | cv::Ptr detector; 42 | cv::Ptr descriptor; 43 | 44 | Size2f size_initial; // 初始大小 45 | 46 | vector classes_active; 47 | 48 | float theta; 49 | 50 | Mat im_prev; 51 | }; 52 | 53 | } /* namespace CMT */ 54 | 55 | #endif /* end of include guard: CMT_H */ 56 | -------------------------------------------------------------------------------- /Tracking/CMT/Consensus.h: -------------------------------------------------------------------------------- 1 | #ifndef CONSENSUS_H 2 | 3 | #define CONSENSUS_H 4 | 5 | #include "common.h" 6 | 7 | namespace cmt { 8 | 9 | class Consensus 10 | { 11 | public: 12 | Consensus() : estimate_scale(true), estimate_rotation(true), thr_cutoff(20) {}; 13 | 14 | void initialize(const vector & points_normalized); 15 | void estimateScaleRotation(const vector & points, const vector & classes, 16 | float & scale, float & rotation); 17 | void findConsensus(const vector & points, const vector & classes, 18 | const float scale, const float rotation, 19 | Point2f & center, vector & points_inlier, vector & classes_inlier); 20 | 21 | bool estimate_scale; 22 | bool estimate_rotation; 23 | 24 | private: 25 | float thr_cutoff; 26 | vector points_normalized; 27 | Mat distances_pairwise; 28 | Mat angles_pairwise; 29 | }; 30 | 31 | } /* namespace cmt */ 32 | 33 | #endif /* end of include guard: CONSENSUS_H */ 34 | -------------------------------------------------------------------------------- /Tracking/CMT/Fusion.cpp: -------------------------------------------------------------------------------- 1 | #include "Fusion.h" 2 | 3 | namespace cmt { 4 | 5 | void Fusion::preferFirst(const vector & points_first, const vector & classes_first, 6 | const vector & points_second, const vector & classes_second, 7 | vector & points_fused, vector & classes_fused) 8 | { 9 | //FILE_LOG(logDEBUG) << "Fusion::preferFirst() call"; 10 | 11 | points_fused = points_first; 12 | classes_fused = classes_first; 13 | 14 | for (size_t i = 0; i < points_second.size(); i++) 15 | { 16 | int class_second = classes_second[i]; 17 | 18 | bool found = false; 19 | for (size_t j = 0; j < points_first.size(); j++) 20 | { 21 | int class_first = classes_first[j]; 22 | if (class_first == class_second) found = true; 23 | } 24 | 25 | if (!found) 26 | { 27 | points_fused.push_back(points_second[i]); 28 | classes_fused.push_back(class_second); 29 | } 30 | 31 | } 32 | 33 | //FILE_LOG(logDEBUG) << "Fusion::preferFirst() return"; 34 | } 35 | 36 | } /* namespace cmt */ 37 | -------------------------------------------------------------------------------- /Tracking/CMT/Fusion.h: -------------------------------------------------------------------------------- 1 | #ifndef FUSION_H 2 | 3 | #define FUSION_H 4 | 5 | #include "common.h" 6 | 7 | namespace cmt { 8 | 9 | class Fusion 10 | { 11 | public: 12 | void preferFirst(const vector & firstPoints, const vector & firstClasses, 13 | const vector & secondPoints, const vector & secondClasses, 14 | vector & fusedPoints, vector & fusedClasses); 15 | }; 16 | 17 | } /* namespace CMT */ 18 | 19 | #endif /* end of include guard: FUSION_H */ 20 | -------------------------------------------------------------------------------- /Tracking/CMT/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, AIT Austrian Institute of Technology 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | 12 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 13 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 14 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 15 | DISCLAIMED. IN NO EVENT SHALL AIT Austrian Institute of Technology BE LIABLE FOR ANY 16 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 17 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 18 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 19 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 20 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 21 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 | 23 | -------------------------------------------------------------------------------- /Tracking/CMT/Matcher.h: -------------------------------------------------------------------------------- 1 | #ifndef MATCHER_H 2 | 3 | #define MATCHER_H 4 | 5 | #include "common.h" 6 | 7 | #include "opencv2/features2d/features2d.hpp" 8 | 9 | using cv::KeyPoint; 10 | using cv::DescriptorMatcher; 11 | 12 | namespace cmt { 13 | 14 | class Matcher 15 | { 16 | public: 17 | Matcher() : thr_dist(0.25), thr_ratio(0.8), thr_cutoff(20) {}; 18 | void initialize(const vector & pts_fg_norm, const Mat desc_fg, const vector & classes_fg, 19 | const Mat desc_bg, const Point2f center); 20 | void matchGlobal(const vector & keypoints, const Mat descriptors, 21 | vector & points_matched, vector & classes_matched); 22 | void matchLocal(const vector & keypoints, const Mat descriptors, 23 | const Point2f center, const float scale, const float rotation, 24 | vector & points_matched, vector & classes_matched); 25 | 26 | private: 27 | vector pts_fg_norm; 28 | Mat database; 29 | vector classes; 30 | int desc_length; 31 | int num_bg_points; 32 | cv::Ptr bfmatcher; 33 | float thr_dist; 34 | float thr_ratio; 35 | float thr_cutoff; 36 | }; 37 | 38 | } /* namespace CMT */ 39 | 40 | #endif /* end of include guard: MATCHER_H */ 41 | -------------------------------------------------------------------------------- /Tracking/CMT/Tracker.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "Tracker.h" 4 | 5 | namespace cmt { 6 | 7 | void Tracker::track(const Mat im_prev, const Mat im_gray, const vector & points_prev, 8 | vector & points_tracked, vector & status) 9 | { 10 | //FILE_LOG(logDEBUG) << "Tracker::track() call"; 11 | 12 | if (points_prev.size() > 0) 13 | { 14 | vector err; //Needs to be float 15 | 16 | //Calculate forward optical flow for prev_location 计算前向位置的光流(即特征点的移动) 17 | calcOpticalFlowPyrLK(im_prev, im_gray, points_prev, points_tracked, status, err); 18 | 19 | vector points_back; 20 | vector status_back; 21 | vector err_back; //Needs to be float 22 | 23 | //Calculate backward optical flow for prev_location 计算后向光流 24 | calcOpticalFlowPyrLK(im_gray, im_prev, points_tracked, points_back, status_back, err_back); 25 | 26 | //Traverse vector backward so we can remove points on the fly 删除掉飞掉的点 27 | for (int i = points_prev.size()-1; i >= 0; i--) 28 | { 29 | float l2norm = norm(points_back[i] - points_prev[i]); 30 | 31 | bool fb_err_is_large = l2norm > thr_fb; 32 | 33 | if (fb_err_is_large || !status[i] || !status_back[i]) 34 | { 35 | points_tracked.erase(points_tracked.begin() + i); 36 | 37 | //Make sure the status flag is set to 0 38 | status[i] = 0; 39 | } 40 | 41 | } 42 | 43 | } 44 | 45 | //FILE_LOG(logDEBUG) << "Tracker::track() return"; 46 | } 47 | 48 | } /* namespace cmt */ 49 | -------------------------------------------------------------------------------- /Tracking/CMT/Tracker.h: -------------------------------------------------------------------------------- 1 | #ifndef TRACKER_H 2 | 3 | #define TRACKER_H 4 | 5 | #include "common.h" 6 | 7 | namespace cmt { 8 | 9 | class Tracker 10 | { 11 | public: 12 | Tracker() : thr_fb(30) {}; 13 | void track(const Mat im_prev, const Mat im_gray, const vector & points_prev, 14 | vector & points_tracked, vector & status); 15 | 16 | private: 17 | float thr_fb; 18 | }; 19 | 20 | } /* namespace CMT */ 21 | 22 | #endif /* end of include guard: TRACKER_H */ 23 | -------------------------------------------------------------------------------- /Tracking/CMT/common.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | using std::nth_element; 4 | 5 | namespace cmt { 6 | 7 | //TODO: Check for even/uneven number of elements 8 | //The order of the elements of A is changed 9 | float median(vector & A) 10 | { 11 | 12 | if (A.size() == 0) 13 | { 14 | return numeric_limits::quiet_NaN(); 15 | } 16 | 17 | nth_element(A.begin(), A.begin() + A.size()/2, A.end()); 18 | 19 | return A[A.size()/2]; 20 | } 21 | 22 | Point2f rotate(const Point2f v, const float angle) 23 | { 24 | Point2f r; 25 | r.x = cos(angle) * v.x - sin(angle) * v.y; 26 | r.y = sin(angle) * v.x + cos(angle) * v.y; 27 | 28 | return r; 29 | } 30 | 31 | } /* namespace cmt */ 32 | -------------------------------------------------------------------------------- /Tracking/CMT/common.h: -------------------------------------------------------------------------------- 1 | #ifndef COMMON_H 2 | 3 | #define COMMON_H 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | 12 | using cv::Mat; 13 | using cv::Point2f; 14 | using cv::Size2f; 15 | using std::numeric_limits; 16 | using std::string; 17 | using std::vector; 18 | 19 | namespace cmt 20 | { 21 | float median(vector & A); 22 | Point2f rotate(const Point2f v, const float angle); 23 | template 24 | int sgn(T x) 25 | { 26 | if (x >=0) return 1; 27 | else return -1; 28 | } 29 | 30 | } /* namespace cmt */ 31 | 32 | #endif /* end of include guard: COMMON_H */ 33 | -------------------------------------------------------------------------------- /Tracking/Camshift/Camshift.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Camshift.cpp 3 | // Tracking 4 | // 5 | // Created by FloodSurge on 8/5/15. 6 | // Copyright (c) 2015 FloodSurge. All rights reserved. 7 | // 8 | 9 | #include "Camshift.h" 10 | 11 | void Camshift::initialize(const cv::Mat image, const cv::Rect objectBox) 12 | { 13 | selection = objectBox; 14 | 15 | cvtColor(image, hsv, CV_BGR2HSV); 16 | 17 | int vmin = 10,vmax = 256, smin = 30; 18 | 19 | inRange(hsv, Scalar(0,smin,MIN(vmin, vmax)), Scalar(180,256,MAX(vmin, vmax)), mask); 20 | 21 | int ch[] = {0,0}; 22 | hue.create(hsv.size(),hsv.depth()); 23 | mixChannels(&hsv, 1, &hue, 1, ch, 1); 24 | 25 | Mat roi(hue, selection), maskroi(mask, selection); 26 | float hranges[] = {0,180}; 27 | const float* phranges = hranges; 28 | calcHist(&roi, 1, 0, maskroi, hist, 1, &hsize, &phranges); 29 | normalize(hist, hist, 0, 255, NORM_MINMAX); 30 | 31 | } 32 | 33 | void Camshift::processFrame(const cv::Mat image) 34 | { 35 | 36 | cvtColor(image, hsv, CV_BGR2HSV); 37 | 38 | int vmin = 10,vmax = 256, smin = 30; 39 | 40 | inRange(hsv, Scalar(0,smin,MIN(vmin, vmax)), Scalar(180,256,MAX(vmin, vmax)), mask); 41 | 42 | int ch[] = {0,0}; 43 | hue.create(hsv.size(),hsv.depth()); 44 | mixChannels(&hsv, 1, &hue, 1, ch, 1); 45 | float hranges[] = {0,180}; 46 | const float* phranges = hranges; 47 | calcBackProject(&hue, 1, 0, hist, backproj, &phranges); 48 | backproj &= mask; 49 | objectBox = CamShift(backproj, selection, 50 | TermCriteria( TermCriteria::EPS | TermCriteria::COUNT, 10, 1 )); 51 | 52 | } 53 | 54 | Camshift::Camshift() 55 | { 56 | 57 | } 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Tracking/Camshift/Camshift.h: -------------------------------------------------------------------------------- 1 | // 2 | // Camshift.h 3 | // Tracking 4 | // 5 | // Created by FloodSurge on 8/5/15. 6 | // Copyright (c) 2015 FloodSurge. All rights reserved. 7 | // 8 | 9 | #ifndef __Tracking__Camshift__ 10 | #define __Tracking__Camshift__ 11 | 12 | #include 13 | #include 14 | 15 | #include 16 | 17 | using std::vector; 18 | using namespace cv; 19 | 20 | class Camshift { 21 | 22 | 23 | public: 24 | Camshift(); 25 | void initialize(const Mat image, const cv::Rect objectBox); 26 | void processFrame(const Mat image); 27 | RotatedRect objectBox; 28 | private: 29 | Mat frame, hsv, hue, mask, hist, histimg, backproj; 30 | cv::Rect selection; 31 | int hsize = 16; 32 | 33 | }; 34 | 35 | #endif /* defined(__Tracking__Camshift__) */ 36 | -------------------------------------------------------------------------------- /Tracking/ColorTracker/color_tracker_parameters.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015, Mostafa Mohamed (Izz) 3 | izz.mostafa@gmail.com 4 | 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification 8 | , are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | 3. Neither the name of the copyright holder nor the names of its contributors 18 | may be used to endorse or promote products derived from this software without 19 | specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 25 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 27 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 28 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 29 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | 34 | #include "color_tracker_parameters.h" 35 | 36 | using namespace cv::colortracker; 37 | 38 | ColorTrackerParameters::ColorTrackerParameters() 39 | { 40 | //parameters according to the paper 41 | padding = 1.0; // extra area surrounding the target 42 | output_sigma_factor = 1.0 / 16; // spatial bandwidth(proportional to target) 43 | sigma = 0.2; // gaussian kernel bandwidth 44 | lambda = 1e-2; // regularization(denoted "lambda" in the paper) 45 | learning_rate = 0.075; // learning rate for appearance model update scheme(denoted "gamma" in the paper) 46 | compression_learning_rate = 0.15; // learning rate for the adaptive dimensionality reduction(denoted "mu" in the paper) 47 | non_compressed_features = vector({ "gray" }); // features that are not compressed, a cell with strings(possible choices : 'gray', 'cn') 48 | compressed_features = vector({ "cn" }); // features that are compressed, a cell with strings(possible choices : 'gray', 'cn') 49 | num_compressed_dim = 2; // the dimensionality of the compressed features 50 | 51 | visualization = 1; 52 | } 53 | -------------------------------------------------------------------------------- /Tracking/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /Tracking/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.manmanlai.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationLandscapeLeft 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Tracking/TLD/BB.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2011 AIT Austrian Institute of Technology 2 | * 3 | * This file is part of OpenTLD. 4 | * 5 | * OpenTLD is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenTLD is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with OpenTLD. If not, see . 17 | * 18 | */ 19 | 20 | /** 21 | * @file bb.h 22 | * 23 | * Created on: 17.03.2011 24 | * @author: bernd 25 | * @brief 26 | */ 27 | 28 | #ifndef BB_H_ 29 | #define BB_H_ 30 | 31 | /** 32 | * @param bb Bounding box represented through 2 points(x1,y1,x2,y2) 33 | * @param numM Number of points in height direction. 34 | * @param numN Number of points in width direction. 35 | * @param margin margin (in pixel) 36 | * @param pts Contains the calculated points in the form (x1, y1, x2, y2). 37 | * Size of the array must be numM * numN * 2. 38 | */ 39 | int getFilledBBPoints(float *bb, int numM, int numN, int margin, float *pts); 40 | 41 | #endif /* BB_H_ */ 42 | -------------------------------------------------------------------------------- /Tracking/TLD/BBPredict.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2011 AIT Austrian Institute of Technology 2 | * 3 | * This file is part of OpenTLD. 4 | * 5 | * OpenTLD is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenTLD is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with OpenTLD. If not, see . 17 | * 18 | */ 19 | 20 | /** 21 | * @file bb_predict.h 22 | * 23 | * Created on: 28.03.2011 24 | * @author: bernd 25 | * @brief 26 | */ 27 | 28 | #ifndef BBPREDICT_H_ 29 | #define BBPREDICT_H_ 30 | 31 | #include 32 | #include 33 | 34 | 35 | /** 36 | * @param bb0 The previous BoundingBox. 37 | * @param pt0 Feature points in the previous BoundingBox. 38 | * @param pt1 Feature points of the new BoundingBox. 39 | * @param nPts Length of pt0/pt1. 40 | * @param bb1 Output, contains predicted BoundingBox. 41 | * @param shift Output, contains relative scale change. 42 | * 1 == no scalechange, experience: if shift == 0 43 | * BoundingBox moved completely out of picture 44 | * (not validated) 45 | */ 46 | int predictbb(float *bb0, CvPoint2D32f *pt0, CvPoint2D32f *pt1, int nPts, 47 | float *bb1, float *shift); 48 | 49 | #endif /* BBPREDICT_H_ */ 50 | -------------------------------------------------------------------------------- /Tracking/TLD/Clustering.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2011 AIT Austrian Institute of Technology 2 | * 3 | * This file is part of OpenTLD. 4 | * 5 | * OpenTLD is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenTLD is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with OpenTLD. If not, see . 17 | * 18 | */ 19 | /* 20 | * Clustering.h 21 | * 22 | * Created on: Nov 16, 2011 23 | * Author: Georg Nebehay 24 | */ 25 | 26 | #ifndef CLUSTERING_H_ 27 | #define CLUSTERING_H_ 28 | 29 | #include 30 | 31 | #include 32 | 33 | #include "DetectionResult.h" 34 | 35 | namespace tld 36 | { 37 | 38 | class Clustering 39 | { 40 | void calcMeanRect(std::vector * indices); 41 | void calcDistances(float *distances); 42 | void cluster(float *distances, int *clusterIndices); 43 | public: 44 | int *windows; 45 | int numWindows; 46 | 47 | DetectionResult *detectionResult; 48 | 49 | //Configurable members 50 | float cutoff; 51 | 52 | 53 | 54 | Clustering(); 55 | virtual ~Clustering(); 56 | void release(); 57 | void clusterConfidentIndices(); 58 | }; 59 | 60 | } /* namespace tld */ 61 | #endif /* CLUSTERING_H_ */ 62 | -------------------------------------------------------------------------------- /Tracking/TLD/DetectionResult.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2011 AIT Austrian Institute of Technology 2 | * 3 | * This file is part of OpenTLD. 4 | * 5 | * OpenTLD is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenTLD is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with OpenTLD. If not, see . 17 | * 18 | */ 19 | 20 | /* 21 | * DetectionResult.cpp 22 | * 23 | * Created on: Nov 16, 2011 24 | * Author: Georg Nebehay 25 | */ 26 | 27 | #include "DetectionResult.h" 28 | 29 | #include "TLDUtil.h" 30 | 31 | using namespace cv; 32 | using namespace std; 33 | 34 | namespace tld 35 | { 36 | 37 | DetectionResult::DetectionResult() 38 | { 39 | containsValidData = false; 40 | fgList = new vector(); 41 | confidentIndices = new vector(); 42 | numClusters = 0; 43 | detectorBB = NULL; 44 | 45 | variances = NULL; 46 | posteriors = NULL; 47 | featureVectors = NULL; 48 | } 49 | 50 | DetectionResult::~DetectionResult() 51 | { 52 | release(); 53 | delete fgList; 54 | fgList = NULL; 55 | } 56 | 57 | void DetectionResult::init(int numWindows, int numTrees) 58 | { 59 | variances = new float[numWindows]; 60 | posteriors = new float[numWindows]; 61 | featureVectors = new int[numWindows * numTrees]; 62 | delete confidentIndices; 63 | confidentIndices = new vector(); 64 | 65 | } 66 | 67 | void DetectionResult::reset() 68 | { 69 | containsValidData = false; 70 | 71 | if(fgList != NULL) fgList->clear(); 72 | 73 | if(confidentIndices != NULL) confidentIndices->clear(); 74 | 75 | numClusters = 0; 76 | delete detectorBB; 77 | detectorBB = NULL; 78 | } 79 | 80 | void DetectionResult::release() 81 | { 82 | fgList->clear(); 83 | delete[] variances; 84 | variances = NULL; 85 | delete[] posteriors; 86 | posteriors = NULL; 87 | delete[] featureVectors; 88 | featureVectors = NULL; 89 | delete confidentIndices; 90 | confidentIndices = NULL; 91 | delete detectorBB; 92 | detectorBB = NULL; 93 | containsValidData = false; 94 | } 95 | 96 | } /* namespace tld */ 97 | -------------------------------------------------------------------------------- /Tracking/TLD/DetectionResult.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2011 AIT Austrian Institute of Technology 2 | * 3 | * This file is part of OpenTLD. 4 | * 5 | * OpenTLD is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenTLD is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with OpenTLD. If not, see . 17 | * 18 | */ 19 | 20 | /* 21 | * DetectionResult.h 22 | * 23 | * Created on: Nov 16, 2011 24 | * Author: Georg Nebehay 25 | */ 26 | 27 | #ifndef DETECTIONRESULT_H_ 28 | #define DETECTIONRESULT_H_ 29 | 30 | #include 31 | 32 | #include 33 | 34 | namespace tld 35 | { 36 | 37 | class DetectionResult 38 | { 39 | public: 40 | bool containsValidData; 41 | std::vector* fgList; 42 | float *posteriors; /* Contains the posteriors for each slding window. Is of size numWindows. Allocated by tldInitClassifier. */ 43 | std::vector* confidentIndices; 44 | int *featureVectors; 45 | float *variances; 46 | int numClusters; 47 | cv::Rect *detectorBB; //Contains a valid result only if numClusters = 1 48 | 49 | DetectionResult(); 50 | virtual ~DetectionResult(); 51 | 52 | void init(int numWindows, int numTrees); 53 | 54 | void reset(); 55 | void release(); 56 | 57 | }; 58 | 59 | } /* namespace tld */ 60 | #endif /* DETECTIONRESULT_H_ */ 61 | -------------------------------------------------------------------------------- /Tracking/TLD/DetectorCascade.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2011 AIT Austrian Institute of Technology 2 | * 3 | * This file is part of OpenTLD. 4 | * 5 | * OpenTLD is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenTLD is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with OpenTLD. If not, see . 17 | * 18 | */ 19 | /* 20 | * DetectorCascade.h 21 | * 22 | * Created on: Nov 16, 2011 23 | * Author: Georg Nebehay 24 | */ 25 | 26 | #ifndef DETECTORCASCADE_H_ 27 | #define DETECTORCASCADE_H_ 28 | 29 | #include "DetectionResult.h" 30 | #include "ForegroundDetector.h" 31 | #include "VarianceFilter.h" 32 | #include "EnsembleClassifier.h" 33 | #include "Clustering.h" 34 | #include "NNClassifier.h" 35 | 36 | 37 | namespace tld 38 | { 39 | 40 | //Constants 41 | static const int TLD_WINDOW_SIZE = 5; 42 | static const int TLD_WINDOW_OFFSET_SIZE = 6; 43 | 44 | class DetectorCascade 45 | { 46 | //Working data 47 | int numScales; 48 | cv::Size *scales; 49 | public: 50 | //Configurable members 51 | int minScale; 52 | int maxScale; 53 | bool useShift; 54 | float shift; 55 | int minSize; 56 | int numFeatures; 57 | int numTrees; 58 | 59 | //Needed for init 60 | int imgWidth; 61 | int imgHeight; 62 | int imgWidthStep; 63 | int objWidth; 64 | int objHeight; 65 | 66 | int numWindows; 67 | int *windows; 68 | int *windowOffsets; 69 | 70 | //State data 71 | bool initialised; 72 | 73 | //Components of Detector Cascade 74 | ForegroundDetector *foregroundDetector; 75 | VarianceFilter *varianceFilter; 76 | EnsembleClassifier *ensembleClassifier; 77 | Clustering *clustering; 78 | NNClassifier *nnClassifier; 79 | 80 | DetectionResult *detectionResult; 81 | 82 | void propagateMembers(); 83 | 84 | DetectorCascade(); 85 | ~DetectorCascade(); 86 | 87 | void init(); 88 | 89 | void initWindowOffsets(); 90 | void initWindowsAndScales(); 91 | 92 | void release(); 93 | void cleanPreviousData(); 94 | void detect(const cv::Mat &img); 95 | }; 96 | 97 | } /* namespace tld */ 98 | #endif /* DETECTORCASCADE_H_ */ 99 | -------------------------------------------------------------------------------- /Tracking/TLD/EnsembleClassifier.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2011 AIT Austrian Institute of Technology 2 | * 3 | * This file is part of OpenTLD. 4 | * 5 | * OpenTLD is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenTLD is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with OpenTLD. If not, see . 17 | * 18 | */ 19 | /* 20 | * EnsembleClassifier.h 21 | * 22 | * Created on: Nov 16, 2011 23 | * Author: Georg Nebehay 24 | */ 25 | 26 | #ifndef ENSEMBLECLASSIFIER_H_ 27 | #define ENSEMBLECLASSIFIER_H_ 28 | 29 | #include 30 | 31 | namespace tld 32 | { 33 | 34 | class EnsembleClassifier 35 | { 36 | const unsigned char *img; 37 | 38 | float calcConfidence(int *featureVector); 39 | int calcFernFeature(int windowIdx, int treeIdx); 40 | void calcFeatureVector(int windowIdx, int *featureVector); 41 | void updatePosteriors(int *featureVector, int positive, int amount); 42 | public: 43 | bool enabled; 44 | 45 | //Configurable members 46 | int numTrees; 47 | int numFeatures; 48 | 49 | int imgWidthStep; 50 | int numScales; 51 | cv::Size *scales; 52 | 53 | int *windowOffsets; 54 | int *featureOffsets; 55 | float *features; 56 | 57 | int numIndices; 58 | 59 | float *posteriors; 60 | int *positives; 61 | int *negatives; 62 | 63 | DetectionResult *detectionResult; 64 | 65 | EnsembleClassifier(); 66 | virtual ~EnsembleClassifier(); 67 | void init(); 68 | void initFeatureLocations(); 69 | void initFeatureOffsets(); 70 | void initPosteriors(); 71 | void release(); 72 | void nextIteration(const cv::Mat &img); 73 | void classifyWindow(int windowIdx); 74 | void updatePosterior(int treeIdx, int idx, int positive, int amount); 75 | void learn(int *boundary, int positive, int *featureVector); 76 | bool filter(int i); 77 | }; 78 | 79 | } /* namespace tld */ 80 | #endif /* ENSEMBLECLASSIFIER_H_ */ 81 | -------------------------------------------------------------------------------- /Tracking/TLD/FBTrack.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2011 AIT Austrian Institute of Technology 2 | * 3 | * This file is part of OpenTLD. 4 | * 5 | * OpenTLD is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenTLD is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with OpenTLD. If not, see . 17 | * 18 | */ 19 | 20 | /* 21 | * fbtrack.h 22 | * 23 | * Created on: 29.04.2011 24 | * Author: Georg Nebehay 25 | */ 26 | 27 | #ifndef FBTRACK_H_ 28 | #define FBTRACK_H_ 29 | 30 | #include 31 | #include 32 | 33 | /* 34 | * @param imgI Image contain Object with known BoundingBox 35 | * @param imgJ Following Image. 36 | * @param bb Bounding box of object to track in imgI. 37 | * Format x1,y1,x2,y2 38 | * @param scaleshift returns relative scale change of bb 39 | */ 40 | int fbtrack(IplImage *imgI, IplImage *imgJ, float *bb, float *bbnew, float *scaleshift); 41 | 42 | #endif /* FBTRACK_H_ */ 43 | -------------------------------------------------------------------------------- /Tracking/TLD/ForegroundDetector.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2011 AIT Austrian Institute of Technology 2 | * 3 | * This file is part of OpenTLD. 4 | * 5 | * OpenTLD is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenTLD is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with OpenTLD. If not, see . 17 | * 18 | */ 19 | /* 20 | * ForegroundDetector.cpp 21 | * 22 | * Created on: Nov 16, 2011 23 | * Author: Georg Nebehay 24 | */ 25 | 26 | #include "ForegroundDetector.h" 27 | 28 | #include "BlobResult.h" 29 | 30 | using namespace cv; 31 | 32 | namespace tld 33 | { 34 | 35 | ForegroundDetector::ForegroundDetector() 36 | { 37 | fgThreshold = 16; 38 | minBlobSize = 0; 39 | } 40 | 41 | ForegroundDetector::~ForegroundDetector() 42 | { 43 | } 44 | 45 | void ForegroundDetector::release() 46 | { 47 | } 48 | 49 | void ForegroundDetector::nextIteration(const Mat &img) 50 | { 51 | if(bgImg.empty()) 52 | { 53 | return; 54 | } 55 | 56 | Mat absImg = Mat(img.cols, img.rows, img.type()); 57 | Mat threshImg = Mat(img.cols, img.rows, img.type()); 58 | 59 | absdiff(bgImg, img, absImg); 60 | threshold(absImg, threshImg, fgThreshold, 255, CV_THRESH_BINARY); 61 | 62 | IplImage im = (IplImage)threshImg; 63 | CBlobResult blobs = CBlobResult(&im, NULL, 0); 64 | 65 | blobs.Filter(blobs, B_EXCLUDE, CBlobGetArea(), B_LESS, minBlobSize); 66 | 67 | std::vector* fgList = detectionResult->fgList; 68 | fgList->clear(); 69 | 70 | for(int i = 0; i < blobs.GetNumBlobs(); i++) 71 | { 72 | CBlob *blob = blobs.GetBlob(i); 73 | CvRect rect = blob->GetBoundingBox(); 74 | fgList->push_back(rect); 75 | } 76 | 77 | } 78 | 79 | bool ForegroundDetector::isActive() 80 | { 81 | return !bgImg.empty(); 82 | } 83 | 84 | } /* namespace tld */ 85 | -------------------------------------------------------------------------------- /Tracking/TLD/ForegroundDetector.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2011 AIT Austrian Institute of Technology 2 | * 3 | * This file is part of OpenTLD. 4 | * 5 | * OpenTLD is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenTLD is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with OpenTLD. If not, see . 17 | * 18 | */ 19 | 20 | /* 21 | * ForegroundDetector.h 22 | * 23 | * Created on: Nov 16, 2011 24 | * Author: Georg Nebehay 25 | */ 26 | 27 | #ifndef FOREGROUNDDETECTOR_H_ 28 | #define FOREGROUNDDETECTOR_H_ 29 | 30 | #include 31 | 32 | #include 33 | 34 | #include "DetectionResult.h" 35 | 36 | namespace tld 37 | { 38 | 39 | class ForegroundDetector 40 | { 41 | public: 42 | int fgThreshold; 43 | int minBlobSize; 44 | cv::Mat bgImg; 45 | DetectionResult *detectionResult; 46 | 47 | ForegroundDetector(); 48 | virtual ~ForegroundDetector(); 49 | void release(); 50 | void nextIteration(const cv::Mat &img); 51 | bool isActive(); 52 | }; 53 | 54 | } /* namespace tld */ 55 | #endif /* FOREGROUNDDETECTOR_H_ */ 56 | -------------------------------------------------------------------------------- /Tracking/TLD/IntegralImage.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2011 AIT Austrian Institute of Technology 2 | * 3 | * This file is part of OpenTLD. 4 | * 5 | * OpenTLD is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenTLD is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with OpenTLD. If not, see . 17 | * 18 | */ 19 | 20 | /* 21 | * IntegralImage.h 22 | * 23 | * Created on: Nov 16, 2011 24 | * Author: Georg Nebehay 25 | */ 26 | 27 | #ifndef INTEGRALIMAGE_H_ 28 | #define INTEGRALIMAGE_H_ 29 | 30 | #include 31 | 32 | namespace tld 33 | { 34 | 35 | template 36 | class IntegralImage 37 | { 38 | public: 39 | T *data; /* Array containg the entries for the integral image in row-first manner. Of size width*height. Allocated by tldAllocIntImg */ 40 | /* width, height: Dimensions of integral image.*/ 41 | int width; 42 | int height; 43 | 44 | IntegralImage(cv::Size size) 45 | { 46 | data = new T[size.width * size.height]; 47 | } 48 | 49 | virtual ~IntegralImage() 50 | { 51 | delete[] data; 52 | } 53 | 54 | void calcIntImg(const cv::Mat &img, bool squared = false) 55 | { 56 | const unsigned char *input = (const unsigned char *)(img.data); 57 | T *output = data; 58 | 59 | for(int i = 0; i < img.cols; i++) 60 | { 61 | for(int j = 0; j < img.rows; j++) 62 | { 63 | T A = (i > 0) ? output[img.cols * j + i - 1] : 0; 64 | T B = (j > 0) ? output[img.cols * (j - 1) + i] : 0; 65 | T C = (j > 0 && i > 0) ? output[img.cols * (j - 1) + i - 1] : 0; 66 | T value = input[img.step * j + i]; 67 | 68 | if(squared) 69 | { 70 | value = value * value; 71 | } 72 | 73 | output[img.cols * j + i] = A + B - C + value; 74 | } 75 | } 76 | 77 | } 78 | }; 79 | 80 | 81 | } /* namespace tld */ 82 | #endif /* INTEGRALIMAGE_H_ */ 83 | -------------------------------------------------------------------------------- /Tracking/TLD/Lk.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2011 AIT Austrian Institute of Technology 2 | * 3 | * This file is part of OpenTLD. 4 | * 5 | * OpenTLD is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenTLD is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with OpenTLD. If not, see . 17 | * 18 | */ 19 | 20 | /** 21 | * @file lk.h 22 | * 23 | * Created on: 02.03.2011 24 | * @author bernd 25 | */ 26 | 27 | #ifndef LK_H_ 28 | #define LK_H_ 29 | 30 | #include 31 | #include 32 | 33 | /** 34 | * Need before start of trackLK and at the end of the program for cleanup. 35 | */ 36 | void initImgs(); 37 | int trackLK(IplImage *imgI, IplImage *imgJ, float ptsI[], int nPtsI, 38 | float ptsJ[], int nPtsJ, int level, float *fbOut, float *nccOut, 39 | char *statusOut); 40 | 41 | #endif /* LK_H_ */ 42 | -------------------------------------------------------------------------------- /Tracking/TLD/Median.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2011 AIT Austrian Institute of Technology 2 | * 3 | * This file is part of OpenTLD. 4 | * 5 | * OpenTLD is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenTLD is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with OpenTLD. If not, see . 17 | * 18 | */ 19 | 20 | /** 21 | * @file median.h 22 | * 23 | * Created on: 22.03.2011 24 | * @author: bernd 25 | * @brief 26 | */ 27 | 28 | #ifndef MEDIAN_H_ 29 | #define MEDIAN_H_ 30 | 31 | /** 32 | * Returns median of the array. Changes array! 33 | * @param arr the array 34 | * @pram n length of array 35 | */ 36 | float getMedian(float arr[], int n); 37 | 38 | /** 39 | * Calculates Median of the array. Don't change array(makes copy). 40 | * @param arr the array 41 | * @pram n length of array 42 | */ 43 | float getMedianUnmanaged(float arr[], int n); 44 | 45 | #endif /* MEDIAN_H_ */ 46 | -------------------------------------------------------------------------------- /Tracking/TLD/MedianFlowTracker.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2011 AIT Austrian Institute of Technology 2 | * 3 | * This file is part of OpenTLD. 4 | * 5 | * OpenTLD is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenTLD is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with OpenTLD. If not, see . 17 | * 18 | */ 19 | 20 | /* 21 | * MedianFlowTracker.cpp 22 | * 23 | * Created on: Nov 17, 2011 24 | * Author: Georg Nebehay 25 | */ 26 | 27 | #include "MedianFlowTracker.h" 28 | 29 | #include 30 | 31 | #include "FBTrack.h" 32 | 33 | using namespace cv; 34 | 35 | namespace tld 36 | { 37 | 38 | MedianFlowTracker::MedianFlowTracker() 39 | { 40 | trackerBB = NULL; 41 | } 42 | 43 | MedianFlowTracker::~MedianFlowTracker() 44 | { 45 | cleanPreviousData(); 46 | } 47 | 48 | void MedianFlowTracker::cleanPreviousData() 49 | { 50 | delete trackerBB; 51 | trackerBB = NULL; 52 | } 53 | 54 | void MedianFlowTracker::track(const Mat &prevMat, const Mat &currMat, Rect *prevBB) 55 | { 56 | if(prevBB != NULL) 57 | { 58 | if(prevBB->width <= 0 || prevBB->height <= 0) 59 | { 60 | return; 61 | } 62 | 63 | float bb_tracker[] = {static_cast(prevBB->x), static_cast(prevBB->y), static_cast(prevBB->width + prevBB->x - 1), static_cast(prevBB->height + prevBB->y - 1)}; 64 | float scale; 65 | 66 | IplImage prevImg = prevMat; 67 | IplImage currImg = currMat; 68 | 69 | int success = fbtrack(&prevImg, &currImg, bb_tracker, bb_tracker, &scale); 70 | 71 | //Extract subimage 72 | float x, y, w, h; 73 | x = floor(bb_tracker[0] + 0.5); 74 | y = floor(bb_tracker[1] + 0.5); 75 | w = floor(bb_tracker[2] - bb_tracker[0] + 1 + 0.5); 76 | h = floor(bb_tracker[3] - bb_tracker[1] + 1 + 0.5); 77 | 78 | //TODO: Introduce a check for a minimum size 79 | if(!success || x < 0 || y < 0 || w <= 0 || h <= 0 || x + w > currMat.cols || y + h > currMat.rows || x != x || y != y || w != w || h != h) //x!=x is check for nan 80 | { 81 | //Leave it empty 82 | } 83 | else 84 | { 85 | trackerBB = new Rect(x, y, w, h); 86 | } 87 | } 88 | } 89 | 90 | } /* namespace tld */ 91 | 92 | 93 | -------------------------------------------------------------------------------- /Tracking/TLD/MedianFlowTracker.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2011 AIT Austrian Institute of Technology 2 | * 3 | * This file is part of OpenTLD. 4 | * 5 | * OpenTLD is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenTLD is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with OpenTLD. If not, see . 17 | * 18 | */ 19 | 20 | /* 21 | * MedianFlowTracker.h 22 | * 23 | * Created on: Nov 17, 2011 24 | * Author: Georg Nebehay 25 | */ 26 | 27 | #ifndef MEDIANFLOWTRACKER_H_ 28 | #define MEDIANFLOWTRACKER_H_ 29 | 30 | #include 31 | 32 | 33 | namespace tld 34 | { 35 | 36 | class MedianFlowTracker 37 | { 38 | public: 39 | cv::Rect *trackerBB; 40 | 41 | MedianFlowTracker(); 42 | virtual ~MedianFlowTracker(); 43 | void cleanPreviousData(); 44 | void track(const cv::Mat &prevImg, const cv::Mat &currImg, cv::Rect *prevBB); 45 | }; 46 | 47 | } /* namespace tld */ 48 | #endif /* MEDIANFLOWTRACKER_H_ */ 49 | -------------------------------------------------------------------------------- /Tracking/TLD/NNClassifier.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2011 AIT Austrian Institute of Technology 2 | * 3 | * This file is part of OpenTLD. 4 | * 5 | * OpenTLD is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenTLD is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with OpenTLD. If not, see . 17 | * 18 | */ 19 | /* 20 | * NNClassifier.h 21 | * 22 | * Created on: Nov 16, 2011 23 | * Author: Georg Nebehay 24 | */ 25 | 26 | #ifndef NNCLASSIFIER_H_ 27 | #define NNCLASSIFIER_H_ 28 | 29 | #include 30 | 31 | #include 32 | 33 | #include "NormalizedPatch.h" 34 | #include "DetectionResult.h" 35 | 36 | namespace tld 37 | { 38 | 39 | class NNClassifier 40 | { 41 | float ncc(float *f1, float *f2); 42 | public: 43 | bool enabled; 44 | 45 | int *windows; 46 | float thetaFP; 47 | float thetaTP; 48 | DetectionResult *detectionResult; 49 | std::vector* falsePositives; 50 | std::vector* truePositives; 51 | 52 | NNClassifier(); 53 | virtual ~NNClassifier(); 54 | 55 | void release(); 56 | float classifyPatch(NormalizedPatch *patch); 57 | float classifyBB(const cv::Mat &img, cv::Rect *bb); 58 | float classifyWindow(const cv::Mat &img, int windowIdx); 59 | void learn(std::vector patches); 60 | bool filter(const cv::Mat &img, int windowIdx); 61 | }; 62 | 63 | } /* namespace tld */ 64 | #endif /* NNCLASSIFIER_H_ */ 65 | -------------------------------------------------------------------------------- /Tracking/TLD/NormalizedPatch.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2011 AIT Austrian Institute of Technology 2 | * 3 | * This file is part of OpenTLD. 4 | * 5 | * OpenTLD is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenTLD is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with OpenTLD. If not, see . 17 | * 18 | */ 19 | /* 20 | * NormalizedPatch.h 21 | * 22 | * Created on: Nov 16, 2011 23 | * Author: Georg Nebehay 24 | */ 25 | 26 | #ifndef NORMALIZEDPATCH_H_ 27 | #define NORMALIZEDPATCH_H_ 28 | 29 | #define TLD_PATCH_SIZE 15 30 | 31 | namespace tld 32 | { 33 | 34 | class NormalizedPatch 35 | { 36 | public: 37 | float values[TLD_PATCH_SIZE *TLD_PATCH_SIZE]; 38 | bool positive; 39 | }; 40 | 41 | } /* namespace tld */ 42 | #endif /* NORMALIZEDPATCH_H_ */ 43 | -------------------------------------------------------------------------------- /Tracking/TLD/TLD.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2011 AIT Austrian Institute of Technology 2 | * 3 | * This file is part of OpenTLD. 4 | * 5 | * OpenTLD is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenTLD is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with OpenTLD. If not, see . 17 | * 18 | */ 19 | 20 | /* 21 | * TLD.h 22 | * 23 | * Created on: Nov 17, 2011 24 | * Author: Georg Nebehay 25 | */ 26 | 27 | #ifndef TLD_H_ 28 | #define TLD_H_ 29 | 30 | #include 31 | 32 | #include "MedianFlowTracker.h" 33 | #include "DetectorCascade.h" 34 | 35 | namespace tld 36 | { 37 | 38 | class TLD 39 | { 40 | void storeCurrentData(); 41 | void fuseHypotheses(); 42 | void learn(); 43 | void initialLearning(); 44 | public: 45 | bool trackerEnabled; 46 | bool detectorEnabled; 47 | bool learningEnabled; 48 | bool alternating; 49 | 50 | MedianFlowTracker *medianFlowTracker; 51 | DetectorCascade *detectorCascade; 52 | NNClassifier *nnClassifier; 53 | bool valid; 54 | bool wasValid; 55 | cv::Mat prevImg; 56 | cv::Mat currImg; 57 | cv::Rect *prevBB; 58 | cv::Rect *currBB; 59 | float currConf; 60 | bool learning; 61 | 62 | TLD(); 63 | virtual ~TLD(); 64 | void release(); 65 | void selectObject(const cv::Mat &img, cv::Rect *bb); 66 | void processImage(const cv::Mat &img); 67 | void writeToFile(const char *path); 68 | void readFromFile(const char *path); 69 | }; 70 | 71 | } /* namespace tld */ 72 | #endif /* TLD_H_ */ 73 | -------------------------------------------------------------------------------- /Tracking/TLD/VarianceFilter.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2011 AIT Austrian Institute of Technology 2 | * 3 | * This file is part of OpenTLD. 4 | * 5 | * OpenTLD is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenTLD is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with OpenTLD. If not, see . 17 | * 18 | */ 19 | 20 | /* 21 | * VarianceFilter.cpp 22 | * 23 | * Created on: Nov 16, 2011 24 | * Author: Georg Nebehay 25 | */ 26 | 27 | #include "VarianceFilter.h" 28 | 29 | #include "IntegralImage.h" 30 | #include "DetectorCascade.h" 31 | 32 | using namespace cv; 33 | 34 | namespace tld 35 | { 36 | 37 | VarianceFilter::VarianceFilter() 38 | { 39 | enabled = true; 40 | minVar = 0; 41 | integralImg = NULL; 42 | integralImg_squared = NULL; 43 | } 44 | 45 | VarianceFilter::~VarianceFilter() 46 | { 47 | release(); 48 | } 49 | 50 | void VarianceFilter::release() 51 | { 52 | if(integralImg != NULL) delete integralImg; 53 | 54 | integralImg = NULL; 55 | 56 | if(integralImg_squared != NULL) delete integralImg_squared; 57 | 58 | integralImg_squared = NULL; 59 | } 60 | 61 | float VarianceFilter::calcVariance(int *off) 62 | { 63 | 64 | int *ii1 = integralImg->data; 65 | long long *ii2 = integralImg_squared->data; 66 | 67 | float mX = (ii1[off[3]] - ii1[off[2]] - ii1[off[1]] + ii1[off[0]]) / (float) off[5]; //Sum of Area divided by area 68 | float mX2 = (ii2[off[3]] - ii2[off[2]] - ii2[off[1]] + ii2[off[0]]) / (float) off[5]; 69 | return mX2 - mX * mX; 70 | } 71 | 72 | void VarianceFilter::nextIteration(const Mat &img) 73 | { 74 | if(!enabled) return; 75 | 76 | release(); 77 | 78 | integralImg = new IntegralImage(img.size()); 79 | integralImg->calcIntImg(img); 80 | 81 | integralImg_squared = new IntegralImage(img.size()); 82 | integralImg_squared->calcIntImg(img, true); 83 | } 84 | 85 | bool VarianceFilter::filter(int i) 86 | { 87 | if(!enabled) return true; 88 | 89 | float bboxvar = calcVariance(windowOffsets + TLD_WINDOW_OFFSET_SIZE * i); 90 | 91 | detectionResult->variances[i] = bboxvar; 92 | 93 | if(bboxvar < minVar) 94 | { 95 | return false; 96 | } 97 | 98 | return true; 99 | } 100 | 101 | } /* namespace tld */ 102 | -------------------------------------------------------------------------------- /Tracking/TLD/VarianceFilter.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2011 AIT Austrian Institute of Technology 2 | * 3 | * This file is part of OpenTLD. 4 | * 5 | * OpenTLD is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * OpenTLD is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with OpenTLD. If not, see . 17 | * 18 | */ 19 | /* 20 | * VarianceFilter.h 21 | * 22 | * Created on: Nov 16, 2011 23 | * Author: Georg Nebehay 24 | */ 25 | 26 | #ifndef VARIANCEFILTER_H_ 27 | #define VARIANCEFILTER_H_ 28 | 29 | #include 30 | 31 | #include "IntegralImage.h" 32 | #include "DetectionResult.h" 33 | 34 | namespace tld 35 | { 36 | 37 | class VarianceFilter 38 | { 39 | IntegralImage* integralImg; 40 | IntegralImage* integralImg_squared; 41 | 42 | public: 43 | bool enabled; 44 | int *windowOffsets; 45 | 46 | DetectionResult *detectionResult; 47 | 48 | float minVar; 49 | 50 | VarianceFilter(); 51 | virtual ~VarianceFilter(); 52 | 53 | void release(); 54 | void nextIteration(const cv::Mat &img); 55 | bool filter(int idx); 56 | float calcVariance(int *off); 57 | }; 58 | 59 | } /* namespace tld */ 60 | #endif /* VARIANCEFILTER_H_ */ 61 | -------------------------------------------------------------------------------- /Tracking/TLD/config-sample.cfg: -------------------------------------------------------------------------------- 1 | #Commented entries (lines with # at the beginneng) denote default values unless otherwise stated, 2 | #delete the # to change the parameters. 3 | 4 | acq: { 5 | method = "CAM"; #one of CAM, IMGS, VID, LIVESIM required, no default 6 | #imgPath = "/path/to/input/%.5d.png"; #required for IMGS, LIVESIM and VID, no default 7 | #startFrame = 1; 8 | #lastFrame = 0; # 0 Means take all frames 9 | #fps=24.0; 10 | }; 11 | 12 | detector: { 13 | #useProportionalShift = true; #Sets scanwindows off by a percentage value of the window dimensions (specified in proportionalShift) rather than 1px. 14 | #proportionalShift = 0.1; 15 | #minScale = -10; #number of scales smaller than initial object size 16 | #maxScale = 10; #number of scales larger than initial object size 17 | #numFeatures = 10; #number of features 18 | #numTrees = 10; #number of trees 19 | #minSize = 25; #minimum size of scanWindows 20 | #thetaP = 0.65; 21 | #thetaN = 0.5; 22 | #varianceFilterEnabled = true; 23 | #ensembleClassifierEnabled = true; 24 | #nnClassifierEnabled = true; 25 | }; 26 | 27 | #trackerEnabled = true; 28 | #loadModel = false; #If true, model specified by "modelPath" is loaded at startup 29 | #modelPath = "/home/georg/Dropbox/AIT/tld/code/tld/src/m/model"; # no default, if modelPath is not set then either an initialBoundingBox must be specified or selectManually must be true. 30 | /*initialBoundingBox = [100, 100, 100, 100];*/ # No default, initial Bounding Box can be specified here 31 | #selectManually = false; #If true, user can select initial bounding box (which then overrides the setting "initialBoundingBox") 32 | 33 | #threshold = 0.5; #Threshold for determining positive results 34 | #learningEnabled = true; #Enables learning while processing 35 | #trajectory = 20; #Specifies the number of the last frames which are considered by the trajectory; 0 disables the trajectory 36 | #showOutput = true; #Creates a window displaying results 37 | #showNotConfident=true; #Show bounding box also if confidence is low 38 | #showColorImage = false; #Shows color images instead of greyscale 39 | #showForeground = false; #Shows foreground 40 | #saveOutput = false; #Specifies whether to save visual output 41 | #saveDir = "path/to/output/"; #required if saveOutput = true, no default 42 | #printResults = "/home/georg/Desktop/resultsFile"; #If commented, results will not be printed 43 | #printTiming = "path/to/timingFile"; #If commented, timing will not be printed 44 | #alternating = false; #If set to true, detector is disabled while tracker is running. 45 | #exportModelAfterRun = false; #If set to true, model is exported after run. 46 | #modelExportFile="model"; #File model is exported to 47 | #seed=0; 48 | 49 | -------------------------------------------------------------------------------- /Tracking/TLD/cvBlob/BlobContour.h: -------------------------------------------------------------------------------- 1 | #ifndef BLOBCONTOUR_H_INCLUDED 2 | #define BLOBCONTOUR_H_INCLUDED 3 | 4 | 5 | #include "list" 6 | #include 7 | #include 8 | 9 | //! Type of chain codes 10 | typedef unsigned char t_chainCode; 11 | //! Type of list of chain codes 12 | typedef CvSeq* t_chainCodeList; 13 | //! Type of list of points 14 | typedef CvSeq* t_PointList; 15 | 16 | 17 | //! Max order of calculated moments 18 | #define MAX_MOMENTS_ORDER 3 19 | 20 | 21 | //! Blob contour class (in crack code) 22 | class CBlobContour 23 | { 24 | friend class CBlob; 25 | 26 | public: 27 | //! Constructors 28 | CBlobContour(); 29 | CBlobContour(CvPoint startPoint, CvMemStorage *storage ); 30 | //! Copy constructor 31 | CBlobContour( CBlobContour *source ); 32 | 33 | ~CBlobContour(); 34 | //! Assigment operator 35 | CBlobContour& operator=( const CBlobContour &source ); 36 | 37 | //! Add chain code to contour 38 | void AddChainCode(t_chainCode code); 39 | 40 | //! Return freeman chain coded contour 41 | t_chainCodeList GetChainCode() 42 | { 43 | return m_contour; 44 | } 45 | 46 | bool IsEmpty() 47 | { 48 | return m_contour == NULL || m_contour->total == 0; 49 | } 50 | 51 | //! Return all contour points 52 | t_chainCodeList GetContourPoints(); 53 | 54 | protected: 55 | 56 | CvPoint GetStartPoint() const 57 | { 58 | return m_startPoint; 59 | } 60 | 61 | //! Clears chain code contour 62 | void ResetChainCode(); 63 | 64 | 65 | 66 | //! Computes area from contour 67 | double GetArea(); 68 | //! Computes perimeter from contour 69 | double GetPerimeter(); 70 | //! Get contour moment (p,q up to MAX_CALCULATED_MOMENTS) 71 | double GetMoment(int p, int q); 72 | 73 | //! Crack code list 74 | t_chainCodeList m_contour; 75 | 76 | private: 77 | //! Starting point of the contour 78 | CvPoint m_startPoint; 79 | //! All points from the contour 80 | t_PointList m_contourPoints; 81 | 82 | 83 | 84 | //! Computed area from contour 85 | double m_area; 86 | //! Computed perimeter from contour 87 | double m_perimeter; 88 | //! Computed moments from contour 89 | CvMoments m_moments; 90 | 91 | //! Pointer to storage 92 | CvMemStorage *m_parentStorage; 93 | }; 94 | 95 | #endif //!BLOBCONTOUR_H_INCLUDED 96 | 97 | 98 | -------------------------------------------------------------------------------- /Tracking/TLD/cvBlob/BlobContour.mm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/floodsung/Tracking-on-iOS/e87e420a8a24ee5ea47b1af930742e9c97dacc7b/Tracking/TLD/cvBlob/BlobContour.mm -------------------------------------------------------------------------------- /Tracking/TLD/cvBlob/BlobLibraryConfiguration.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/floodsung/Tracking-on-iOS/e87e420a8a24ee5ea47b1af930742e9c97dacc7b/Tracking/TLD/cvBlob/BlobLibraryConfiguration.h -------------------------------------------------------------------------------- /Tracking/TLD/cvBlob/BlobOperators.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/floodsung/Tracking-on-iOS/e87e420a8a24ee5ea47b1af930742e9c97dacc7b/Tracking/TLD/cvBlob/BlobOperators.h -------------------------------------------------------------------------------- /Tracking/TLD/cvBlob/BlobOperators.mm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/floodsung/Tracking-on-iOS/e87e420a8a24ee5ea47b1af930742e9c97dacc7b/Tracking/TLD/cvBlob/BlobOperators.mm -------------------------------------------------------------------------------- /Tracking/TLD/cvBlob/BlobProperties.h: -------------------------------------------------------------------------------- 1 | #ifndef BLOB_PROPERTIES_H_INCLUDED 2 | #define BLOB_PROPERTIES_H_INCLUDED 3 | 4 | //! Max order of calculated moments 5 | #define MAX_MOMENTS_ORDER 3 6 | 7 | class CBlobProperties 8 | { 9 | public: 10 | CBlobProperties(); 11 | virtual ~CBlobProperties(); 12 | 13 | //! Get blob area 14 | double GetArea(); 15 | 16 | //! Get blob perimeter 17 | double GetPerimeter(); 18 | 19 | //! Get contour moment (p,q up to MAX_CALCULATED_MOMENTS) 20 | double GetMoment(int p, int q); 21 | 22 | private: 23 | 24 | //! Computed area from blob 25 | double m_area; 26 | //! Computed perimeter from blob 27 | double m_perimeter; 28 | // Computed moment from the blob 29 | double m_moment[MAX_MOMENTS_ORDER*MAX_MOMENTS_ORDER]; 30 | 31 | }; 32 | 33 | #endif //!BLOB_PROPERTIES_H_INCLUDED -------------------------------------------------------------------------------- /Tracking/TLD/cvBlob/BlobProperties.mm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/floodsung/Tracking-on-iOS/e87e420a8a24ee5ea47b1af930742e9c97dacc7b/Tracking/TLD/cvBlob/BlobProperties.mm -------------------------------------------------------------------------------- /Tracking/TLD/cvBlob/BlobResult.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/floodsung/Tracking-on-iOS/e87e420a8a24ee5ea47b1af930742e9c97dacc7b/Tracking/TLD/cvBlob/BlobResult.h -------------------------------------------------------------------------------- /Tracking/TLD/cvBlob/BlobResult.mm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/floodsung/Tracking-on-iOS/e87e420a8a24ee5ea47b1af930742e9c97dacc7b/Tracking/TLD/cvBlob/BlobResult.mm -------------------------------------------------------------------------------- /Tracking/TLD/cvBlob/ComponentLabeling.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/floodsung/Tracking-on-iOS/e87e420a8a24ee5ea47b1af930742e9c97dacc7b/Tracking/TLD/cvBlob/ComponentLabeling.h -------------------------------------------------------------------------------- /Tracking/TLD/cvBlob/ComponentLabeling.mm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/floodsung/Tracking-on-iOS/e87e420a8a24ee5ea47b1af930742e9c97dacc7b/Tracking/TLD/cvBlob/ComponentLabeling.mm -------------------------------------------------------------------------------- /Tracking/TLD/cvBlob/README: -------------------------------------------------------------------------------- 1 | README 2 | ============================================== 3 | cvBlobsLib/iOS is a port of OpenCV extension library cvBlobsLib on the iOS 4 | -------------------------------------------------------------------------------- /Tracking/TLD/cvBlob/blob.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/floodsung/Tracking-on-iOS/e87e420a8a24ee5ea47b1af930742e9c97dacc7b/Tracking/TLD/cvBlob/blob.h -------------------------------------------------------------------------------- /Tracking/TLD/cvBlob/blob.mm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/floodsung/Tracking-on-iOS/e87e420a8a24ee5ea47b1af930742e9c97dacc7b/Tracking/TLD/cvBlob/blob.mm -------------------------------------------------------------------------------- /Tracking/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // Tracking 4 | // 5 | // Created by FloodSurge on 8/3/15. 6 | // Copyright (c) 2015 FloodSurge. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /Tracking/ct/CompressiveTracker.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | * File: CompressiveTracker.h 3 | * Brief: C++ demo for paper: Kaihua Zhang, Lei Zhang, Ming-Hsuan Yang,"Real-Time Compressive Tracking," ECCV 2012. 4 | * Version: 1.0 5 | * Author: Yang Xian 6 | * Email: yang_xian521@163.com 7 | * Date: 2012/08/03 8 | * History: 9 | * Revised by Kaihua Zhang on 14/8/2012, 23/8/2012 10 | * Email: zhkhua@gmail.com 11 | * Homepage: http://www4.comp.polyu.edu.hk/~cskhzhang/ 12 | * Project Website: http://www4.comp.polyu.edu.hk/~cslzhang/CT/CT.htm 13 | ************************************************************************/ 14 | #pragma once 15 | #include 16 | #include 17 | #include 18 | 19 | using std::vector; 20 | using namespace cv; 21 | //--------------------------------------------------- 22 | class CompressiveTracker 23 | { 24 | public: 25 | CompressiveTracker(void); 26 | ~CompressiveTracker(void); 27 | 28 | private: 29 | int featureMinNumRect; 30 | int featureMaxNumRect; 31 | int featureNum; 32 | vector > features; 33 | vector > featuresWeight; 34 | int rOuterPositive; 35 | vector samplePositiveBox; 36 | vector sampleNegativeBox; 37 | int rSearchWindow; 38 | Mat imageIntegral; 39 | Mat samplePositiveFeatureValue; 40 | Mat sampleNegativeFeatureValue; 41 | vector muPositive; 42 | vector sigmaPositive; 43 | vector muNegative; 44 | vector sigmaNegative; 45 | float learnRate; 46 | vector detectBox; 47 | Mat detectFeatureValue; 48 | RNG rng; 49 | 50 | private: 51 | void HaarFeature(cv::Rect& _objectBox, int _numFeature); 52 | void sampleRect(Mat& _image, cv::Rect& _objectBox, float _rInner, float _rOuter, int _maxSampleNum, vector& _sampleBox); 53 | void sampleRect(Mat& _image, cv::Rect& _objectBox, float _srw, vector& _sampleBox); 54 | void getFeatureValue(Mat& _imageIntegral, vector& _sampleBox, Mat& _sampleFeatureValue); 55 | void classifierUpdate(Mat& _sampleFeatureValue, vector& _mu, vector& _sigma, float _learnRate); 56 | void radioClassifier(vector& _muPos, vector& _sigmaPos, vector& _muNeg, vector& _sigmaNeg, 57 | Mat& _sampleFeatureValue, float& _radioMax, int& _radioMaxIndex); 58 | public: 59 | void processFrame(Mat& _frame, cv::Rect& _objectBox); 60 | void init(Mat& _frame, cv::Rect& _objectBox); 61 | }; 62 | -------------------------------------------------------------------------------- /Tracking/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Tracking 4 | // 5 | // Created by FloodSurge on 8/3/15. 6 | // Copyright (c) 2015 FloodSurge. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Tracking/struck/Config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Struck: Structured Output Tracking with Kernels 3 | * 4 | * Code to accompany the paper: 5 | * Struck: Structured Output Tracking with Kernels 6 | * Sam Hare, Amir Saffari, Philip H. S. Torr 7 | * International Conference on Computer Vision (ICCV), 2011 8 | * 9 | * Copyright (C) 2011 Sam Hare, Oxford Brookes University, Oxford, UK 10 | * 11 | * This file is part of Struck. 12 | * 13 | * Struck is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | * 18 | * Struck is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with Struck. If not, see . 25 | * 26 | */ 27 | 28 | #ifndef CONFIG_H 29 | #define CONFIG_H 30 | 31 | #include 32 | #include 33 | #include 34 | 35 | #define VERBOSE (0) 36 | 37 | class Config 38 | { 39 | public: 40 | Config() { SetDefaults(); } 41 | Config(const std::string& path); 42 | 43 | enum FeatureType 44 | { 45 | kFeatureTypeHaar, 46 | kFeatureTypeRaw, 47 | kFeatureTypeHistogram 48 | }; 49 | 50 | enum KernelType 51 | { 52 | kKernelTypeLinear, 53 | kKernelTypeGaussian, 54 | kKernelTypeIntersection, 55 | kKernelTypeChi2 56 | }; 57 | 58 | struct FeatureKernelPair 59 | { 60 | FeatureType feature; 61 | KernelType kernel; 62 | std::vector params; 63 | }; 64 | 65 | bool quietMode; 66 | bool debugMode; 67 | 68 | std::string sequenceBasePath; 69 | std::string sequenceName; 70 | std::string resultsPath; 71 | 72 | int frameWidth; 73 | int frameHeight; 74 | 75 | int seed; 76 | int searchRadius; 77 | double svmC; 78 | int svmBudgetSize; 79 | std::vector features; 80 | 81 | friend std::ostream& operator<< (std::ostream& out, const Config& conf); 82 | 83 | private: 84 | void SetDefaults(); 85 | static std::string FeatureName(FeatureType f); 86 | static std::string KernelName(KernelType k); 87 | }; 88 | 89 | #endif -------------------------------------------------------------------------------- /Tracking/struck/Eigen/Array: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_ARRAY_MODULE_H 2 | #define EIGEN_ARRAY_MODULE_H 3 | 4 | #include "Core" 5 | 6 | #include "src/Core/util/DisableMSVCWarnings.h" 7 | 8 | namespace Eigen { 9 | 10 | /** \defgroup Array_Module Array module 11 | * This module provides several handy features to manipulate matrices as simple array of values. 12 | * In addition to listed classes, it defines various methods of the Cwise interface 13 | * (accessible from MatrixBase::cwise()), including: 14 | * - matrix-scalar sum, 15 | * - coeff-wise comparison operators, 16 | * - sin, cos, sqrt, pow, exp, log, square, cube, inverse (reciprocal). 17 | * 18 | * This module also provides various MatrixBase methods, including: 19 | * - \ref MatrixBase::all() "all", \ref MatrixBase::any() "any", 20 | * - \ref MatrixBase::Random() "random matrix initialization" 21 | * 22 | * \code 23 | * #include 24 | * \endcode 25 | */ 26 | 27 | #include "src/Array/CwiseOperators.h" 28 | #include "src/Array/Functors.h" 29 | #include "src/Array/BooleanRedux.h" 30 | #include "src/Array/Select.h" 31 | #include "src/Array/PartialRedux.h" 32 | #include "src/Array/Random.h" 33 | #include "src/Array/Norms.h" 34 | 35 | } // namespace Eigen 36 | 37 | #include "src/Core/util/EnableMSVCWarnings.h" 38 | 39 | #endif // EIGEN_ARRAY_MODULE_H 40 | -------------------------------------------------------------------------------- /Tracking/struck/Eigen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(Eigen_HEADERS Core LU Cholesky QR Geometry 2 | Sparse Array SVD LeastSquares 3 | QtAlignedMalloc StdVector NewStdVector 4 | Eigen Dense) 5 | 6 | if(EIGEN_BUILD_LIB) 7 | set(Eigen_SRCS 8 | src/Core/CoreInstantiations.cpp 9 | src/Cholesky/CholeskyInstantiations.cpp 10 | src/QR/QrInstantiations.cpp 11 | ) 12 | 13 | add_library(Eigen2 SHARED ${Eigen_SRCS}) 14 | 15 | install(TARGETS Eigen2 16 | RUNTIME DESTINATION bin 17 | LIBRARY DESTINATION lib 18 | ARCHIVE DESTINATION lib) 19 | endif(EIGEN_BUILD_LIB) 20 | 21 | if(CMAKE_COMPILER_IS_GNUCXX) 22 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g1 -O2") 23 | set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g1 -O2") 24 | endif(CMAKE_COMPILER_IS_GNUCXX) 25 | 26 | install(FILES 27 | ${Eigen_HEADERS} 28 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen 29 | ) 30 | 31 | add_subdirectory(src) 32 | -------------------------------------------------------------------------------- /Tracking/struck/Eigen/Cholesky: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_CHOLESKY_MODULE_H 2 | #define EIGEN_CHOLESKY_MODULE_H 3 | 4 | #include "Core" 5 | 6 | #include "src/Core/util/DisableMSVCWarnings.h" 7 | 8 | // Note that EIGEN_HIDE_HEAVY_CODE has to be defined per module 9 | #if (defined EIGEN_EXTERN_INSTANTIATIONS) && (EIGEN_EXTERN_INSTANTIATIONS>=2) 10 | #ifndef EIGEN_HIDE_HEAVY_CODE 11 | #define EIGEN_HIDE_HEAVY_CODE 12 | #endif 13 | #elif defined EIGEN_HIDE_HEAVY_CODE 14 | #undef EIGEN_HIDE_HEAVY_CODE 15 | #endif 16 | 17 | namespace Eigen { 18 | 19 | /** \defgroup Cholesky_Module Cholesky module 20 | * 21 | * \nonstableyet 22 | * 23 | * This module provides two variants of the Cholesky decomposition for selfadjoint (hermitian) matrices. 24 | * Those decompositions are accessible via the following MatrixBase methods: 25 | * - MatrixBase::llt(), 26 | * - MatrixBase::ldlt() 27 | * 28 | * \code 29 | * #include 30 | * \endcode 31 | */ 32 | 33 | #include "src/Array/CwiseOperators.h" 34 | #include "src/Array/Functors.h" 35 | #include "src/Cholesky/LLT.h" 36 | #include "src/Cholesky/LDLT.h" 37 | 38 | } // namespace Eigen 39 | 40 | #define EIGEN_CHOLESKY_MODULE_INSTANTIATE_TYPE(MATRIXTYPE,PREFIX) \ 41 | PREFIX template class LLT; \ 42 | PREFIX template class LDLT 43 | 44 | #define EIGEN_CHOLESKY_MODULE_INSTANTIATE(PREFIX) \ 45 | EIGEN_CHOLESKY_MODULE_INSTANTIATE_TYPE(Matrix2f,PREFIX); \ 46 | EIGEN_CHOLESKY_MODULE_INSTANTIATE_TYPE(Matrix2d,PREFIX); \ 47 | EIGEN_CHOLESKY_MODULE_INSTANTIATE_TYPE(Matrix3f,PREFIX); \ 48 | EIGEN_CHOLESKY_MODULE_INSTANTIATE_TYPE(Matrix3d,PREFIX); \ 49 | EIGEN_CHOLESKY_MODULE_INSTANTIATE_TYPE(Matrix4f,PREFIX); \ 50 | EIGEN_CHOLESKY_MODULE_INSTANTIATE_TYPE(Matrix4d,PREFIX); \ 51 | EIGEN_CHOLESKY_MODULE_INSTANTIATE_TYPE(MatrixXf,PREFIX); \ 52 | EIGEN_CHOLESKY_MODULE_INSTANTIATE_TYPE(MatrixXd,PREFIX); \ 53 | EIGEN_CHOLESKY_MODULE_INSTANTIATE_TYPE(MatrixXcf,PREFIX); \ 54 | EIGEN_CHOLESKY_MODULE_INSTANTIATE_TYPE(MatrixXcd,PREFIX) 55 | 56 | #ifdef EIGEN_EXTERN_INSTANTIATIONS 57 | 58 | namespace Eigen { 59 | EIGEN_CHOLESKY_MODULE_INSTANTIATE(extern); 60 | } // namespace Eigen 61 | #endif 62 | 63 | #include "src/Core/util/EnableMSVCWarnings.h" 64 | 65 | #endif // EIGEN_CHOLESKY_MODULE_H 66 | -------------------------------------------------------------------------------- /Tracking/struck/Eigen/Dense: -------------------------------------------------------------------------------- 1 | #include "Core" 2 | #include "Array" 3 | #include "LU" 4 | #include "Cholesky" 5 | #include "QR" 6 | #include "SVD" 7 | #include "Geometry" 8 | #include "LeastSquares" 9 | -------------------------------------------------------------------------------- /Tracking/struck/Eigen/Eigen: -------------------------------------------------------------------------------- 1 | #include "Dense" 2 | #include "Sparse" 3 | -------------------------------------------------------------------------------- /Tracking/struck/Eigen/Geometry: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_GEOMETRY_MODULE_H 2 | #define EIGEN_GEOMETRY_MODULE_H 3 | 4 | #include "Core" 5 | 6 | #include "src/Core/util/DisableMSVCWarnings.h" 7 | 8 | #include "Array" 9 | #include 10 | 11 | #ifndef M_PI 12 | #define M_PI 3.14159265358979323846 13 | #endif 14 | 15 | namespace Eigen { 16 | 17 | /** \defgroup Geometry_Module Geometry module 18 | * 19 | * \nonstableyet 20 | * 21 | * This module provides support for: 22 | * - fixed-size homogeneous transformations 23 | * - translation, scaling, 2D and 3D rotations 24 | * - quaternions 25 | * - \ref MatrixBase::cross() "cross product" 26 | * - \ref MatrixBase::unitOrthogonal() "orthognal vector generation" 27 | * - some linear components: parametrized-lines and hyperplanes 28 | * 29 | * \code 30 | * #include 31 | * \endcode 32 | */ 33 | 34 | #include "src/Geometry/OrthoMethods.h" 35 | #include "src/Geometry/RotationBase.h" 36 | #include "src/Geometry/Rotation2D.h" 37 | #include "src/Geometry/Quaternion.h" 38 | #include "src/Geometry/AngleAxis.h" 39 | #include "src/Geometry/EulerAngles.h" 40 | #include "src/Geometry/Transform.h" 41 | #include "src/Geometry/Translation.h" 42 | #include "src/Geometry/Scaling.h" 43 | #include "src/Geometry/Hyperplane.h" 44 | #include "src/Geometry/ParametrizedLine.h" 45 | #include "src/Geometry/AlignedBox.h" 46 | 47 | } // namespace Eigen 48 | 49 | #include "src/Core/util/EnableMSVCWarnings.h" 50 | 51 | #endif // EIGEN_GEOMETRY_MODULE_H 52 | -------------------------------------------------------------------------------- /Tracking/struck/Eigen/LU: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_LU_MODULE_H 2 | #define EIGEN_LU_MODULE_H 3 | 4 | #include "Core" 5 | 6 | #include "src/Core/util/DisableMSVCWarnings.h" 7 | 8 | namespace Eigen { 9 | 10 | /** \defgroup LU_Module LU module 11 | * This module includes %LU decomposition and related notions such as matrix inversion and determinant. 12 | * This module defines the following MatrixBase methods: 13 | * - MatrixBase::inverse() 14 | * - MatrixBase::determinant() 15 | * 16 | * \code 17 | * #include 18 | * \endcode 19 | */ 20 | 21 | #include "src/LU/LU.h" 22 | #include "src/LU/Determinant.h" 23 | #include "src/LU/Inverse.h" 24 | 25 | } // namespace Eigen 26 | 27 | #include "src/Core/util/EnableMSVCWarnings.h" 28 | 29 | #endif // EIGEN_LU_MODULE_H 30 | -------------------------------------------------------------------------------- /Tracking/struck/Eigen/LeastSquares: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_REGRESSION_MODULE_H 2 | #define EIGEN_REGRESSION_MODULE_H 3 | 4 | #include "Core" 5 | 6 | #include "src/Core/util/DisableMSVCWarnings.h" 7 | 8 | #include "QR" 9 | #include "Geometry" 10 | 11 | namespace Eigen { 12 | 13 | /** \defgroup LeastSquares_Module LeastSquares module 14 | * This module provides linear regression and related features. 15 | * 16 | * \code 17 | * #include 18 | * \endcode 19 | */ 20 | 21 | #include "src/LeastSquares/LeastSquares.h" 22 | 23 | } // namespace Eigen 24 | 25 | #include "src/Core/util/EnableMSVCWarnings.h" 26 | 27 | #endif // EIGEN_REGRESSION_MODULE_H 28 | -------------------------------------------------------------------------------- /Tracking/struck/Eigen/QR: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_QR_MODULE_H 2 | #define EIGEN_QR_MODULE_H 3 | 4 | #include "Core" 5 | 6 | #include "src/Core/util/DisableMSVCWarnings.h" 7 | 8 | #include "Cholesky" 9 | 10 | // Note that EIGEN_HIDE_HEAVY_CODE has to be defined per module 11 | #if (defined EIGEN_EXTERN_INSTANTIATIONS) && (EIGEN_EXTERN_INSTANTIATIONS>=2) 12 | #ifndef EIGEN_HIDE_HEAVY_CODE 13 | #define EIGEN_HIDE_HEAVY_CODE 14 | #endif 15 | #elif defined EIGEN_HIDE_HEAVY_CODE 16 | #undef EIGEN_HIDE_HEAVY_CODE 17 | #endif 18 | 19 | namespace Eigen { 20 | 21 | /** \defgroup QR_Module QR module 22 | * 23 | * \nonstableyet 24 | * 25 | * This module mainly provides QR decomposition and an eigen value solver. 26 | * This module also provides some MatrixBase methods, including: 27 | * - MatrixBase::qr(), 28 | * - MatrixBase::eigenvalues(), 29 | * - MatrixBase::operatorNorm() 30 | * 31 | * \code 32 | * #include 33 | * \endcode 34 | */ 35 | 36 | #include "src/QR/QR.h" 37 | #include "src/QR/Tridiagonalization.h" 38 | #include "src/QR/EigenSolver.h" 39 | #include "src/QR/SelfAdjointEigenSolver.h" 40 | #include "src/QR/HessenbergDecomposition.h" 41 | 42 | // declare all classes for a given matrix type 43 | #define EIGEN_QR_MODULE_INSTANTIATE_TYPE(MATRIXTYPE,PREFIX) \ 44 | PREFIX template class QR; \ 45 | PREFIX template class Tridiagonalization; \ 46 | PREFIX template class HessenbergDecomposition; \ 47 | PREFIX template class SelfAdjointEigenSolver 48 | 49 | // removed because it does not support complex yet 50 | // PREFIX template class EigenSolver 51 | 52 | // declare all class for all types 53 | #define EIGEN_QR_MODULE_INSTANTIATE(PREFIX) \ 54 | EIGEN_QR_MODULE_INSTANTIATE_TYPE(Matrix2f,PREFIX); \ 55 | EIGEN_QR_MODULE_INSTANTIATE_TYPE(Matrix2d,PREFIX); \ 56 | EIGEN_QR_MODULE_INSTANTIATE_TYPE(Matrix3f,PREFIX); \ 57 | EIGEN_QR_MODULE_INSTANTIATE_TYPE(Matrix3d,PREFIX); \ 58 | EIGEN_QR_MODULE_INSTANTIATE_TYPE(Matrix4f,PREFIX); \ 59 | EIGEN_QR_MODULE_INSTANTIATE_TYPE(Matrix4d,PREFIX); \ 60 | EIGEN_QR_MODULE_INSTANTIATE_TYPE(MatrixXf,PREFIX); \ 61 | EIGEN_QR_MODULE_INSTANTIATE_TYPE(MatrixXd,PREFIX); \ 62 | EIGEN_QR_MODULE_INSTANTIATE_TYPE(MatrixXcf,PREFIX); \ 63 | EIGEN_QR_MODULE_INSTANTIATE_TYPE(MatrixXcd,PREFIX) 64 | 65 | #ifdef EIGEN_EXTERN_INSTANTIATIONS 66 | EIGEN_QR_MODULE_INSTANTIATE(extern); 67 | #endif // EIGEN_EXTERN_INSTANTIATIONS 68 | 69 | } // namespace Eigen 70 | 71 | #include "src/Core/util/EnableMSVCWarnings.h" 72 | 73 | #endif // EIGEN_QR_MODULE_H 74 | -------------------------------------------------------------------------------- /Tracking/struck/Eigen/QtAlignedMalloc: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_QTMALLOC_MODULE_H 2 | #define EIGEN_QTMALLOC_MODULE_H 3 | 4 | #if (!EIGEN_MALLOC_ALREADY_ALIGNED) 5 | 6 | #ifdef QVECTOR_H 7 | #error You must include before . 8 | #endif 9 | 10 | #ifdef Q_DECL_IMPORT 11 | #define Q_DECL_IMPORT_ORIG Q_DECL_IMPORT 12 | #undef Q_DECL_IMPORT 13 | #define Q_DECL_IMPORT 14 | #else 15 | #define Q_DECL_IMPORT 16 | #endif 17 | 18 | #include "Core" 19 | 20 | #include 21 | 22 | inline void *qMalloc(size_t size) 23 | { 24 | return Eigen::ei_aligned_malloc(size); 25 | } 26 | 27 | inline void qFree(void *ptr) 28 | { 29 | Eigen::ei_aligned_free(ptr); 30 | } 31 | 32 | inline void *qRealloc(void *ptr, size_t size) 33 | { 34 | void* newPtr = Eigen::ei_aligned_malloc(size); 35 | memcpy(newPtr, ptr, size); 36 | Eigen::ei_aligned_free(ptr); 37 | return newPtr; 38 | } 39 | 40 | #endif 41 | 42 | #ifdef Q_DECL_IMPORT_ORIG 43 | #define Q_DECL_IMPORT Q_DECL_IMPORT_ORIG 44 | #undef Q_DECL_IMPORT_ORIG 45 | #else 46 | #undef Q_DECL_IMPORT 47 | #endif 48 | 49 | #endif // EIGEN_QTMALLOC_MODULE_H 50 | -------------------------------------------------------------------------------- /Tracking/struck/Eigen/SVD: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_SVD_MODULE_H 2 | #define EIGEN_SVD_MODULE_H 3 | 4 | #include "Core" 5 | 6 | #include "src/Core/util/DisableMSVCWarnings.h" 7 | 8 | namespace Eigen { 9 | 10 | /** \defgroup SVD_Module SVD module 11 | * 12 | * \nonstableyet 13 | * 14 | * This module provides SVD decomposition for (currently) real matrices. 15 | * This decomposition is accessible via the following MatrixBase method: 16 | * - MatrixBase::svd() 17 | * 18 | * \code 19 | * #include 20 | * \endcode 21 | */ 22 | 23 | #include "src/SVD/SVD.h" 24 | 25 | } // namespace Eigen 26 | 27 | #include "src/Core/util/EnableMSVCWarnings.h" 28 | 29 | #endif // EIGEN_SVD_MODULE_H 30 | -------------------------------------------------------------------------------- /Tracking/struck/Eigen/src/Array/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Array_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Array_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Array 6 | ) 7 | -------------------------------------------------------------------------------- /Tracking/struck/Eigen/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ADD_SUBDIRECTORY(Core) 2 | ADD_SUBDIRECTORY(LU) 3 | ADD_SUBDIRECTORY(QR) 4 | ADD_SUBDIRECTORY(SVD) 5 | ADD_SUBDIRECTORY(Cholesky) 6 | ADD_SUBDIRECTORY(Array) 7 | ADD_SUBDIRECTORY(Geometry) 8 | ADD_SUBDIRECTORY(LeastSquares) 9 | ADD_SUBDIRECTORY(Sparse) 10 | -------------------------------------------------------------------------------- /Tracking/struck/Eigen/src/Cholesky/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Cholesky_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Cholesky_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Cholesky 6 | ) 7 | -------------------------------------------------------------------------------- /Tracking/struck/Eigen/src/Cholesky/CholeskyInstantiations.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. Eigen itself is part of the KDE project. 3 | // 4 | // Copyright (C) 2008 Gael Guennebaud 5 | // 6 | // Eigen is free software; you can redistribute it and/or 7 | // modify it under the terms of the GNU Lesser General Public 8 | // License as published by the Free Software Foundation; either 9 | // version 3 of the License, or (at your option) any later version. 10 | // 11 | // Alternatively, you can redistribute it and/or 12 | // modify it under the terms of the GNU General Public License as 13 | // published by the Free Software Foundation; either version 2 of 14 | // the License, or (at your option) any later version. 15 | // 16 | // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY 17 | // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 18 | // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the 19 | // GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public 22 | // License and a copy of the GNU General Public License along with 23 | // Eigen. If not, see . 24 | 25 | #ifndef EIGEN_EXTERN_INSTANTIATIONS 26 | #define EIGEN_EXTERN_INSTANTIATIONS 27 | #endif 28 | #include "../../Core" 29 | #undef EIGEN_EXTERN_INSTANTIATIONS 30 | 31 | #include "../../Cholesky" 32 | 33 | namespace Eigen { 34 | EIGEN_CHOLESKY_MODULE_INSTANTIATE(); 35 | } 36 | -------------------------------------------------------------------------------- /Tracking/struck/Eigen/src/Core/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Core_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Core_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Core 6 | ) 7 | 8 | ADD_SUBDIRECTORY(util) 9 | ADD_SUBDIRECTORY(arch) 10 | -------------------------------------------------------------------------------- /Tracking/struck/Eigen/src/Core/CoreInstantiations.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. Eigen itself is part of the KDE project. 3 | // 4 | // Copyright (C) 2008 Gael Guennebaud 5 | // 6 | // Eigen is free software; you can redistribute it and/or 7 | // modify it under the terms of the GNU Lesser General Public 8 | // License as published by the Free Software Foundation; either 9 | // version 3 of the License, or (at your option) any later version. 10 | // 11 | // Alternatively, you can redistribute it and/or 12 | // modify it under the terms of the GNU General Public License as 13 | // published by the Free Software Foundation; either version 2 of 14 | // the License, or (at your option) any later version. 15 | // 16 | // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY 17 | // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 18 | // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the 19 | // GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public 22 | // License and a copy of the GNU General Public License along with 23 | // Eigen. If not, see . 24 | 25 | #ifdef EIGEN_EXTERN_INSTANTIATIONS 26 | #undef EIGEN_EXTERN_INSTANTIATIONS 27 | #endif 28 | 29 | #include "../../Core" 30 | 31 | namespace Eigen 32 | { 33 | 34 | #define EIGEN_INSTANTIATE_PRODUCT(TYPE) \ 35 | template void ei_cache_friendly_product( \ 36 | int _rows, int _cols, int depth, \ 37 | bool _lhsRowMajor, const TYPE* _lhs, int _lhsStride, \ 38 | bool _rhsRowMajor, const TYPE* _rhs, int _rhsStride, \ 39 | bool resRowMajor, TYPE* res, int resStride) 40 | 41 | EIGEN_INSTANTIATE_PRODUCT(float); 42 | EIGEN_INSTANTIATE_PRODUCT(double); 43 | EIGEN_INSTANTIATE_PRODUCT(int); 44 | EIGEN_INSTANTIATE_PRODUCT(std::complex); 45 | EIGEN_INSTANTIATE_PRODUCT(std::complex); 46 | 47 | } 48 | -------------------------------------------------------------------------------- /Tracking/struck/Eigen/src/Core/arch/AltiVec/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Core_arch_AltiVec_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Core_arch_AltiVec_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Core/arch/AltiVec 6 | ) -------------------------------------------------------------------------------- /Tracking/struck/Eigen/src/Core/arch/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ADD_SUBDIRECTORY(SSE) 2 | ADD_SUBDIRECTORY(AltiVec) -------------------------------------------------------------------------------- /Tracking/struck/Eigen/src/Core/arch/SSE/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Core_arch_SSE_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Core_arch_SSE_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Core/arch/SSE 6 | ) -------------------------------------------------------------------------------- /Tracking/struck/Eigen/src/Core/util/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Core_util_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Core_util_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Core/util 6 | ) 7 | -------------------------------------------------------------------------------- /Tracking/struck/Eigen/src/Core/util/DisableMSVCWarnings.h: -------------------------------------------------------------------------------- 1 | 2 | #ifdef _MSC_VER 3 | #pragma warning( push ) 4 | #pragma warning( disable : 4181 4244 4127 4211 4717 ) 5 | #endif 6 | -------------------------------------------------------------------------------- /Tracking/struck/Eigen/src/Core/util/EnableMSVCWarnings.h: -------------------------------------------------------------------------------- 1 | 2 | #ifdef _MSC_VER 3 | #pragma warning( pop ) 4 | #endif 5 | -------------------------------------------------------------------------------- /Tracking/struck/Eigen/src/Geometry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Geometry_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Geometry_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Geometry 6 | ) 7 | -------------------------------------------------------------------------------- /Tracking/struck/Eigen/src/LU/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_LU_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_LU_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/LU 6 | ) 7 | -------------------------------------------------------------------------------- /Tracking/struck/Eigen/src/LeastSquares/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_LeastSquares_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_LeastSquares_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/LeastSquares 6 | ) 7 | -------------------------------------------------------------------------------- /Tracking/struck/Eigen/src/QR/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_QR_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_QR_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/QR 6 | ) 7 | -------------------------------------------------------------------------------- /Tracking/struck/Eigen/src/QR/QrInstantiations.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. Eigen itself is part of the KDE project. 3 | // 4 | // Copyright (C) 2008 Gael Guennebaud 5 | // 6 | // Eigen is free software; you can redistribute it and/or 7 | // modify it under the terms of the GNU Lesser General Public 8 | // License as published by the Free Software Foundation; either 9 | // version 3 of the License, or (at your option) any later version. 10 | // 11 | // Alternatively, you can redistribute it and/or 12 | // modify it under the terms of the GNU General Public License as 13 | // published by the Free Software Foundation; either version 2 of 14 | // the License, or (at your option) any later version. 15 | // 16 | // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY 17 | // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 18 | // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the 19 | // GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public 22 | // License and a copy of the GNU General Public License along with 23 | // Eigen. If not, see . 24 | 25 | #ifndef EIGEN_EXTERN_INSTANTIATIONS 26 | #define EIGEN_EXTERN_INSTANTIATIONS 27 | #endif 28 | #include "../../Core" 29 | #undef EIGEN_EXTERN_INSTANTIATIONS 30 | 31 | #include "../../QR" 32 | 33 | namespace Eigen 34 | { 35 | 36 | template void ei_tridiagonal_qr_step(float* , float* , int, int, float* , int); 37 | template void ei_tridiagonal_qr_step(double* , double* , int, int, double* , int); 38 | template void ei_tridiagonal_qr_step(float* , float* , int, int, std::complex* , int); 39 | template void ei_tridiagonal_qr_step(double* , double* , int, int, std::complex* , int); 40 | 41 | EIGEN_QR_MODULE_INSTANTIATE(); 42 | 43 | } 44 | -------------------------------------------------------------------------------- /Tracking/struck/Eigen/src/SVD/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_SVD_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_SVD_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/SVD 6 | ) 7 | -------------------------------------------------------------------------------- /Tracking/struck/Eigen/src/Sparse/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Sparse_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Sparse_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Sparse COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /Tracking/struck/Eigen/src/Sparse/CoreIterators.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. Eigen itself is part of the KDE project. 3 | // 4 | // Copyright (C) 2008 Gael Guennebaud 5 | // 6 | // Eigen is free software; you can redistribute it and/or 7 | // modify it under the terms of the GNU Lesser General Public 8 | // License as published by the Free Software Foundation; either 9 | // version 3 of the License, or (at your option) any later version. 10 | // 11 | // Alternatively, you can redistribute it and/or 12 | // modify it under the terms of the GNU General Public License as 13 | // published by the Free Software Foundation; either version 2 of 14 | // the License, or (at your option) any later version. 15 | // 16 | // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY 17 | // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 18 | // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the 19 | // GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public 22 | // License and a copy of the GNU General Public License along with 23 | // Eigen. If not, see . 24 | 25 | #ifndef EIGEN_COREITERATORS_H 26 | #define EIGEN_COREITERATORS_H 27 | 28 | /* This file contains the respective InnerIterator definition of the expressions defined in Eigen/Core 29 | */ 30 | 31 | /** \class InnerIterator 32 | * \brief An InnerIterator allows to loop over the element of a sparse (or dense) matrix or expression 33 | * 34 | * todo 35 | */ 36 | 37 | // generic version for dense matrix and expressions 38 | template class MatrixBase::InnerIterator 39 | { 40 | typedef typename Derived::Scalar Scalar; 41 | enum { IsRowMajor = (Derived::Flags&RowMajorBit)==RowMajorBit }; 42 | public: 43 | EIGEN_STRONG_INLINE InnerIterator(const Derived& expr, int outer) 44 | : m_expression(expr), m_inner(0), m_outer(outer), m_end(expr.rows()) 45 | {} 46 | 47 | EIGEN_STRONG_INLINE Scalar value() const 48 | { 49 | return (IsRowMajor) ? m_expression.coeff(m_outer, m_inner) 50 | : m_expression.coeff(m_inner, m_outer); 51 | } 52 | 53 | EIGEN_STRONG_INLINE InnerIterator& operator++() { m_inner++; return *this; } 54 | 55 | EIGEN_STRONG_INLINE int index() const { return m_inner; } 56 | inline int row() const { return IsRowMajor ? m_outer : index(); } 57 | inline int col() const { return IsRowMajor ? index() : m_outer; } 58 | 59 | EIGEN_STRONG_INLINE operator bool() const { return m_inner < m_end && m_inner>=0; } 60 | 61 | protected: 62 | const Derived& m_expression; 63 | int m_inner; 64 | const int m_outer; 65 | const int m_end; 66 | }; 67 | 68 | #endif // EIGEN_COREITERATORS_H 69 | -------------------------------------------------------------------------------- /Tracking/struck/Eigen/src/Sparse/SparseAssign.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/floodsung/Tracking-on-iOS/e87e420a8a24ee5ea47b1af930742e9c97dacc7b/Tracking/struck/Eigen/src/Sparse/SparseAssign.h -------------------------------------------------------------------------------- /Tracking/struck/Eigen/src/Sparse/SparseFuzzy.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. Eigen itself is part of the KDE project. 3 | // 4 | // Copyright (C) 2008 Gael Guennebaud 5 | // 6 | // Eigen is free software; you can redistribute it and/or 7 | // modify it under the terms of the GNU Lesser General Public 8 | // License as published by the Free Software Foundation; either 9 | // version 3 of the License, or (at your option) any later version. 10 | // 11 | // Alternatively, you can redistribute it and/or 12 | // modify it under the terms of the GNU General Public License as 13 | // published by the Free Software Foundation; either version 2 of 14 | // the License, or (at your option) any later version. 15 | // 16 | // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY 17 | // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 18 | // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the 19 | // GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public 22 | // License and a copy of the GNU General Public License along with 23 | // Eigen. If not, see . 24 | 25 | #ifndef EIGEN_SPARSE_FUZZY_H 26 | #define EIGEN_SPARSE_FUZZY_H 27 | 28 | // template 29 | // template 30 | // bool SparseMatrixBase::isApprox( 31 | // const OtherDerived& other, 32 | // typename NumTraits::Real prec 33 | // ) const 34 | // { 35 | // const typename ei_nested::type nested(derived()); 36 | // const typename ei_nested::type otherNested(other.derived()); 37 | // return (nested - otherNested).cwise().abs2().sum() 38 | // <= prec * prec * std::min(nested.cwise().abs2().sum(), otherNested.cwise().abs2().sum()); 39 | // } 40 | 41 | #endif // EIGEN_SPARSE_FUZZY_H 42 | -------------------------------------------------------------------------------- /Tracking/struck/Eigen/src/Sparse/SparseRedux.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. Eigen itself is part of the KDE project. 3 | // 4 | // Copyright (C) 2008 Gael Guennebaud 5 | // 6 | // Eigen is free software; you can redistribute it and/or 7 | // modify it under the terms of the GNU Lesser General Public 8 | // License as published by the Free Software Foundation; either 9 | // version 3 of the License, or (at your option) any later version. 10 | // 11 | // Alternatively, you can redistribute it and/or 12 | // modify it under the terms of the GNU General Public License as 13 | // published by the Free Software Foundation; either version 2 of 14 | // the License, or (at your option) any later version. 15 | // 16 | // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY 17 | // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 18 | // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the 19 | // GNU General Public License for more details. 20 | // 21 | // You should have received a copy of the GNU Lesser General Public 22 | // License and a copy of the GNU General Public License along with 23 | // Eigen. If not, see . 24 | 25 | #ifndef EIGEN_SPARSEREDUX_H 26 | #define EIGEN_SPARSEREDUX_H 27 | 28 | template 29 | typename ei_traits::Scalar 30 | SparseMatrixBase::sum() const 31 | { 32 | ei_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); 33 | Scalar res = 0; 34 | for (int j=0; j. 25 | * 26 | */ 27 | 28 | #include "Features.h" 29 | 30 | using namespace Eigen; 31 | 32 | Features::Features() : 33 | m_featureCount(0) 34 | { 35 | } 36 | 37 | void Features::SetCount(int c) 38 | { 39 | m_featureCount = c; 40 | m_featVec = VectorXd::Zero(c); 41 | } 42 | -------------------------------------------------------------------------------- /Tracking/struck/Features.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Struck: Structured Output Tracking with Kernels 3 | * 4 | * Code to accompany the paper: 5 | * Struck: Structured Output Tracking with Kernels 6 | * Sam Hare, Amir Saffari, Philip H. S. Torr 7 | * International Conference on Computer Vision (ICCV), 2011 8 | * 9 | * Copyright (C) 2011 Sam Hare, Oxford Brookes University, Oxford, UK 10 | * 11 | * This file is part of Struck. 12 | * 13 | * Struck is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | * 18 | * Struck is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with Struck. If not, see . 25 | * 26 | */ 27 | 28 | #ifndef FEATURES_H 29 | #define FEATURES_H 30 | 31 | #include "Sample.h" 32 | 33 | 34 | #include "Eigen/Core" 35 | #include 36 | 37 | class Features 38 | { 39 | public: 40 | Features(); 41 | 42 | inline const Eigen::VectorXd& Eval(const Sample& s) const 43 | { 44 | const_cast(this)->UpdateFeatureVector(s); 45 | return m_featVec; 46 | } 47 | 48 | virtual void Eval(const MultiSample& s, std::vector& featVecs) 49 | { 50 | // default implementation 51 | featVecs.resize(s.GetStruckRects().size()); 52 | for (int i = 0; i < (int)featVecs.size(); ++i) 53 | { 54 | featVecs[i] = Eval(s.GetSample(i)); 55 | } 56 | } 57 | 58 | inline int GetCount() const { return m_featureCount; } 59 | 60 | protected: 61 | 62 | int m_featureCount; 63 | Eigen::VectorXd m_featVec; 64 | 65 | void SetCount(int c); 66 | virtual void UpdateFeatureVector(const Sample& s) = 0; 67 | 68 | }; 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /Tracking/struck/HaarFeature.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Struck: Structured Output Tracking with Kernels 3 | * 4 | * Code to accompany the paper: 5 | * Struck: Structured Output Tracking with Kernels 6 | * Sam Hare, Amir Saffari, Philip H. S. Torr 7 | * International Conference on Computer Vision (ICCV), 2011 8 | * 9 | * Copyright (C) 2011 Sam Hare, Oxford Brookes University, Oxford, UK 10 | * 11 | * This file is part of Struck. 12 | * 13 | * Struck is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | * 18 | * Struck is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with Struck. If not, see . 25 | * 26 | */ 27 | 28 | #ifndef HAAR_FEATURE_H 29 | #define HAAR_FEATURE_H 30 | 31 | #include "StruckRect.h" 32 | #include "ImageRep.h" 33 | 34 | #include 35 | 36 | class Sample; 37 | 38 | class HaarFeature 39 | { 40 | public: 41 | HaarFeature(const FloatStruckRect& bb, int type); 42 | ~HaarFeature(); 43 | 44 | float Eval(const Sample& s) const; 45 | 46 | private: 47 | FloatStruckRect m_bb; 48 | std::vector m_StruckRects; 49 | std::vector m_weights; 50 | float m_factor; 51 | }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /Tracking/struck/HaarFeatures.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Struck: Structured Output Tracking with Kernels 3 | * 4 | * Code to accompany the paper: 5 | * Struck: Structured Output Tracking with Kernels 6 | * Sam Hare, Amir Saffari, Philip H. S. Torr 7 | * International Conference on Computer Vision (ICCV), 2011 8 | * 9 | * Copyright (C) 2011 Sam Hare, Oxford Brookes University, Oxford, UK 10 | * 11 | * This file is part of Struck. 12 | * 13 | * Struck is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | * 18 | * Struck is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with Struck. If not, see . 25 | * 26 | */ 27 | 28 | #include "HaarFeatures.h" 29 | #include "Config.h" 30 | 31 | static const int kSystematicFeatureCount = 192; 32 | 33 | HaarFeatures::HaarFeatures(const Config& conf) 34 | { 35 | SetCount(kSystematicFeatureCount); 36 | GenerateSystematic(); 37 | } 38 | 39 | void HaarFeatures::GenerateSystematic() 40 | { 41 | float x[] = {0.2f, 0.4f, 0.6f, 0.8f}; 42 | float y[] = {0.2f, 0.4f, 0.6f, 0.8f}; 43 | float s[] = {0.2f, 0.4f}; 44 | for (int iy = 0; iy < 4; ++iy) 45 | { 46 | for (int ix = 0; ix < 4; ++ix) 47 | { 48 | for (int is = 0; is < 2; ++is) 49 | { 50 | FloatStruckRect r(x[ix]-s[is]/2, y[iy]-s[is]/2, s[is], s[is]); 51 | for (int it = 0; it < 6; ++it) 52 | { 53 | m_features.push_back(HaarFeature(r, it)); 54 | } 55 | } 56 | } 57 | } 58 | } 59 | 60 | void HaarFeatures::UpdateFeatureVector(const Sample& s) 61 | { 62 | for (int i = 0; i < m_featureCount; ++i) 63 | { 64 | m_featVec[i] = m_features[i].Eval(s); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Tracking/struck/HaarFeatures.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Struck: Structured Output Tracking with Kernels 3 | * 4 | * Code to accompany the paper: 5 | * Struck: Structured Output Tracking with Kernels 6 | * Sam Hare, Amir Saffari, Philip H. S. Torr 7 | * International Conference on Computer Vision (ICCV), 2011 8 | * 9 | * Copyright (C) 2011 Sam Hare, Oxford Brookes University, Oxford, UK 10 | * 11 | * This file is part of Struck. 12 | * 13 | * Struck is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | * 18 | * Struck is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with Struck. If not, see . 25 | * 26 | */ 27 | 28 | #ifndef HAAR_FEATURES_H 29 | #define HAAR_FEATURES_H 30 | 31 | #include "Features.h" 32 | #include "HaarFeature.h" 33 | 34 | #include 35 | 36 | class Config; 37 | 38 | class HaarFeatures : public Features 39 | { 40 | public: 41 | HaarFeatures(const Config& conf); 42 | 43 | private: 44 | std::vector m_features; 45 | 46 | virtual void UpdateFeatureVector(const Sample& s); 47 | 48 | void GenerateSystematic(); 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /Tracking/struck/HistogramFeatures.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Struck: Structured Output Tracking with Kernels 3 | * 4 | * Code to accompany the paper: 5 | * Struck: Structured Output Tracking with Kernels 6 | * Sam Hare, Amir Saffari, Philip H. S. Torr 7 | * International Conference on Computer Vision (ICCV), 2011 8 | * 9 | * Copyright (C) 2011 Sam Hare, Oxford Brookes University, Oxford, UK 10 | * 11 | * This file is part of Struck. 12 | * 13 | * Struck is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | * 18 | * Struck is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with Struck. If not, see . 25 | * 26 | */ 27 | 28 | #include "HistogramFeatures.h" 29 | #include "Config.h" 30 | #include "Sample.h" 31 | #include "StruckRect.h" 32 | 33 | #include 34 | 35 | using namespace Eigen; 36 | using namespace cv; 37 | using namespace std; 38 | 39 | static const int kNumBins = 16; 40 | static const int kNumLevels = 4; 41 | static const int kNumCellsX = 3; 42 | static const int kNumCellsY = 3; 43 | 44 | HistogramFeatures::HistogramFeatures(const Config& conf) 45 | { 46 | int nc = 0; 47 | for (int i = 0; i < kNumLevels; ++i) 48 | { 49 | //nc += 1 << 2*i; 50 | nc += (i+1)*(i+1); 51 | } 52 | SetCount(kNumBins*nc); 53 | cout << "histogram bins: " << GetCount() << endl; 54 | } 55 | 56 | void HistogramFeatures::UpdateFeatureVector(const Sample& s) 57 | { 58 | IntStruckRect StruckRect = s.GetROI(); // note this truncates to integers 59 | //cv::StruckRect roi(StruckRect.XMin(), StruckRect.YMin(), StruckRect.Width(), StruckRect.Height()); 60 | //cv::resize(s.GetImage().GetImage(0)(roi), m_patchImage, m_patchImage.size()); 61 | 62 | m_featVec.setZero(); 63 | VectorXd hist(kNumBins); 64 | 65 | int histind = 0; 66 | for (int il = 0; il < kNumLevels; ++il) 67 | { 68 | int nc = il+1; 69 | float w = s.GetROI().Width()/nc; 70 | float h = s.GetROI().Height()/nc; 71 | FloatStruckRect cell(0.f, 0.f, w, h); 72 | for (int iy = 0; iy < nc; ++iy) 73 | { 74 | cell.SetYMin(s.GetROI().YMin()+iy*h); 75 | for (int ix = 0; ix < nc; ++ix) 76 | { 77 | cell.SetXMin(s.GetROI().XMin()+ix*w); 78 | s.GetImage().Hist(cell, hist); 79 | m_featVec.segment(histind*kNumBins, kNumBins) = hist; 80 | ++histind; 81 | } 82 | } 83 | } 84 | m_featVec /= histind; 85 | } 86 | -------------------------------------------------------------------------------- /Tracking/struck/HistogramFeatures.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Struck: Structured Output Tracking with Kernels 3 | * 4 | * Code to accompany the paper: 5 | * Struck: Structured Output Tracking with Kernels 6 | * Sam Hare, Amir Saffari, Philip H. S. Torr 7 | * International Conference on Computer Vision (ICCV), 2011 8 | * 9 | * Copyright (C) 2011 Sam Hare, Oxford Brookes University, Oxford, UK 10 | * 11 | * This file is part of Struck. 12 | * 13 | * Struck is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | * 18 | * Struck is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with Struck. If not, see . 25 | * 26 | */ 27 | 28 | #ifndef HISTOGRAM_FEATURES_H 29 | #define HISTOGRAM_FEATURES_H 30 | 31 | #include "Features.h" 32 | 33 | class Config; 34 | 35 | class HistogramFeatures : public Features 36 | { 37 | public: 38 | HistogramFeatures(const Config& conf); 39 | 40 | private: 41 | 42 | virtual void UpdateFeatureVector(const Sample& s); 43 | }; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /Tracking/struck/ImageRep.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Struck: Structured Output Tracking with Kernels 3 | * 4 | * Code to accompany the paper: 5 | * Struck: Structured Output Tracking with Kernels 6 | * Sam Hare, Amir Saffari, Philip H. S. Torr 7 | * International Conference on Computer Vision (ICCV), 2011 8 | * 9 | * Copyright (C) 2011 Sam Hare, Oxford Brookes University, Oxford, UK 10 | * 11 | * This file is part of Struck. 12 | * 13 | * Struck is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | * 18 | * Struck is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with Struck. If not, see . 25 | * 26 | */ 27 | 28 | #ifndef IMAGE_REP_H 29 | #define IMAGE_REP_H 30 | 31 | #include "StruckRect.h" 32 | #include 33 | 34 | #include 35 | #include 36 | #include "Eigen/Core" 37 | 38 | class ImageRep 39 | { 40 | public: 41 | ImageRep(const cv::Mat& rImage, bool computeIntegral, bool computeIntegralHists, bool colour = false); 42 | 43 | int Sum(const IntStruckRect& rStruckRect, int channel = 0) const; 44 | void Hist(const IntStruckRect& rStruckRect, Eigen::VectorXd& h) const; 45 | 46 | inline const cv::Mat& GetImage(int channel = 0) const { return m_images[channel]; } 47 | inline const IntStruckRect& GetStruckRect() const { return m_StruckRect; } 48 | 49 | private: 50 | std::vector m_images; 51 | std::vector m_integralImages; 52 | std::vector m_integralHistImages; 53 | int m_channels; 54 | IntStruckRect m_StruckRect; 55 | }; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /Tracking/struck/MultiFeatures.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Struck: Structured Output Tracking with Kernels 3 | * 4 | * Code to accompany the paper: 5 | * Struck: Structured Output Tracking with Kernels 6 | * Sam Hare, Amir Saffari, Philip H. S. Torr 7 | * International Conference on Computer Vision (ICCV), 2011 8 | * 9 | * Copyright (C) 2011 Sam Hare, Oxford Brookes University, Oxford, UK 10 | * 11 | * This file is part of Struck. 12 | * 13 | * Struck is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | * 18 | * Struck is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with Struck. If not, see . 25 | * 26 | */ 27 | 28 | #include "MultiFeatures.h" 29 | 30 | using namespace Eigen; 31 | using namespace std; 32 | 33 | MultiFeatures::MultiFeatures(const vector& features) : 34 | m_features(features) 35 | { 36 | int d = 0; 37 | for (int i = 0; i < (int)features.size(); ++i) 38 | { 39 | d += features[i]->GetCount(); 40 | } 41 | SetCount(d); 42 | } 43 | 44 | void MultiFeatures::UpdateFeatureVector(const Sample& s) 45 | { 46 | int start = 0; 47 | for (int i = 0; i < (int)m_features.size(); ++i) 48 | { 49 | int n = m_features[i]->GetCount(); 50 | m_featVec.segment(start, n) = m_features[i]->Eval(s); 51 | start += n; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Tracking/struck/MultiFeatures.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Struck: Structured Output Tracking with Kernels 3 | * 4 | * Code to accompany the paper: 5 | * Struck: Structured Output Tracking with Kernels 6 | * Sam Hare, Amir Saffari, Philip H. S. Torr 7 | * International Conference on Computer Vision (ICCV), 2011 8 | * 9 | * Copyright (C) 2011 Sam Hare, Oxford Brookes University, Oxford, UK 10 | * 11 | * This file is part of Struck. 12 | * 13 | * Struck is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | * 18 | * Struck is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with Struck. If not, see . 25 | * 26 | */ 27 | 28 | #ifndef MULTI_FEATURES_H 29 | #define MULTI_FEATURES_H 30 | 31 | #include "Features.h" 32 | 33 | #include 34 | 35 | class Config; 36 | 37 | class MultiFeatures : public Features 38 | { 39 | public: 40 | MultiFeatures(const std::vector& features); 41 | 42 | private: 43 | std::vector m_features; 44 | 45 | virtual void UpdateFeatureVector(const Sample& s); 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /Tracking/struck/RawFeatures.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Struck: Structured Output Tracking with Kernels 3 | * 4 | * Code to accompany the paper: 5 | * Struck: Structured Output Tracking with Kernels 6 | * Sam Hare, Amir Saffari, Philip H. S. Torr 7 | * International Conference on Computer Vision (ICCV), 2011 8 | * 9 | * Copyright (C) 2011 Sam Hare, Oxford Brookes University, Oxford, UK 10 | * 11 | * This file is part of Struck. 12 | * 13 | * Struck is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | * 18 | * Struck is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with Struck. If not, see . 25 | * 26 | */ 27 | 28 | #include "RawFeatures.h" 29 | #include "Config.h" 30 | #include "Sample.h" 31 | #include "StruckRect.h" 32 | 33 | #include 34 | 35 | using namespace Eigen; 36 | using namespace cv; 37 | 38 | static const int kPatchSize = 16; 39 | 40 | RawFeatures::RawFeatures(const Config& conf) : 41 | m_patchImage(kPatchSize, kPatchSize, CV_8UC1) 42 | { 43 | SetCount(kPatchSize*kPatchSize); 44 | } 45 | 46 | void RawFeatures::UpdateFeatureVector(const Sample& s) 47 | { 48 | IntStruckRect StruckRect = s.GetROI(); // note this truncates to integers 49 | cv::Rect roi(StruckRect.XMin(), StruckRect.YMin(), StruckRect.Width(), StruckRect.Height()); 50 | cv::resize(s.GetImage().GetImage(0)(roi), m_patchImage, m_patchImage.size()); 51 | //equalizeHist(m_patchImage, m_patchImage); 52 | 53 | int ind = 0; 54 | for (int i = 0; i < kPatchSize; ++i) 55 | { 56 | uchar* pixel = m_patchImage.ptr(i); 57 | for (int j = 0; j < kPatchSize; ++j, ++pixel, ++ind) 58 | { 59 | m_featVec[ind] = ((double)*pixel)/255; 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Tracking/struck/RawFeatures.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Struck: Structured Output Tracking with Kernels 3 | * 4 | * Code to accompany the paper: 5 | * Struck: Structured Output Tracking with Kernels 6 | * Sam Hare, Amir Saffari, Philip H. S. Torr 7 | * International Conference on Computer Vision (ICCV), 2011 8 | * 9 | * Copyright (C) 2011 Sam Hare, Oxford Brookes University, Oxford, UK 10 | * 11 | * This file is part of Struck. 12 | * 13 | * Struck is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | * 18 | * Struck is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with Struck. If not, see . 25 | * 26 | */ 27 | 28 | #ifndef RAW_FEATURES_H 29 | #define RAW_FEATURES_H 30 | 31 | #include "Features.h" 32 | 33 | #include 34 | #include 35 | 36 | 37 | class Config; 38 | 39 | class RawFeatures : public Features 40 | { 41 | public: 42 | RawFeatures(const Config& conf); 43 | 44 | private: 45 | cv::Mat m_patchImage; 46 | 47 | virtual void UpdateFeatureVector(const Sample& s); 48 | }; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /Tracking/struck/Sample.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Struck: Structured Output Tracking with Kernels 3 | * 4 | * Code to accompany the paper: 5 | * Struck: Structured Output Tracking with Kernels 6 | * Sam Hare, Amir Saffari, Philip H. S. Torr 7 | * International Conference on Computer Vision (ICCV), 2011 8 | * 9 | * Copyright (C) 2011 Sam Hare, Oxford Brookes University, Oxford, UK 10 | * 11 | * This file is part of Struck. 12 | * 13 | * Struck is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | * 18 | * Struck is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with Struck. If not, see . 25 | * 26 | */ 27 | 28 | #ifndef SAMPLE_H 29 | #define SAMPLE_H 30 | 31 | #include "ImageRep.h" 32 | #include "StruckRect.h" 33 | 34 | #include 35 | 36 | class Sample 37 | { 38 | public: 39 | Sample(const ImageRep& image, const FloatStruckRect& roi) : 40 | m_image(image), 41 | m_roi(roi) 42 | { 43 | } 44 | 45 | inline const ImageRep& GetImage() const { return m_image; } 46 | inline const FloatStruckRect& GetROI() const { return m_roi; } 47 | 48 | private: 49 | const ImageRep& m_image; 50 | FloatStruckRect m_roi; 51 | }; 52 | 53 | class MultiSample 54 | { 55 | public: 56 | MultiSample(const ImageRep& image, const std::vector& StruckRects) : 57 | m_image(image), 58 | m_StruckRects(StruckRects) 59 | { 60 | } 61 | 62 | inline const ImageRep& GetImage() const { return m_image; } 63 | inline const std::vector& GetStruckRects() const { return m_StruckRects; } 64 | inline Sample GetSample(int i) const { return Sample(m_image, m_StruckRects[i]); } 65 | 66 | private: 67 | const ImageRep& m_image; 68 | std::vector m_StruckRects; 69 | }; 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /Tracking/struck/Sampler.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Struck: Structured Output Tracking with Kernels 3 | * 4 | * Code to accompany the paper: 5 | * Struck: Structured Output Tracking with Kernels 6 | * Sam Hare, Amir Saffari, Philip H. S. Torr 7 | * International Conference on Computer Vision (ICCV), 2011 8 | * 9 | * Copyright (C) 2011 Sam Hare, Oxford Brookes University, Oxford, UK 10 | * 11 | * This file is part of Struck. 12 | * 13 | * Struck is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | * 18 | * Struck is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with Struck. If not, see . 25 | * 26 | */ 27 | 28 | #include "Sampler.h" 29 | #include "Config.h" 30 | 31 | #define _USE_MATH_DEFINES 32 | #include 33 | 34 | using namespace std; 35 | 36 | vector Sampler::RadialSamples(FloatStruckRect centre, int radius, int nr, int nt) 37 | { 38 | vector samples; 39 | 40 | FloatStruckRect s(centre); 41 | float rstep = (float)radius/nr; 42 | float tstep = 2*(float)M_PI/nt; 43 | samples.push_back(centre); 44 | 45 | for (int ir = 1; ir <= nr; ++ir) 46 | { 47 | float phase = (ir % 2)*tstep/2; 48 | for (int it = 0; it < nt; ++it) 49 | { 50 | float dx = ir*rstep*cosf(it*tstep+phase); 51 | float dy = ir*rstep*sinf(it*tstep+phase); 52 | s.SetXMin(centre.XMin()+dx); 53 | s.SetYMin(centre.YMin()+dy); 54 | samples.push_back(s); 55 | } 56 | } 57 | 58 | return samples; 59 | } 60 | 61 | vector Sampler::PixelSamples(FloatStruckRect centre, int radius, bool halfSample) 62 | { 63 | vector samples; 64 | 65 | IntStruckRect s(centre); 66 | samples.push_back(s); 67 | 68 | int r2 = radius*radius; 69 | for (int iy = -radius; iy <= radius; ++iy) 70 | { 71 | for (int ix = -radius; ix <= radius; ++ix) 72 | { 73 | if (ix*ix+iy*iy > r2) continue; 74 | if (iy == 0 && ix == 0) continue; // already put this one at the start 75 | 76 | int x = (int)centre.XMin() + ix; 77 | int y = (int)centre.YMin() + iy; 78 | if (halfSample && (ix % 2 != 0 || iy % 2 != 0)) continue; 79 | 80 | s.SetXMin(x); 81 | s.SetYMin(y); 82 | samples.push_back(s); 83 | } 84 | } 85 | 86 | return samples; 87 | } -------------------------------------------------------------------------------- /Tracking/struck/Sampler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Struck: Structured Output Tracking with Kernels 3 | * 4 | * Code to accompany the paper: 5 | * Struck: Structured Output Tracking with Kernels 6 | * Sam Hare, Amir Saffari, Philip H. S. Torr 7 | * International Conference on Computer Vision (ICCV), 2011 8 | * 9 | * Copyright (C) 2011 Sam Hare, Oxford Brookes University, Oxford, UK 10 | * 11 | * This file is part of Struck. 12 | * 13 | * Struck is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | * 18 | * Struck is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with Struck. If not, see . 25 | * 26 | */ 27 | 28 | #ifndef SAMPLER_H 29 | #define SAMPLER_H 30 | 31 | #include "StruckRect.h" 32 | 33 | #include 34 | 35 | class Config; 36 | 37 | class Sampler 38 | { 39 | public: 40 | static std::vector RadialSamples(FloatStruckRect centre, int radius, int nr, int nt); 41 | static std::vector PixelSamples(FloatStruckRect centre, int radius, bool halfSample = false); 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /Tracking/struck/StruckTracker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Struck: Structured Output Tracking with Kernels 3 | * 4 | * Code to accompany the paper: 5 | * Struck: Structured Output Tracking with Kernels 6 | * Sam Hare, Amir Saffari, Philip H. S. Torr 7 | * International Conference on Computer Vision (ICCV), 2011 8 | * 9 | * Copyright (C) 2011 Sam Hare, Oxford Brookes University, Oxford, UK 10 | * 11 | * This file is part of Struck. 12 | * 13 | * Struck is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | * 18 | * Struck is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with Struck. If not, see . 25 | * 26 | */ 27 | 28 | #ifndef STRUCK_TRACKER_H 29 | #define STRUCK_TRACKER_H 30 | 31 | #include "StruckRect.h" 32 | 33 | #include 34 | #include 35 | #include 36 | #include "Eigen/Core" 37 | 38 | class Config; 39 | class Features; 40 | class Kernel; 41 | class LaRank; 42 | class ImageRep; 43 | 44 | class StruckTracker 45 | { 46 | public: 47 | StruckTracker(const Config& conf); 48 | ~StruckTracker(); 49 | 50 | void Initialise(const cv::Mat& frame, FloatStruckRect bb); 51 | void Reset(); 52 | void Track(const cv::Mat& frame); 53 | void Debug(); 54 | 55 | inline const FloatStruckRect& GetBB() const { return m_bb; } 56 | inline bool IsInitialised() const { return m_initialised; } 57 | 58 | private: 59 | const Config& m_config; 60 | bool m_initialised; 61 | std::vector m_features; 62 | std::vector m_kernels; 63 | LaRank* m_pLearner; 64 | FloatStruckRect m_bb; 65 | cv::Mat m_debugImage; 66 | bool m_needsIntegralImage; 67 | bool m_needsIntegralHist; 68 | 69 | void UpdateLearner(const ImageRep& image); 70 | void UpdateDebugImage(const std::vector& samples, const FloatStruckRect& centre, const std::vector& scores); 71 | }; 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /Tracking/struck/config.txt: -------------------------------------------------------------------------------- 1 | # quiet mode disables all visual output (for experiments). 2 | quietMode = 0 3 | 4 | # debug mode enables additional drawing and visualization. 5 | debugMode = 0 6 | 7 | # base path for video sequences. 8 | #sequenceBasePath = sequences 9 | 10 | # path for output results file. 11 | # comment this out to disable output. 12 | #resultsPath = log.txt 13 | 14 | # video sequence to run the tracker on. 15 | # comment this out to use webcam. 16 | #sequenceName = girl 17 | 18 | # frame size for use during tracking. 19 | # the input image will be scaled to this size. 20 | frameWidth = 640 21 | frameHeight = 480 22 | 23 | # seed for random number generator. 24 | seed = 0 25 | 26 | # tracker search radius in pixels. 27 | searchRadius = 30 28 | 29 | # SVM regularization parameter. 30 | svmC = 100.0 31 | # SVM budget size (0 = no budget). 32 | svmBudgetSize = 100 33 | 34 | # image features to use. 35 | # format is: feature kernel [kernel-params] 36 | # where: 37 | # feature = haar/raw/histogram 38 | # kernel = gaussian/linear/intersection/chi2 39 | # for kernel=gaussian, kernel-params is sigma 40 | # multiple features can be specified and will be combined 41 | feature = haar gaussian 0.2 42 | #feature = raw gaussian 0.1 43 | #feature = histogram intersection 44 | -------------------------------------------------------------------------------- /TrackingTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.manmanlai.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /TrackingTests/TrackingTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // TrackingTests.m 3 | // TrackingTests 4 | // 5 | // Created by FloodSurge on 8/3/15. 6 | // Copyright (c) 2015 FloodSurge. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface TrackingTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation TrackingTests 17 | 18 | - (void)setUp { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /opencv2.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /opencv2.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/calib3d/calib3d.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 | // Copyright (C) 2013, OpenCV Foundation, 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 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/calib3d.hpp" 49 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/core/bufferpool.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | // 5 | // Copyright (C) 2014, Advanced Micro Devices, Inc., all rights reserved. 6 | 7 | #ifndef __OPENCV_CORE_BUFFER_POOL_HPP__ 8 | #define __OPENCV_CORE_BUFFER_POOL_HPP__ 9 | 10 | namespace cv 11 | { 12 | 13 | class BufferPoolController 14 | { 15 | protected: 16 | ~BufferPoolController() { } 17 | public: 18 | virtual size_t getReservedSize() const = 0; 19 | virtual size_t getMaxReservedSize() const = 0; 20 | virtual void setMaxReservedSize(size_t size) = 0; 21 | virtual void freeAllReservedBuffers() = 0; 22 | }; 23 | 24 | } 25 | 26 | #endif // __OPENCV_CORE_BUFFER_POOL_HPP__ 27 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/core/core.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 | // Copyright (C) 2013, OpenCV Foundation, 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 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/core.hpp" 49 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/core/ocl_genbase.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) 2013, OpenCV Foundation, 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 the copyright holders 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 OpenCV Foundation 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_OPENCL_GENBASE_HPP__ 43 | #define __OPENCV_OPENCL_GENBASE_HPP__ 44 | 45 | namespace cv 46 | { 47 | namespace ocl 48 | { 49 | 50 | struct ProgramEntry 51 | { 52 | const char* name; 53 | const char* programStr; 54 | const char* programHash; 55 | }; 56 | 57 | } 58 | } 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/features2d/features2d.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 | // Copyright (C) 2013, OpenCV Foundation, 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 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/features2d.hpp" 49 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/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 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/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 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/flann/flann.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 | // Copyright (C) 2013, OpenCV Foundation, 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 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/flann.hpp" 49 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/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 "opencv2/core.hpp" 35 | 36 | namespace cvflann 37 | { 38 | 39 | class FLANNException : public cv::Exception 40 | { 41 | public: 42 | FLANNException(const char* message) : cv::Exception(0, message, "", __FILE__, __LINE__) { } 43 | 44 | FLANNException(const cv::String& message) : cv::Exception(0, message, "", __FILE__, __LINE__) { } 45 | }; 46 | 47 | } 48 | 49 | 50 | #endif /* OPENCV_FLANN_GENERAL_H_ */ 51 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/flann/timer.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_TIMER_H 32 | #define OPENCV_FLANN_TIMER_H 33 | 34 | #include 35 | #include "opencv2/core.hpp" 36 | #include "opencv2/core/utility.hpp" 37 | 38 | namespace cvflann 39 | { 40 | 41 | /** 42 | * A start-stop timer class. 43 | * 44 | * Can be used to time portions of code. 45 | */ 46 | class StartStopTimer 47 | { 48 | int64 startTime; 49 | 50 | public: 51 | /** 52 | * Value of the timer. 53 | */ 54 | double value; 55 | 56 | 57 | /** 58 | * Constructor. 59 | */ 60 | StartStopTimer() 61 | { 62 | reset(); 63 | } 64 | 65 | /** 66 | * Starts the timer. 67 | */ 68 | void start() 69 | { 70 | startTime = cv::getTickCount(); 71 | } 72 | 73 | /** 74 | * Stops the timer and updates timer value. 75 | */ 76 | void stop() 77 | { 78 | int64 stopTime = cv::getTickCount(); 79 | value += ( (double)stopTime - startTime) / cv::getTickFrequency(); 80 | } 81 | 82 | /** 83 | * Resets the timer value to 0. 84 | */ 85 | void reset() 86 | { 87 | value = 0; 88 | } 89 | 90 | }; 91 | 92 | } 93 | 94 | #endif // FLANN_TIMER_H 95 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/highgui/highgui.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 | // Copyright (C) 2013, OpenCV Foundation, 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 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/highgui.hpp" 49 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/imgcodecs/imgcodecs.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 | // Copyright (C) 2013, OpenCV Foundation, 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 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/imgcodecs.hpp" 49 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/imgcodecs/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 | #import 45 | #import 46 | #import 47 | #import 48 | #include "opencv2/core/core.hpp" 49 | 50 | UIImage* MatToUIImage(const cv::Mat& image); 51 | void UIImageToMat(const UIImage* image, 52 | cv::Mat& m, bool alphaExist = false); 53 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/imgproc/imgproc.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 | // Copyright (C) 2013, OpenCV Foundation, 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 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/imgproc.hpp" 49 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/ml/ml.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 | // Copyright (C) 2013, OpenCV Foundation, 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 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/ml.hpp" 49 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/objdetect/objdetect.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 | // Copyright (C) 2013, OpenCV Foundation, 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 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/objdetect.hpp" 49 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/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.hpp" 47 | #include "opencv2/imgproc.hpp" 48 | #include "opencv2/photo.hpp" 49 | #include "opencv2/video.hpp" 50 | #include "opencv2/features2d.hpp" 51 | #include "opencv2/objdetect.hpp" 52 | #include "opencv2/calib3d.hpp" 53 | #include "opencv2/imgcodecs.hpp" 54 | #include "opencv2/videoio.hpp" 55 | #include "opencv2/highgui.hpp" 56 | #include "opencv2/ml.hpp" 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/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_CORE 11 | #define HAVE_OPENCV_FEATURES2D 12 | #define HAVE_OPENCV_FLANN 13 | #define HAVE_OPENCV_HIGHGUI 14 | #define HAVE_OPENCV_IMGCODECS 15 | #define HAVE_OPENCV_IMGPROC 16 | #define HAVE_OPENCV_ML 17 | #define HAVE_OPENCV_OBJDETECT 18 | #define HAVE_OPENCV_PHOTO 19 | #define HAVE_OPENCV_SHAPE 20 | #define HAVE_OPENCV_STITCHING 21 | #define HAVE_OPENCV_VIDEO 22 | #define HAVE_OPENCV_VIDEOIO 23 | #define HAVE_OPENCV_VIDEOSTAB 24 | #define HAVE_OPENCV_WORLD 25 | 26 | 27 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/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) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, 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 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/photo.hpp" 49 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/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 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/shape.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_SHAPE_HPP__ 44 | #define __OPENCV_SHAPE_HPP__ 45 | 46 | #include "opencv2/shape/emdL1.hpp" 47 | #include "opencv2/shape/shape_transformer.hpp" 48 | #include "opencv2/shape/hist_cost.hpp" 49 | #include "opencv2/shape/shape_distance.hpp" 50 | 51 | namespace cv 52 | { 53 | CV_EXPORTS bool initModule_shape(); 54 | } 55 | 56 | #endif 57 | 58 | /* End of file. */ 59 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/shape/emdL1.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_EMD_L1_HPP__ 44 | #define __OPENCV_EMD_L1_HPP__ 45 | 46 | #include "opencv2/core.hpp" 47 | 48 | namespace cv 49 | { 50 | /****************************************************************************************\ 51 | * EMDL1 Function * 52 | \****************************************************************************************/ 53 | 54 | CV_EXPORTS float EMDL1(InputArray signature1, InputArray signature2); 55 | 56 | }//namespace cv 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/shape/shape.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 | // Copyright (C) 2013, OpenCV Foundation, 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 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/shape.hpp" 49 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/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 | // Copyright (C) 2013, OpenCV Foundation, 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 | #ifndef __OPENCV_VIDEO_HPP__ 45 | #define __OPENCV_VIDEO_HPP__ 46 | 47 | #include "opencv2/video/tracking.hpp" 48 | #include "opencv2/video/background_segm.hpp" 49 | 50 | namespace cv 51 | { 52 | CV_EXPORTS bool initModule_video(void); 53 | } 54 | 55 | #endif //__OPENCV_VIDEO_HPP__ 56 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/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 | // Copyright (C) 2013, OpenCV Foundation, 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 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/video.hpp" 49 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/videoio/videoio.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 | // Copyright (C) 2013, OpenCV Foundation, 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 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/videoio.hpp" 49 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/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 | // REFERENCES 44 | // 1. "Full-Frame Video Stabilization with Motion Inpainting" 45 | // Yasuyuki Matsushita, Eyal Ofek, Weina Ge, Xiaoou Tang, Senior Member, and Heung-Yeung Shum 46 | // 2. "Auto-Directed Video Stabilization with Robust L1 Optimal Camera Paths" 47 | // Matthias Grundmann, Vivek Kwatra, Irfan Essa 48 | 49 | #ifndef __OPENCV_VIDEOSTAB_HPP__ 50 | #define __OPENCV_VIDEOSTAB_HPP__ 51 | 52 | #include "opencv2/videostab/stabilizer.hpp" 53 | #include "opencv2/videostab/ring_buffer.hpp" 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/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.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 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/videostab/ring_buffer.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_RING_BUFFER_HPP__ 44 | #define __OPENCV_VIDEOSTAB_RING_BUFFER_HPP__ 45 | 46 | #include 47 | #include "opencv2/imgproc.hpp" 48 | 49 | namespace cv 50 | { 51 | namespace videostab 52 | { 53 | 54 | template inline T& at(int idx, std::vector &items) 55 | { 56 | return items[cv::borderInterpolate(idx, static_cast(items.size()), cv::BORDER_WRAP)]; 57 | } 58 | 59 | template inline const T& at(int idx, const std::vector &items) 60 | { 61 | return items[cv::borderInterpolate(idx, static_cast(items.size()), cv::BORDER_WRAP)]; 62 | } 63 | 64 | } // namespace videostab 65 | } // namespace cv 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/world.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_WORLD_HPP__ 44 | #define __OPENCV_WORLD_HPP__ 45 | 46 | #include "opencv2/core.hpp" 47 | 48 | #ifdef __cplusplus 49 | namespace cv 50 | { 51 | 52 | CV_EXPORTS_W bool initAll(); 53 | 54 | } 55 | 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleName 6 | OpenCV 7 | CFBundleIdentifier 8 | org.opencv 9 | CFBundleVersion 10 | 3.0.0 11 | CFBundleShortVersionString 12 | 3.0.0 13 | CFBundleSignature 14 | ???? 15 | CFBundlePackageType 16 | FMWK 17 | 18 | 19 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/opencv2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/floodsung/Tracking-on-iOS/e87e420a8a24ee5ea47b1af930742e9c97dacc7b/opencv2.framework/Versions/A/opencv2 -------------------------------------------------------------------------------- /opencv2.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /opencv2.framework/opencv2: -------------------------------------------------------------------------------- 1 | Versions/Current/opencv2 --------------------------------------------------------------------------------