├── .gitignore ├── .idea ├── .gitignore ├── .name ├── CVFunhouse2019.iml ├── misc.xml ├── modules.xml ├── vcs.xml └── xcode.xml ├── Assets ├── CVFunhouse Big Icon.png ├── CVFunhouse Big Icon.psd ├── Descriptions.pages ├── SwitchCameraIcon.psd └── iButton.psd ├── CREDITS.txt ├── CVFCannyDemo.html ├── CVFFaceDetect.html ├── CVFFarneback.html ├── CVFLaplace.html ├── CVFLucasKanade.html ├── CVFMotionTemplates.html ├── CVFPassThru.html ├── CVFunhouse.xcodeproj ├── project.pbxproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ ├── CVFunhouse.xccheckout │ └── IDEWorkspaceChecks.plist ├── CVFunhouse ├── CVFAppDelegate.h ├── CVFAppDelegate.m ├── CVFCannyDemo.h ├── CVFCannyDemo.m ├── CVFFaceDetect.h ├── CVFFaceDetect.mm ├── CVFFarneback.h ├── CVFFarneback.m ├── CVFFlipsideViewController.h ├── CVFFlipsideViewController.m ├── CVFHough.h ├── CVFHough.mm ├── CVFImageProcessor.h ├── CVFImageProcessor.mm ├── CVFImageProcessorDelegate.h ├── CVFLaplace.h ├── CVFLaplace.mm ├── CVFLucasKanade.h ├── CVFLucasKanade.mm ├── CVFMainViewController.h ├── CVFMainViewController.m ├── CVFMotionTemplates.h ├── CVFMotionTemplates.m ├── CVFPassThru.h ├── CVFPassThru.m ├── CVFSephiaDemo.h ├── CVFSephiaDemo.m ├── CVFunhouse-Info.plist ├── CVFunhouse-Prefix.pch ├── en.lproj │ ├── InfoPlist.strings │ ├── MainStoryboard_iPad.storyboard │ └── MainStoryboard_iPhone.storyboard └── main.m ├── CVFunhouse114.png ├── CVFunhouse144.png ├── CVFunhouse57.png ├── CVFunhouse72.png ├── CloseButton.png ├── Default-568h@2x.png ├── Demos.plist ├── LICENSE.txt ├── Launch Screen.storyboard ├── NoDescription.html ├── OpenCV license.txt ├── README.md ├── Settings.bundle ├── Root.plist └── en.lproj │ └── Root.strings ├── SwitchCameraIcon44.png ├── SwitchCameraIcon44@2x.png ├── TODO.rtf ├── haarcascade_frontalface_alt.xml ├── iButton30.png ├── iButton30@2x.png └── opencv2.framework ├── Headers ├── Resources ├── Versions ├── A │ ├── Headers │ │ ├── calib3d │ │ │ └── calib3d.hpp │ │ ├── contrib │ │ │ ├── contrib.hpp │ │ │ ├── detection_based_tracker.hpp │ │ │ ├── hybridtracker.hpp │ │ │ ├── openfabmap.hpp │ │ │ └── retina.hpp │ │ ├── core │ │ │ ├── core.hpp │ │ │ ├── core_c.h │ │ │ ├── cuda_devptrs.hpp │ │ │ ├── devmem2d.hpp │ │ │ ├── eigen.hpp │ │ │ ├── gpumat.hpp │ │ │ ├── internal.hpp │ │ │ ├── mat.hpp │ │ │ ├── opengl_interop.hpp │ │ │ ├── opengl_interop_deprecated.hpp │ │ │ ├── operations.hpp │ │ │ ├── types_c.h │ │ │ ├── version.hpp │ │ │ └── wimage.hpp │ │ ├── features2d │ │ │ └── features2d.hpp │ │ ├── flann │ │ │ ├── all_indices.h │ │ │ ├── allocator.h │ │ │ ├── any.h │ │ │ ├── autotuned_index.h │ │ │ ├── composite_index.h │ │ │ ├── config.h │ │ │ ├── defines.h │ │ │ ├── dist.h │ │ │ ├── dummy.h │ │ │ ├── dynamic_bitset.h │ │ │ ├── flann.hpp │ │ │ ├── flann_base.hpp │ │ │ ├── general.h │ │ │ ├── ground_truth.h │ │ │ ├── hdf5.h │ │ │ ├── heap.h │ │ │ ├── hierarchical_clustering_index.h │ │ │ ├── index_testing.h │ │ │ ├── kdtree_index.h │ │ │ ├── kdtree_single_index.h │ │ │ ├── kmeans_index.h │ │ │ ├── linear_index.h │ │ │ ├── logger.h │ │ │ ├── lsh_index.h │ │ │ ├── lsh_table.h │ │ │ ├── matrix.h │ │ │ ├── miniflann.hpp │ │ │ ├── nn_index.h │ │ │ ├── object_factory.h │ │ │ ├── params.h │ │ │ ├── random.h │ │ │ ├── result_set.h │ │ │ ├── sampling.h │ │ │ ├── saving.h │ │ │ ├── simplex_downhill.h │ │ │ └── timer.h │ │ ├── highgui │ │ │ ├── cap_ios.h │ │ │ ├── highgui.hpp │ │ │ ├── highgui_c.h │ │ │ └── ios.h │ │ ├── imgproc │ │ │ ├── imgproc.hpp │ │ │ ├── imgproc_c.h │ │ │ └── types_c.h │ │ ├── legacy │ │ │ ├── blobtrack.hpp │ │ │ ├── compat.hpp │ │ │ ├── legacy.hpp │ │ │ └── streams.hpp │ │ ├── ml │ │ │ └── ml.hpp │ │ ├── nonfree │ │ │ ├── features2d.hpp │ │ │ ├── gpu.hpp │ │ │ ├── nonfree.hpp │ │ │ └── ocl.hpp │ │ ├── objdetect │ │ │ └── objdetect.hpp │ │ ├── opencv.hpp │ │ ├── opencv_modules.hpp │ │ ├── photo │ │ │ ├── photo.hpp │ │ │ └── photo_c.h │ │ ├── stitching │ │ │ ├── detail │ │ │ │ ├── autocalib.hpp │ │ │ │ ├── blenders.hpp │ │ │ │ ├── camera.hpp │ │ │ │ ├── exposure_compensate.hpp │ │ │ │ ├── matchers.hpp │ │ │ │ ├── motion_estimators.hpp │ │ │ │ ├── seam_finders.hpp │ │ │ │ ├── util.hpp │ │ │ │ ├── util_inl.hpp │ │ │ │ ├── warpers.hpp │ │ │ │ └── warpers_inl.hpp │ │ │ ├── stitcher.hpp │ │ │ └── warpers.hpp │ │ ├── video │ │ │ ├── background_segm.hpp │ │ │ ├── tracking.hpp │ │ │ └── video.hpp │ │ ├── videostab │ │ │ ├── deblurring.hpp │ │ │ ├── fast_marching.hpp │ │ │ ├── fast_marching_inl.hpp │ │ │ ├── frame_source.hpp │ │ │ ├── global_motion.hpp │ │ │ ├── inpainting.hpp │ │ │ ├── log.hpp │ │ │ ├── motion_stabilizing.hpp │ │ │ ├── optical_flow.hpp │ │ │ ├── stabilizer.hpp │ │ │ └── videostab.hpp │ │ └── world │ │ │ └── world.hpp │ ├── Resources │ │ └── Info.plist │ └── opencv2 └── Current └── opencv2 /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | xcuserdata 3 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /workspace.xml -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | CVFunhouse -------------------------------------------------------------------------------- /.idea/CVFunhouse2019.iml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/xcode.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Assets/CVFunhouse Big Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeradesign/CVFunhouse/9b676ea969c255782386eedbe5c307c8d14bd14b/Assets/CVFunhouse Big Icon.png -------------------------------------------------------------------------------- /Assets/CVFunhouse Big Icon.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeradesign/CVFunhouse/9b676ea969c255782386eedbe5c307c8d14bd14b/Assets/CVFunhouse Big Icon.psd -------------------------------------------------------------------------------- /Assets/Descriptions.pages: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeradesign/CVFunhouse/9b676ea969c255782386eedbe5c307c8d14bd14b/Assets/Descriptions.pages -------------------------------------------------------------------------------- /Assets/SwitchCameraIcon.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeradesign/CVFunhouse/9b676ea969c255782386eedbe5c307c8d14bd14b/Assets/SwitchCameraIcon.psd -------------------------------------------------------------------------------- /Assets/iButton.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeradesign/CVFunhouse/9b676ea969c255782386eedbe5c307c8d14bd14b/Assets/iButton.psd -------------------------------------------------------------------------------- /CREDITS.txt: -------------------------------------------------------------------------------- 1 | Icon: Switch Camera Front/Rear by Simon Strandgaard 2 | http://www.flickr.com/photos/12739382@N04/5463151636/ -------------------------------------------------------------------------------- /CVFCannyDemo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Untitled Document 6 | 7 | 8 | 9 |

Canny Edge Detector

10 |

What You’re Seeing:
11 |
The edge detector searches for edges between regions of different brightness in the image. It draws a black line for each edge it finds.

12 |

How It Works:
13 |
Edge detectors treat changes in brightness between adjacent pixels in an image beyond a certain threshold as edges. The Canny Edge Detector is more sophisticated in that it uses two thresholds. If a pixel is not adjacent to an existing edge, it uses a higher threshold; if a pixel is adjacent to an existing edge, it uses a lower threshold. The high threshold keeps down the number of excess edges to a minimum, while the lower threshold continues existing edges, even if they get slightly fuzzy.

14 |

What It’s Used For:
15 |
Edge detection is often the first step in object segmentation, that is, breaking up an image into segments that represent different objects in the image.

16 |

Try and Notice:
17 |
Experiment with objects different levels of contrast. What’s the minimum difference in brightness needed between to areas to find an edge?
18 | Just for for fun, Play A-Ha’s song “Take on Me” in the background while this demo runs, and pretend you’re in the music video for the song.

19 |

Learn More:
20 |
Canny edge detector on Wikipedia

21 | 22 | 23 | -------------------------------------------------------------------------------- /CVFFaceDetect.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Untitled Document 6 | 7 | 8 | 9 |

Face Detector

10 |

What You’re Seeing:
11 | This face detector draws a red circle around any faces it detects. (There’s a size threshold, so distant faces won’t be recognized.)

12 |

How It Works:
13 | This face detector uses a technique called a cascade classifier to detect faces. The classifier scans across then entire image looking for haar-like features that match those of faces in its training database. It’s called a ‘cascade’ because each candidate region is run through a cascade of different detectors, any of which can reject it. A region is only marked as a facepasses if it passes all of the detectors.

14 |

What It’s Used For:
15 | Face detection is widely used in from everything to digital cameras to security applications to digital photo albums.

16 |

Try and Notice:
17 |
Turn your head to either side, or tilt it slightly. Note that the face detector no longer recognizes your face. That’s because this face detector was only trained on full-face images. Other, more sophisticated face recognizers can recognize faces from a wider range of angles.

18 |

Learn More:
19 |
Cascading classifiers on Wikipedia
20 | Haar-like features on Wikipedia
21 |
22 | Credit:
23 |
Based on the OpenCV face detector example.

24 | 25 | 26 | -------------------------------------------------------------------------------- /CVFFarneback.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Untitled Document 6 | 7 | 8 | 9 |

Farnebäck Flow

10 |

What You’re Seeing:
11 | This demo shows an example of a dense optical flow. It uses the Farnebäck’s algorithm to estimate the motion of every pixel in the image from frame to frame. Although motion is computed for every pixel, it’s only displayed every 16 pixels, both horizontally and vertically.

12 |

How It Works:
13 | Farnebäck’s algorithm estimates the motion for subregions on several different scales. Then on a pixel level, it estimates the pixel’s motion within the region by attempting to minimize the value of a set of simultaneous equations.

14 |

What It’s Used For:
15 | Optical flow is an important part of digital video compression. Video compressors can store much less data by indicating that subsequent frames of video can be produced by simply moving around regions from the preceding frame.

16 |

Try and Notice:
17 | Move your hand or head around and watch the image the lines track the motion. Also notice how slowly the screen updates. Computing motion for every pixel on the screen is lots of work! See the Lucas-Kanade demo for another, faster approach to tracking the flow of motion.

18 |

Learn More:
19 | Optical flow on Wikipedia

20 |

Credit:
21 | Based on the OpenCV Farnebäck example.

22 | 23 | 24 | -------------------------------------------------------------------------------- /CVFLaplace.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Untitled Document 6 | 7 | 8 | 9 |

Laplace

10 |

What You’re Seeing:
11 | This demo takes the Laplace operator (also known as the Laplacian) on each point for the primary colors red, green and blue. The Laplacian is defined as the sum of the second derivative in the x and y directions.

12 |

How It Works:
13 | In OpenCV, the Laplacian function uses the Sobel operator to produce the second derivatives with respect to x and y, and then adds them together.

14 |

What It’s Used For:
15 |
The Laplace operator performs a simple form of edge detection. Edges appear as black lines surrounded by white areas.

16 |

Try and Notice:
17 | Point the camera at an object of a solid color. Note how the center of the object appears black, while the edges are the color of the the object.

18 |

Learn More:
19 | Laplace operator on Wikipedia

20 |

Credit:
21 | Based on the OpenCV Laplace example.

22 | 23 | 24 | -------------------------------------------------------------------------------- /CVFLucasKanade.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Untitled Document 6 | 7 | 8 | 9 |

Lucas-Kanade Flow

10 |

Note:
11 | If you move too rapidly, or point the camera at a different scene, the green dots may get lost. If this happens, you can restart the demo by tapping the ibutton and choosing “Lucas-Kanade” from the demo list again.

12 |

What You’re Seeing:
13 | This is an example of sparse optical flow. Unlike the Farnebäck flow, which tries to estimate flow for every pixel in the image, Lucas-Kanade looks at the initial frame of video for features -- locations that it can track easily. Then for each subsequent frame, it tracks those same features as they move around. Each feature is marked by a green dot.

14 |

How it Works:
15 | The Lucas-Kanade starts by looking for “corners” — places where an image changes both vertically and horizontally. Then it tracks those corners from frame to frame by searching nearby regions of the image. (It assumes that objects don’t move too much between frames.)

16 |

Try and Notice:
17 | With the camera pointing at yourself, reset the Lucas-Kanade demo and then move your arm across your face. You should be able to “wipe” most of the green dots off your face. This is because Lucas-Kanade always updates point positions to the closest matching nearby location it can find. Usually this will be the same point on the same object. When you cover up part of the image with your arm, the closest matching nearby point is usually somewhere along your arm, so the points start following your arm. Even when you face is visible again, the points have moved, and so don’t find their original location because it’s too far from their new location.

18 |

Learn More:
19 | Lucas–Kanade method on Wikipedia

20 |

Credit:
21 | Based on the OpenCV Lucas-Kanade example.

22 | 23 | 24 | -------------------------------------------------------------------------------- /CVFMotionTemplates.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Untitled Document 6 | 7 | 8 | 9 |

Motion Templates

10 |

What You’re Seeing:
11 | Things that have moved lately appear in red, and gradually fade to black once they stop moving. (Moving the camera will also produce this effect for everything in the scene. Try to hold the device steady, or better yet, put it in a stand.) Regions of the image that moved have a blue circle with a line that shows the direction of motion.

12 |

How It Works:
13 | Each time the camera generates a new frame, that image is subtracted from the image of the previous frame. Any place the two images differ is treated as motion. The motion is then stored in a motion history image, which tracks recent areas where motion occurred. The motion template code looks a the motion history image, and uses it to compute gradients of motion for each area of motion. Those are then visualized as blue circles. The motion template image itself is visualized in red.

14 |

What it’s Used For:
15 | Motion templates are used in security applications. For example, a security camera might be set up to motion detect motion and flag anything the camera saw that moved for a person to examine.

16 |

Try and Notice:
17 | Hold very still and eventually you’ll disappear from the image. Just like the T. Rex in Jurassic Park, this demo only senses motion. You can also try moving one hand down and the other hand up, and see that each one is tracked by a blue circle with a line indicating the direction of motion.

18 |

Learn More:
19 | Motion analysis on Wikipedia

20 |

Credit:
21 | Based on the OpenCV motion template example.

22 | 23 | 24 | -------------------------------------------------------------------------------- /CVFPassThru.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Untitled Document 6 | 7 | 8 | 9 |

Pass Thru

10 |

What You’re Seeing:
11 | You’re seeing exactly what the camera does. This demo simply takes what the camera sees and displays it on the screen. It’s not a very impressive demo visually. But you can modify the code for it to create computer vision demos of your own.

12 |

How it Works:
13 | Every demo in this app was written using the OpenCV computer vision library and the CVFunhouse framework. The framework takes images from the camera, passes them to an object that transforms the image using the OpenCV library, and then returns the transformed image to display.
14 | Note that 15 | even doing “nothing” requires some work. The camera produces an image in BGRA (storing the blue, green, red, and alpha components of each pixel in that order). The screen wants the pixels in RGB (red, green, blue) order, so the code has to convert the image in order to do nothing.

16 |

What it’s Used For:
17 | It’s used by people just like you to create their own computer vision demonstrations.

18 |

Try and Notice:
19 | Check out the code from http://github.com/jeradesign/CVFunhouse and start building computer vision demos of your own. As a simple starter, in file CVPassThru.m, change the body of method processIplImage: with the single line:

20 |

[self imageReady:iplImage];

21 |

Note that red and blue are reversed in the image. Everywhere in the image that was red shows up as blue, and vice-versa.

22 |

Learn More:
23 | The OpenCV project website. Complete documentation and tutorials for the OpenCV library.

24 | 25 | 26 | -------------------------------------------------------------------------------- /CVFunhouse.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CVFunhouse.xcodeproj/project.xcworkspace/xcshareddata/CVFunhouse.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 2696B4BA-739B-40BD-AF7E-C4BD66930223 9 | IDESourceControlProjectName 10 | CVFunhouse 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 158EF702276F66A9237FA7AD7161917397DDDAD8 14 | github.com:jeradesign/CVFunhouse.git 15 | 16 | IDESourceControlProjectPath 17 | CVFunhouse.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 158EF702276F66A9237FA7AD7161917397DDDAD8 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | github.com:jeradesign/CVFunhouse.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 158EF702276F66A9237FA7AD7161917397DDDAD8 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 158EF702276F66A9237FA7AD7161917397DDDAD8 36 | IDESourceControlWCCName 37 | CVFunhouse 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /CVFunhouse.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /CVFunhouse/CVFAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // CVFAppDelegate.h 3 | // CVFunhouse 4 | // 5 | // Created by John Brewer on 3/7/12. 6 | // Copyright (c) 2012 Jera Design LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CVFAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /CVFunhouse/CVFAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // CVFAppDelegate.m 3 | // CVFunhouse 4 | // 5 | // Created by John Brewer on 3/7/12. 6 | // Copyright (c) 2012 Jera Design LLC. All rights reserved. 7 | // 8 | 9 | #import "CVFAppDelegate.h" 10 | 11 | @implementation CVFAppDelegate 12 | 13 | @synthesize window = _window; 14 | 15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 16 | { 17 | #pragma unused(application) 18 | #pragma unused(launchOptions) 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application 24 | { 25 | #pragma unused(application) 26 | // 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. 27 | // 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. 28 | } 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application 31 | { 32 | #pragma unused(application) 33 | // 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. 34 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 35 | } 36 | 37 | - (void)applicationWillEnterForeground:(UIApplication *)application 38 | { 39 | #pragma unused(application) 40 | // 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. 41 | } 42 | 43 | - (void)applicationDidBecomeActive:(UIApplication *)application 44 | { 45 | #pragma unused(application) 46 | // 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. 47 | } 48 | 49 | - (void)applicationWillTerminate:(UIApplication *)application 50 | { 51 | #pragma unused(application) 52 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /CVFunhouse/CVFCannyDemo.h: -------------------------------------------------------------------------------- 1 | // 2 | // CVFCannyDemo.h 3 | // CVFunhouse 4 | // 5 | // Created by John Brewer on 7/21/12. 6 | // Copyright (c) 2012 Jera Design LLC. All rights reserved. 7 | // 8 | 9 | #import "CVFImageProcessor.h" 10 | 11 | @interface CVFCannyDemo : CVFImageProcessor 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /CVFunhouse/CVFCannyDemo.m: -------------------------------------------------------------------------------- 1 | // 2 | // CVFCannyDemo.m 3 | // CVFunhouse 4 | // 5 | // Created by John Brewer on 7/21/12. 6 | // Copyright (c) 2012 Jera Design LLC. All rights reserved. 7 | // 8 | 9 | #import "CVFCannyDemo.h" 10 | #include "opencv2/core/core_c.h" 11 | #include "opencv2/imgproc/imgproc_c.h" 12 | 13 | @implementation CVFCannyDemo 14 | /* Override this method do your image processing. */ 15 | /* You are responsible for releasing ipImage. */ 16 | /* Return your IplImage by calling imageReady: */ 17 | /* The IplImage you pass back will be disposed of for you. */ 18 | -(void)processIplImage:(IplImage*)iplImage 19 | { 20 | IplImage *grayImage = cvCreateImage(cvGetSize(iplImage), IPL_DEPTH_8U, 1); 21 | cvCvtColor(iplImage, grayImage, CV_BGRA2GRAY); 22 | cvReleaseImage(&iplImage); 23 | 24 | IplImage* img_blur = cvCreateImage( cvGetSize( grayImage ), grayImage->depth, 1); 25 | cvSmooth(grayImage, img_blur, CV_BLUR, 3, 0, 0, 0); 26 | cvReleaseImage(&grayImage); 27 | 28 | IplImage* img_canny = cvCreateImage( cvGetSize( img_blur ), img_blur->depth, 1); 29 | cvCanny( img_blur, img_canny, 10, 100, 3 ); 30 | cvReleaseImage(&img_blur); 31 | 32 | cvNot(img_canny, img_canny); 33 | 34 | [self imageReady:img_canny]; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /CVFunhouse/CVFFaceDetect.h: -------------------------------------------------------------------------------- 1 | // 2 | // CVFFaceDetect.h 3 | // CVFunhouse 4 | // 5 | // Created by John Brewer on 7/24/12. 6 | // Copyright (c) 2012 Jera Design LLC. All rights reserved. 7 | // 8 | 9 | #import "CVFImageProcessor.h" 10 | 11 | @interface CVFFaceDetect : CVFImageProcessor 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /CVFunhouse/CVFFaceDetect.mm: -------------------------------------------------------------------------------- 1 | // 2 | // CVFFaceDetect.m 3 | // CVFunhouse 4 | // 5 | // Created by John Brewer on 7/22/12. 6 | // Copyright (c) 2012 Jera Design LLC. All rights reserved. 7 | // 8 | 9 | // Based on the OpenCV example: /samples/c/facedetect.cpp 10 | 11 | #import "CVFFaceDetect.h" 12 | 13 | #include "opencv2/objdetect/objdetect.hpp" 14 | #include "opencv2/imgproc/imgproc.hpp" 15 | 16 | using namespace std; 17 | using namespace cv; 18 | 19 | CascadeClassifier cascade; 20 | double scale = 1; 21 | 22 | @interface CVFFaceDetect() { 23 | bool _inited; 24 | } 25 | 26 | @end 27 | 28 | @implementation CVFFaceDetect 29 | 30 | -(void)processMat:(cv::Mat)mat 31 | { 32 | if (!_inited) { 33 | NSString* haarDataPath = 34 | [[NSBundle mainBundle] pathForResource:@"haarcascade_frontalface_alt.xml" ofType:nil]; 35 | 36 | cascade.load([haarDataPath UTF8String]); 37 | _inited = true; 38 | } 39 | 40 | cvtColor(mat, mat, CV_BGR2RGB); 41 | 42 | int i = 0; 43 | vector faces; 44 | const static Scalar colors[] = { CV_RGB(0,0,255), 45 | CV_RGB(0,128,255), 46 | CV_RGB(0,255,255), 47 | CV_RGB(0,255,0), 48 | CV_RGB(255,128,0), 49 | CV_RGB(255,255,0), 50 | CV_RGB(255,0,0), 51 | CV_RGB(255,0,255)} ; 52 | Mat gray, smallImg( cvRound (mat.rows/scale), cvRound(mat.cols/scale), CV_8UC1 ); 53 | 54 | cvtColor( mat, gray, CV_RGB2GRAY ); 55 | resize( gray, smallImg, smallImg.size(), 0, 0, INTER_LINEAR ); 56 | equalizeHist( smallImg, smallImg ); 57 | 58 | cascade.detectMultiScale( smallImg, faces, 59 | 1.2, 2, 0 60 | //|CV_HAAR_FIND_BIGGEST_OBJECT 61 | //|CV_HAAR_DO_ROUGH_SEARCH 62 | |CV_HAAR_SCALE_IMAGE 63 | , 64 | cv::Size(75, 75) ); 65 | for( vector::const_iterator r = faces.begin(); r != faces.end(); r++, i++ ) 66 | { 67 | Mat smallImgROI; 68 | vector nestedObjects; 69 | cv::Point center; 70 | Scalar color = colors[i%8]; 71 | int radius; 72 | center.x = cvRound((r->x + r->width*0.5)*scale); 73 | center.y = cvRound((r->y + r->height*0.5)*scale); 74 | radius = cvRound((r->width + r->height)*0.25*scale); 75 | circle( mat, center, radius, color, 3, 8, 0 ); 76 | } 77 | 78 | [self matReady:mat]; 79 | } 80 | 81 | @end 82 | -------------------------------------------------------------------------------- /CVFunhouse/CVFFarneback.h: -------------------------------------------------------------------------------- 1 | // 2 | // CVFFarneback.h 3 | // CVFunhouse 4 | // 5 | // Created by John Brewer on 7/24/12. 6 | // Copyright (c) 2012 Jera Design LLC. All rights reserved. 7 | // 8 | 9 | #import "CVFImageProcessor.h" 10 | 11 | @interface CVFFarneback : CVFImageProcessor 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /CVFunhouse/CVFFarneback.m: -------------------------------------------------------------------------------- 1 | // 2 | // CVFFarneback.m 3 | // CVFunhouse 4 | // 5 | // Created by John Brewer on 7/22/12. 6 | // Copyright (c) 2012 Jera Design LLC. All rights reserved. 7 | // 8 | 9 | // Based on the OpenCV example: /samples/c/fback_c.c 10 | 11 | #import "CVFFarneback.h" 12 | 13 | #include "opencv2/video/tracking.hpp" 14 | #include "opencv2/imgproc/imgproc_c.h" 15 | 16 | static void drawOptFlowMap(const CvMat* flow, CvMat* cflowmap, int step, 17 | double scale, CvScalar color) 18 | { 19 | int x, y; 20 | (void)scale; 21 | for( y = 0; y < cflowmap->rows; y += step) 22 | for( x = 0; x < cflowmap->cols; x += step) 23 | { 24 | CvPoint2D32f fxy = CV_MAT_ELEM(*flow, CvPoint2D32f, y, x); 25 | cvLine(cflowmap, cvPoint(x,y), cvPoint(cvRound(x+fxy.x), cvRound(y+fxy.y)), 26 | color, 1, 8, 0); 27 | cvCircle(cflowmap, cvPoint(x,y), 2, color, -1, 8, 0); 28 | } 29 | } 30 | 31 | @interface CVFFarneback () { 32 | CvMat *prevgray; 33 | CvMat *gray; 34 | CvMat *flow; 35 | CvMat *cflow; 36 | } 37 | 38 | @end 39 | 40 | @implementation CVFFarneback 41 | 42 | /* 43 | * processIplImage 44 | * 45 | * Inputs: 46 | * iplImage: an IplImage in BGRA format, 8 bits per pixel. 47 | * YOU ARE RESPONSIBLE FOR CALLING cvReleaseImage on this image. 48 | * 49 | * Outputs: 50 | * When you are done, call imageReady: with an RGB, RGBA, or grayscale 51 | * IplImage with 8-bits per pixel. 52 | * 53 | * You can call imageReady: from any thread and it will do the right thing. 54 | * You can fork as many threads to process the image as you like; just call 55 | * imageReady when you are done. 56 | * 57 | * imageReady: will dispose of the IplImage you pass it once the system is 58 | * done with it. 59 | */ 60 | -(void)processIplImage:(IplImage*)frame 61 | { 62 | int firstFrame = (gray == 0); 63 | if(!gray) 64 | { 65 | gray = cvCreateMat(frame->height, frame->width, CV_8UC1); 66 | prevgray = cvCreateMat(gray->rows, gray->cols, gray->type); 67 | flow = cvCreateMat(gray->rows, gray->cols, CV_32FC2); 68 | cflow = cvCreateMat(gray->rows, gray->cols, CV_8UC3); 69 | } 70 | cvCvtColor(frame, gray, CV_BGR2GRAY); 71 | cvReleaseImage(&frame); 72 | 73 | cvCvtColor(gray, cflow, CV_GRAY2BGR); 74 | 75 | if( !firstFrame ) 76 | { 77 | cvCalcOpticalFlowFarneback(prevgray, gray, flow, 0.5, 3, 15, 3, 5, 1.2, 0); 78 | drawOptFlowMap(flow, cflow, 16, 1.5, CV_RGB(0, 255, 0)); 79 | } 80 | 81 | cvCopy(gray, prevgray, nil); 82 | 83 | // Call imageReady with your new image. 84 | IplImage *tempImage = cvAlloc(sizeof(IplImage)); 85 | IplImage *outImage = cvGetImage(cflow, tempImage); 86 | [self imageReady: outImage]; 87 | } 88 | 89 | @end 90 | -------------------------------------------------------------------------------- /CVFunhouse/CVFFlipsideViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CVFFlipsideViewController.h 3 | // CVFunhouse 4 | // 5 | // Created by John Brewer on 3/7/12. 6 | // Copyright (c) 2012 Jera Design LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class CVFFlipsideViewController; 12 | 13 | @protocol CVFFlipsideViewControllerDelegate 14 | - (void)flipsideViewControllerDidFinish:(CVFFlipsideViewController *)controller; 15 | @end 16 | 17 | @interface CVFFlipsideViewController : UIViewController 18 | { 19 | bool shouldShowFPS; 20 | bool shouldShowDescription; 21 | } 22 | @property (retain, nonatomic) IBOutlet UITableView *menuTable; 23 | @property (weak, nonatomic) id delegate; 24 | @property (weak, nonatomic) IBOutlet UINavigationBar *navBar; 25 | @property (weak, nonatomic) UISwitch *switchCtl; 26 | @property (retain, nonatomic) NSArray *demoList; 27 | 28 | - (IBAction)done:(id)sender; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /CVFunhouse/CVFHough.h: -------------------------------------------------------------------------------- 1 | // 2 | // CVFHough.h 3 | // CVFunhouse 4 | // 5 | // Created by John Brewer on 8/1/13. 6 | // Copyright (c) 2013 Jera Design LLC. All rights reserved. 7 | // 8 | 9 | #import "CVFImageProcessor.h" 10 | 11 | @interface CVFHough : CVFImageProcessor 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /CVFunhouse/CVFHough.mm: -------------------------------------------------------------------------------- 1 | // 2 | // CVFHough.m 3 | // CVFunhouse 4 | // 5 | // Created by John Brewer on 8/1/13. 6 | // Copyright (c) 2013 Jera Design LLC. All rights reserved. 7 | // 8 | 9 | #import "CVFHough.h" 10 | 11 | #include "opencv2/imgproc/imgproc.hpp" 12 | 13 | using namespace std; 14 | using namespace cv; 15 | 16 | @implementation CVFHough 17 | 18 | -(void)processMat:(Mat)mat 19 | { 20 | cvtColor(mat, mat, CV_BGR2RGB); 21 | Mat grayImage; 22 | cvtColor(mat, grayImage, CV_RGB2GRAY); 23 | vector lines; 24 | Mat canny; 25 | Canny(grayImage, canny, 50, 100); 26 | HoughLinesP(canny, lines, 1, CV_PI/180, 80, 30, 10 ); 27 | for( size_t i = 0; i < lines.size(); i++ ) 28 | { 29 | line( mat, cv::Point(lines[i][0], lines[i][1]), 30 | cv::Point(lines[i][2], lines[i][3]), Scalar(0,0,255), 3, 8 ); 31 | } 32 | [self matReady:mat]; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /CVFunhouse/CVFImageProcessor.h: -------------------------------------------------------------------------------- 1 | // 2 | // CVFImageProcessor.h 3 | // CVFunhouse 4 | // 5 | // Created by John Brewer on 3/7/12. 6 | // Copyright (c) 2012 Jera Design LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #include "opencv2/core/core_c.h" 12 | #include "opencv2/imgproc/imgproc_c.h" 13 | 14 | @protocol CVFImageProcessorDelegate; 15 | 16 | @interface CVFImageProcessor : NSObject 17 | 18 | @property (nonatomic, weak) id delegate; 19 | @property (nonatomic, readonly) NSString *demoDescription; 20 | 21 | -(void)processImageBuffer:(CVImageBufferRef)imageBuffer withMirroring:(BOOL)shouldMirror; 22 | -(void)processIplImage:(IplImage*)iplImage; 23 | -(void)imageReady:(IplImage*)image; 24 | #ifdef __cplusplus 25 | -(void)processMat:(cv::Mat)mat; 26 | -(void)matReady:(cv::Mat)mat; 27 | #endif 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /CVFunhouse/CVFImageProcessorDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // CVFImageProcessorDelegate.h 3 | // CVFunhouse 4 | // 5 | // Created by John Brewer on 3/7/12. 6 | // Copyright (c) 2012 Jera Design LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class CVFImageProcessor; 12 | 13 | @protocol CVFImageProcessorDelegate 14 | 15 | -(void)imageProcessor:(CVFImageProcessor*)imageProcessor didCreateImage:(UIImage*)image; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /CVFunhouse/CVFLaplace.h: -------------------------------------------------------------------------------- 1 | // 2 | // CVFLaplace.h 3 | // CVFunhouse 4 | // 5 | // Created by John Brewer on 7/24/12. 6 | // Copyright (c) 2012 Jera Design LLC. All rights reserved. 7 | // 8 | 9 | #import "CVFImageProcessor.h" 10 | 11 | @interface CVFLaplace : CVFImageProcessor 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /CVFunhouse/CVFLaplace.mm: -------------------------------------------------------------------------------- 1 | // 2 | // CVFLaplace.m 3 | // CVFunhouse 4 | // 5 | // Created by John Brewer on 7/24/12. 6 | // Copyright (c) 2012 Jera Design LLC. All rights reserved. 7 | // 8 | 9 | // Based on the OpenCV example: /samples/cpp/laplace.cpp 10 | 11 | #import "CVFLaplace.h" 12 | 13 | #include "opencv2/core/core.hpp" 14 | #include "opencv2/imgproc/imgproc.hpp" 15 | 16 | using namespace cv; 17 | using namespace std; 18 | 19 | int sigma = 3; 20 | int smoothType = CV_GAUSSIAN; 21 | 22 | @implementation CVFLaplace 23 | 24 | -(void)processMat:(cv::Mat)mat 25 | { 26 | Mat smoothed, laplace, result; 27 | 28 | cvtColor(mat, mat, CV_BGR2RGB); 29 | 30 | int ksize = (sigma*5)|1; 31 | if(smoothType == CV_GAUSSIAN) 32 | GaussianBlur(mat, smoothed, cv::Size(ksize, ksize), sigma, sigma); 33 | else if(smoothType == CV_BLUR) 34 | blur(mat, smoothed, cv::Size(ksize, ksize)); 35 | else 36 | medianBlur(mat, smoothed, ksize); 37 | 38 | Laplacian(smoothed, laplace, CV_16S, 5); 39 | convertScaleAbs(laplace, result, (sigma+1)*0.25); 40 | 41 | [self matReady:result]; 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /CVFunhouse/CVFLucasKanade.h: -------------------------------------------------------------------------------- 1 | // 2 | // CVFLucasKanade.h 3 | // CVFunhouse 4 | // 5 | // Created by John Brewer on 7/25/12. 6 | // Copyright (c) 2012 Jera Design LLC. All rights reserved. 7 | // 8 | 9 | #import "CVFImageProcessor.h" 10 | 11 | @interface CVFLucasKanade : CVFImageProcessor 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /CVFunhouse/CVFLucasKanade.mm: -------------------------------------------------------------------------------- 1 | // 2 | // CVFLukasKanade.m 3 | // CVFunhouse 4 | // 5 | // Created by John Brewer on 7/25/12. 6 | // Copyright (c) 2012 Jera Design LLC. All rights reserved. 7 | // 8 | 9 | // Based on the OpenCV example: /samples/cpp/lkdemo.cpp 10 | 11 | #import "CVFLucasKanade.h" 12 | 13 | #include "opencv2/video/tracking.hpp" 14 | #include "opencv2/imgproc/imgproc.hpp" 15 | 16 | using namespace cv; 17 | using namespace std; 18 | 19 | TermCriteria termcrit(CV_TERMCRIT_ITER|CV_TERMCRIT_EPS,20,0.03); 20 | cv::Size subPixWinSize(10,10), winSize(31,31); 21 | const int MAX_COUNT = 500; 22 | 23 | @interface CVFLucasKanade () { 24 | bool hasBeenInited; 25 | Mat gray, prevGray/*, image */; 26 | vector points[2]; 27 | } 28 | 29 | @end 30 | 31 | 32 | @implementation CVFLucasKanade 33 | 34 | -(void)processMat:(cv::Mat)image 35 | { 36 | // mat.copyTo(image); 37 | cvtColor(image, image, CV_BGR2RGB); 38 | cvtColor(image, gray, CV_BGR2GRAY); 39 | 40 | if( !hasBeenInited ) 41 | { 42 | // automatic initialization 43 | goodFeaturesToTrack(gray, points[1], MAX_COUNT, 0.01, 10, Mat(), 3, 0, 0.04); 44 | cornerSubPix(gray, points[1], subPixWinSize, cv::Size(-1,-1), termcrit); 45 | } 46 | else if( !points[0].empty() ) 47 | { 48 | vector status; 49 | vector err; 50 | if(prevGray.empty()) 51 | gray.copyTo(prevGray); 52 | calcOpticalFlowPyrLK(prevGray, gray, points[0], points[1], status, err, winSize, 53 | 3, termcrit, 0, 0.001); 54 | size_t i, k; 55 | for( i = k = 0; i < points[1].size(); i++ ) 56 | { 57 | if( !status[i] ) 58 | continue; 59 | 60 | points[1][k++] = points[1][i]; 61 | circle( image, points[1][i], 3, Scalar(0,255,0), -1, 8); 62 | } 63 | points[1].resize(k); 64 | } 65 | 66 | hasBeenInited = true; 67 | 68 | std::swap(points[1], points[0]); 69 | swap(prevGray, gray); 70 | 71 | [self matReady:image]; 72 | } 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /CVFunhouse/CVFMainViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CVFMainViewController.h 3 | // CVFunhouse 4 | // 5 | // Created by John Brewer on 3/7/12. 6 | // Copyright (c) 2012 Jera Design LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "CVFImageProcessorDelegate.h" 12 | #import "CVFFlipsideViewController.h" 13 | 14 | @class CVFImageProcessor; 15 | 16 | @interface CVFMainViewController : UIViewController < 17 | CVFFlipsideViewControllerDelegate, 18 | UIPopoverControllerDelegate, 19 | AVCaptureVideoDataOutputSampleBufferDelegate, 20 | CVFImageProcessorDelegate, 21 | UIWebViewDelegate 22 | > 23 | @property (weak, nonatomic) IBOutlet UIImageView *imageView; 24 | @property (weak, nonatomic) IBOutlet UILabel *fpsLabel; 25 | @property (weak, nonatomic) IBOutlet UIButton *flipCameraButton; 26 | @property (weak, nonatomic) IBOutlet UIWebView *descriptionView; 27 | @property (weak, nonatomic) IBOutlet UIView *descriptionContainer; 28 | @property (weak, nonatomic) IBOutlet GLKView *arView; 29 | 30 | @property (strong, nonatomic) UIPopoverController *flipsidePopoverController; 31 | @property (strong, atomic) CVFImageProcessor *imageProcessor; 32 | 33 | - (IBAction)flipAction:(id)sender; 34 | - (IBAction)swipeUpAction:(id)sender; 35 | - (IBAction)swipeDownAction:(id)sender; 36 | - (IBAction)closeDescription:(id)sender; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /CVFunhouse/CVFMotionTemplates.h: -------------------------------------------------------------------------------- 1 | // 2 | // CVFMotionTemplates.h 3 | // CVFunhouse 4 | // 5 | // Created by John Brewer on 7/25/12. 6 | // Copyright (c) 2012 Jera Design LLC. All rights reserved. 7 | // 8 | 9 | #import "CVFImageProcessor.h" 10 | 11 | @interface CVFMotionTemplates : CVFImageProcessor 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /CVFunhouse/CVFPassThru.h: -------------------------------------------------------------------------------- 1 | // 2 | // CVFPassThru.h 3 | // CVFunhouse 4 | // 5 | // Created by John Brewer on 7/22/12. 6 | // Copyright (c) 2012 Jera Design LLC. All rights reserved. 7 | // 8 | 9 | #import "CVFImageProcessor.h" 10 | 11 | @interface CVFPassThru : CVFImageProcessor 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /CVFunhouse/CVFPassThru.m: -------------------------------------------------------------------------------- 1 | // 2 | // CVFPassThru.m 3 | // CVFunhouse 4 | // 5 | // Created by John Brewer on 7/22/12. 6 | // Copyright (c) 2012 Jera Design LLC. All rights reserved. 7 | // 8 | 9 | #import "CVFPassThru.h" 10 | 11 | @implementation CVFPassThru 12 | 13 | /* 14 | * processIplImage 15 | * 16 | * Inputs: 17 | * iplImage: an IplImage in BGRA format, 8 bits per pixel. 18 | * YOU ARE RESPONSIBLE FOR CALLING cvReleaseImage on this image. 19 | * 20 | * Outputs: 21 | * When you are done, call imageReady: with an RGB, RGBA, or grayscale 22 | * IplImage with 8-bits per pixel. 23 | * 24 | * You can call imageReady: from any thread and it will do the right thing. 25 | * You can fork as many threads to process the image as you like; just call 26 | * imageReady when you are done. 27 | * 28 | * imageReady: will dispose of the IplImage you pass it once the system is 29 | * done with it. 30 | */ 31 | -(void)processIplImage:(IplImage*)iplImage 32 | { 33 | // We get an BGRA image at 8-bits per pixel, but we need an RGB image 34 | // to pass to imageReady:, so we need to do a brief conversion. 35 | 36 | // To do the conversion, first create an IplImage the same size... 37 | IplImage *rgbImage = cvCreateImage(cvGetSize(iplImage), IPL_DEPTH_8U, 3); 38 | 39 | // Call cvCvtColor to do the conversion 40 | cvCvtColor(iplImage, rgbImage, CV_BGR2RGB); 41 | 42 | // Release the original image or you will run out of memory very fast! 43 | cvReleaseImage(&iplImage); 44 | 45 | // Call imageReady with your new image. 46 | [self imageReady:rgbImage]; 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /CVFunhouse/CVFSephiaDemo.h: -------------------------------------------------------------------------------- 1 | // 2 | // CVFSephiaDemo.h 3 | // CVFunhouse 4 | // 5 | // Created by Matthew Shopsin on 7/21/12. 6 | // Copyright (c) 2012 Jera Design LLC. All rights reserved. 7 | // 8 | 9 | #import "CVFImageProcessor.h" 10 | 11 | @interface CVFSephiaDemo : CVFImageProcessor 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /CVFunhouse/CVFSephiaDemo.m: -------------------------------------------------------------------------------- 1 | // 2 | // CVFSephiaDemo.m 3 | // CVFunhouse 4 | // 5 | // Created by Matthew Shopsin on 7/21/12. 6 | // Copyright (c) 2012 Jera Design LLC. All rights reserved. 7 | // 8 | 9 | #import "CVFSephiaDemo.h" 10 | #include "opencv2/core/core_c.h" 11 | #include "opencv2/imgproc/imgproc_c.h" 12 | 13 | @implementation CVFSephiaDemo 14 | 15 | 16 | 17 | -(void)processIplImage:(IplImage*)iplImage 18 | { 19 | IplImage *output = cvCreateImage(cvGetSize(iplImage), IPL_DEPTH_8U, 3); 20 | IplImage *sepiaImage = cvCreateImage(cvGetSize(iplImage), IPL_DEPTH_8U, 4); 21 | //cvCvtColor(iplImage, output, CV_RGB2BGR); 22 | float sepia_Array[] = {0.393, 0.769, 0.189,0.0, 0.349, 0.686, 0.168,0.0, 0.272, 0.534, 0.131,0.0, 0.0, 0.0, 0.0, 1.0}; 23 | CvMat m_Sepia = cvMat(3, 3, CV_32F, sepia_Array); 24 | 25 | cvFilter2D(iplImage, sepiaImage, &m_Sepia, cvPoint(1, -1));//(iplImage, sepiaImage, &m_Sepia, NULL); 26 | cvCvtColor(sepiaImage, output, CV_BGRA2RGB); 27 | //cvCvtColor(output, output2, CV_RGB2BGR); 28 | //cvReleaseImage(&sepiaImage); 29 | cvReleaseImage(&sepiaImage); 30 | cvReleaseImage(&iplImage); 31 | 32 | 33 | 34 | [self imageReady:output]; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /CVFunhouse/CVFunhouse-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIcons 12 | 13 | CFBundlePrimaryIcon 14 | 15 | CFBundleIconFiles 16 | 17 | CVFunhouse57.png 18 | CVFunhouse114.png 19 | CVFunhouse144.png 20 | CVFunhouse72.png 21 | 22 | UIPrerenderedIcon 23 | 24 | 25 | 26 | CFBundleIdentifier 27 | $(PRODUCT_BUNDLE_IDENTIFIER) 28 | CFBundleInfoDictionaryVersion 29 | 6.0 30 | CFBundleName 31 | ${PRODUCT_NAME} 32 | CFBundlePackageType 33 | APPL 34 | CFBundleShortVersionString 35 | 1.0 36 | CFBundleSignature 37 | ???? 38 | CFBundleVersion 39 | $(CURRENT_PROJECT_VERSION) 40 | LSRequiresIPhoneOS 41 | 42 | NSCameraUsageDescription 43 | To transform camera image via OpenCV. 44 | UILaunchStoryboardName 45 | Launch Screen 46 | UIMainStoryboardFile 47 | MainStoryboard_iPhone 48 | UIMainStoryboardFile~ipad 49 | MainStoryboard_iPad 50 | UIPrerenderedIcon 51 | 52 | UIRequiredDeviceCapabilities 53 | 54 | armv7 55 | video-camera 56 | 57 | UIRequiresFullScreen 58 | 59 | UIStatusBarHidden 60 | 61 | UISupportedInterfaceOrientations 62 | 63 | UIInterfaceOrientationPortrait 64 | 65 | UISupportedInterfaceOrientations~ipad 66 | 67 | UIInterfaceOrientationPortrait 68 | 69 | UIViewControllerBasedStatusBarAppearance 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /CVFunhouse/CVFunhouse-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'CVFunhouse' target in the 'CVFunhouse' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_5_0 8 | #warning "This project uses features only available in iOS SDK 5.0 and later." 9 | #endif 10 | 11 | #ifdef __cplusplus 12 | #pragma clang diagnostic push 13 | #pragma clang diagnostic ignored "-Wall" 14 | #pragma clang diagnostic ignored "-Wnested-anon-types" 15 | #import "opencv2/opencv.hpp" 16 | #pragma clang diagnostic pop 17 | #endif 18 | 19 | #ifdef __OBJC__ 20 | #import 21 | #import 22 | #endif 23 | -------------------------------------------------------------------------------- /CVFunhouse/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /CVFunhouse/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // CVFunhouse 4 | // 5 | // Created by John Brewer on 3/7/12. 6 | // Copyright (c) 2012 Jera Design LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CVFAppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([CVFAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /CVFunhouse114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeradesign/CVFunhouse/9b676ea969c255782386eedbe5c307c8d14bd14b/CVFunhouse114.png -------------------------------------------------------------------------------- /CVFunhouse144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeradesign/CVFunhouse/9b676ea969c255782386eedbe5c307c8d14bd14b/CVFunhouse144.png -------------------------------------------------------------------------------- /CVFunhouse57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeradesign/CVFunhouse/9b676ea969c255782386eedbe5c307c8d14bd14b/CVFunhouse57.png -------------------------------------------------------------------------------- /CVFunhouse72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeradesign/CVFunhouse/9b676ea969c255782386eedbe5c307c8d14bd14b/CVFunhouse72.png -------------------------------------------------------------------------------- /CloseButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeradesign/CVFunhouse/9b676ea969c255782386eedbe5c307c8d14bd14b/CloseButton.png -------------------------------------------------------------------------------- /Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeradesign/CVFunhouse/9b676ea969c255782386eedbe5c307c8d14bd14b/Default-568h@2x.png -------------------------------------------------------------------------------- /Demos.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Canny Edge Detector 7 | CVFCannyDemo 8 | 9 | 10 | Face Detector 11 | CVFFaceDetect 12 | 13 | 14 | Laplace 15 | CVFLaplace 16 | 17 | 18 | Farneback 19 | CVFFarneback 20 | 21 | 22 | Lucas-Kanade 23 | CVFLucasKanade 24 | 25 | 26 | Motion Templates 27 | CVFMotionTemplates 28 | 29 | 30 | Hough Transform 31 | CVFHough 32 | 33 | 34 | Pass Thru 35 | CVFPassThru 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012, Jera Design LLC 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | 10 | * Neither the name of Jera Design LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 11 | 12 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 13 | 14 | NOTE: CVFunhouse includes a copy of the OpenCV library in built as an iOS framework. OpenCV is licensed separately under similar terms. See the file "OpenCV license.txt" for details. For more information on OpenCV (including full source code to the library), see http://opencv.org/ -------------------------------------------------------------------------------- /Launch Screen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /NoDescription.html: -------------------------------------------------------------------------------- 1 |

No Description Provided

-------------------------------------------------------------------------------- /OpenCV license.txt: -------------------------------------------------------------------------------- 1 | IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 2 | 3 | By downloading, copying, installing or using the software you agree to this license. 4 | If you do not agree to this license, do not download, install, 5 | copy or use the software. 6 | 7 | 8 | License Agreement 9 | For Open Source Computer Vision Library 10 | 11 | Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 12 | Copyright (C) 2008-2011, Willow Garage Inc., all rights reserved. 13 | Third party copyrights are property of their respective owners. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, 16 | are permitted provided that the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright notice, 19 | this list of conditions and the following disclaimer. 20 | 21 | * Redistributions in binary form must reproduce the above copyright notice, 22 | this list of conditions and the following disclaimer in the documentation 23 | and/or other materials provided with the distribution. 24 | 25 | * The name of the copyright holders may not be used to endorse or promote products 26 | derived from this software without specific prior written permission. 27 | 28 | This software is provided by the copyright holders and contributors "as is" and 29 | any express or implied warranties, including, but not limited to, the implied 30 | warranties of merchantability and fitness for a particular purpose are disclaimed. 31 | In no event shall the Intel Corporation or contributors be liable for any direct, 32 | indirect, incidental, special, exemplary, or consequential damages 33 | (including, but not limited to, procurement of substitute goods or services; 34 | loss of use, data, or profits; or business interruption) however caused 35 | and on any theory of liability, whether in contract, strict liability, 36 | or tort (including negligence or otherwise) arising in any way out of 37 | the use of this software, even if advised of the possibility of such damage. 38 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This project should contain everything you need to build and run CVFunhouse 2 | under Xcode 4.5.2. If you run into any problems building or running, please file 3 | a bug. 4 | 5 | To get started writing your own OpenCV code, try modifying the CVFPassThru 6 | example. It contains thorough comments explaining exactly what you need to do. 7 | Plus it starts out working, so you can easily tell if you break anything as you 8 | hack. 9 | 10 | NOTE: CVFunhouse includes a copy of the OpenCV library built as an iOS 11 | framework. OpenCV is licensed separately under similar terms. See the file 12 | "OpenCV license.txt" for details. For more information on OpenCV (including full 13 | source code to the library), see the [OpenCV website](http://opencv.org/). 14 | 15 | Augmented Reality 16 | ----------------- 17 | 18 | The augmented reality demo is currently checked into a separate branch. To use 19 | it, enter `git checkout augmented-reality` on the command line. 20 | 21 | Rebasing 22 | -------- 23 | 24 | If you forked or cloned before 12-Jan-2013, you'll need to rebase your code to 25 | have your changes fit into the history properly. To do this: 26 | 27 | * Enter `git fetch` (**Do not use** `git pull`) 28 | * Enter `git rebase -i` 29 | * An editor window will appear. 30 | * Delete the line that starts: `pick 2a02f2a` 31 | * Delete the line that starts: `pick 429b656` 32 | * Save the file and close the editor. 33 | * That's it! You should be good to go from now on. 34 | 35 | Sorry for the inconvenience. This should be a one-time occurrence. -------------------------------------------------------------------------------- /Settings.bundle/Root.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | Type 9 | PSGroupSpecifier 10 | FooterText 11 | CVFunhouse 12 | Copyright (c) 2012, 2013, Jera Design LLC 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 16 | 17 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 18 | 19 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 20 | 21 | * Neither the name of Jera Design LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 22 | 23 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | 25 | NOTE: CVFunhouse includes a copy of the OpenCV library in built as an iOS framework. OpenCV is licensed separately under similar terms. See the file "OpenCV license.txt" for details. For more information on OpenCV (including full source code to the library), see http://opencv.org/ 26 | 27 | 28 | 29 | 30 | Type 31 | PSGroupSpecifier 32 | FooterText 33 | OpenCV 34 | IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 35 | 36 | By downloading, copying, installing or using the software you agree to this license. 37 | If you do not agree to this license, do not download, install, 38 | copy or use the software. 39 | 40 | 41 | License Agreement 42 | For Open Source Computer Vision Library 43 | 44 | Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 45 | Copyright (C) 2008-2011, Willow Garage Inc., all rights reserved. 46 | Third party copyrights are property of their respective owners. 47 | 48 | Redistribution and use in source and binary forms, with or without modification, 49 | are permitted provided that the following conditions are met: 50 | 51 | * Redistributions of source code must retain the above copyright notice, 52 | this list of conditions and the following disclaimer. 53 | 54 | * Redistributions in binary form must reproduce the above copyright notice, 55 | this list of conditions and the following disclaimer in the documentation 56 | and/or other materials provided with the distribution. 57 | 58 | * The name of the copyright holders may not be used to endorse or promote products 59 | derived from this software without specific prior written permission. 60 | 61 | This software is provided by the copyright holders and contributors "as is" and 62 | any express or implied warranties, including, but not limited to, the implied 63 | warranties of merchantability and fitness for a particular purpose are disclaimed. 64 | In no event shall the Intel Corporation or contributors be liable for any direct, 65 | indirect, incidental, special, exemplary, or consequential damages 66 | (including, but not limited to, procurement of substitute goods or services; 67 | loss of use, data, or profits; or business interruption) however caused 68 | and on any theory of liability, whether in contract, strict liability, 69 | or tort (including negligence or otherwise) arising in any way out of 70 | the use of this software, even if advised of the possibility of such damage. 71 | 72 | 73 | 74 | 75 | Type 76 | PSGroupSpecifier 77 | FooterText 78 | Icon: Switch Camera Front/Rear by Simon Strandgaard 79 | http://www.flickr.com/photos/12739382@N04/5463151636/ 80 | 81 | 82 | StringsTable 83 | Root 84 | 85 | 86 | -------------------------------------------------------------------------------- /Settings.bundle/en.lproj/Root.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeradesign/CVFunhouse/9b676ea969c255782386eedbe5c307c8d14bd14b/Settings.bundle/en.lproj/Root.strings -------------------------------------------------------------------------------- /SwitchCameraIcon44.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeradesign/CVFunhouse/9b676ea969c255782386eedbe5c307c8d14bd14b/SwitchCameraIcon44.png -------------------------------------------------------------------------------- /SwitchCameraIcon44@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeradesign/CVFunhouse/9b676ea969c255782386eedbe5c307c8d14bd14b/SwitchCameraIcon44@2x.png -------------------------------------------------------------------------------- /iButton30.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeradesign/CVFunhouse/9b676ea969c255782386eedbe5c307c8d14bd14b/iButton30.png -------------------------------------------------------------------------------- /iButton30@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeradesign/CVFunhouse/9b676ea969c255782386eedbe5c307c8d14bd14b/iButton30@2x.png -------------------------------------------------------------------------------- /opencv2.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /opencv2.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/contrib/detection_based_tracker.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if defined(__linux__) || defined(LINUX) || defined(__APPLE__) || defined(ANDROID) 4 | 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | class DetectionBasedTracker 11 | { 12 | public: 13 | struct Parameters 14 | { 15 | int minObjectSize; 16 | int maxObjectSize; 17 | double scaleFactor; 18 | int maxTrackLifetime; 19 | int minNeighbors; 20 | int minDetectionPeriod; //the minimal time between run of the big object detector (on the whole frame) in ms (1000 mean 1 sec), default=0 21 | 22 | Parameters(); 23 | }; 24 | 25 | DetectionBasedTracker(const std::string& cascadeFilename, const Parameters& params); 26 | virtual ~DetectionBasedTracker(); 27 | 28 | virtual bool run(); 29 | virtual void stop(); 30 | virtual void resetTracking(); 31 | 32 | virtual void process(const cv::Mat& imageGray); 33 | 34 | bool setParameters(const Parameters& params); 35 | const Parameters& getParameters(); 36 | 37 | 38 | typedef std::pair Object; 39 | virtual void getObjects(std::vector& result) const; 40 | virtual void getObjects(std::vector& result) const; 41 | 42 | protected: 43 | class SeparateDetectionWork; 44 | cv::Ptr separateDetectionWork; 45 | friend void* workcycleObjectDetectorFunction(void* p); 46 | 47 | 48 | struct InnerParameters 49 | { 50 | int numLastPositionsToTrack; 51 | int numStepsToWaitBeforeFirstShow; 52 | int numStepsToTrackWithoutDetectingIfObjectHasNotBeenShown; 53 | int numStepsToShowWithoutDetecting; 54 | 55 | float coeffTrackingWindowSize; 56 | float coeffObjectSizeToTrack; 57 | float coeffObjectSpeedUsingInPrediction; 58 | 59 | InnerParameters(); 60 | }; 61 | Parameters parameters; 62 | InnerParameters innerParameters; 63 | 64 | struct TrackedObject 65 | { 66 | typedef std::vector PositionsVector; 67 | 68 | PositionsVector lastPositions; 69 | 70 | int numDetectedFrames; 71 | int numFramesNotDetected; 72 | int id; 73 | 74 | TrackedObject(const cv::Rect& rect):numDetectedFrames(1), numFramesNotDetected(0) 75 | { 76 | lastPositions.push_back(rect); 77 | id=getNextId(); 78 | }; 79 | 80 | static int getNextId() 81 | { 82 | static int _id=0; 83 | return _id++; 84 | } 85 | }; 86 | 87 | int numTrackedSteps; 88 | std::vector trackedObjects; 89 | 90 | std::vector weightsPositionsSmoothing; 91 | std::vector weightsSizesSmoothing; 92 | 93 | cv::CascadeClassifier cascadeForTracking; 94 | 95 | 96 | void updateTrackedObjects(const std::vector& detectedObjects); 97 | cv::Rect calcTrackedObjectPositionToShow(int i) const; 98 | void detectInRegion(const cv::Mat& img, const cv::Rect& r, std::vector& detectedObjectsInRegions); 99 | }; 100 | 101 | namespace cv 102 | { 103 | using ::DetectionBasedTracker; 104 | } //end of cv namespace 105 | 106 | #endif 107 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/core/devmem2d.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #include "opencv2/core/cuda_devptrs.hpp" 44 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/core/version.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // Intel License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright( C) 2000, Intel Corporation, all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of Intel Corporation may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the Intel Corporation or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | //(including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort(including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | /* 43 | definition of the current version of OpenCV 44 | Usefull to test in user programs 45 | */ 46 | 47 | #ifndef __OPENCV_VERSION_HPP__ 48 | #define __OPENCV_VERSION_HPP__ 49 | 50 | #define CV_VERSION_EPOCH 2 51 | #define CV_VERSION_MAJOR 4 52 | #define CV_VERSION_MINOR 8 53 | #define CV_VERSION_REVISION 0 54 | 55 | #define CVAUX_STR_EXP(__A) #__A 56 | #define CVAUX_STR(__A) CVAUX_STR_EXP(__A) 57 | 58 | #define CVAUX_STRW_EXP(__A) L#__A 59 | #define CVAUX_STRW(__A) CVAUX_STRW_EXP(__A) 60 | 61 | #if CV_VERSION_REVISION 62 | # define CV_VERSION CVAUX_STR(CV_VERSION_EPOCH) "." CVAUX_STR(CV_VERSION_MAJOR) "." CVAUX_STR(CV_VERSION_MINOR) "." CVAUX_STR(CV_VERSION_REVISION) 63 | #else 64 | # define CV_VERSION CVAUX_STR(CV_VERSION_EPOCH) "." CVAUX_STR(CV_VERSION_MAJOR) "." CVAUX_STR(CV_VERSION_MINOR) 65 | #endif 66 | 67 | /* old style version constants*/ 68 | #define CV_MAJOR_VERSION CV_VERSION_EPOCH 69 | #define CV_MINOR_VERSION CV_VERSION_MAJOR 70 | #define CV_SUBMINOR_VERSION CV_VERSION_MINOR 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /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/defines.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_DEFINES_H_ 31 | #define OPENCV_FLANN_DEFINES_H_ 32 | 33 | #include "config.h" 34 | 35 | #ifdef FLANN_EXPORT 36 | #undef FLANN_EXPORT 37 | #endif 38 | #ifdef WIN32 39 | /* win32 dll export/import directives */ 40 | #ifdef FLANN_EXPORTS 41 | #define FLANN_EXPORT __declspec(dllexport) 42 | #elif defined(FLANN_STATIC) 43 | #define FLANN_EXPORT 44 | #else 45 | #define FLANN_EXPORT __declspec(dllimport) 46 | #endif 47 | #else 48 | /* unix needs nothing */ 49 | #define FLANN_EXPORT 50 | #endif 51 | 52 | 53 | #ifdef FLANN_DEPRECATED 54 | #undef FLANN_DEPRECATED 55 | #endif 56 | #ifdef __GNUC__ 57 | #define FLANN_DEPRECATED __attribute__ ((deprecated)) 58 | #elif defined(_MSC_VER) 59 | #define FLANN_DEPRECATED __declspec(deprecated) 60 | #else 61 | #pragma message("WARNING: You need to implement FLANN_DEPRECATED for this compiler") 62 | #define FLANN_DEPRECATED 63 | #endif 64 | 65 | 66 | #undef FLANN_PLATFORM_32_BIT 67 | #undef FLANN_PLATFORM_64_BIT 68 | #if defined __amd64__ || defined __x86_64__ || defined _WIN64 || defined _M_X64 69 | #define FLANN_PLATFORM_64_BIT 70 | #else 71 | #define FLANN_PLATFORM_32_BIT 72 | #endif 73 | 74 | 75 | #undef FLANN_ARRAY_LEN 76 | #define FLANN_ARRAY_LEN(a) (sizeof(a)/sizeof(a[0])) 77 | 78 | namespace cvflann { 79 | 80 | /* Nearest neighbour index algorithms */ 81 | enum flann_algorithm_t 82 | { 83 | FLANN_INDEX_LINEAR = 0, 84 | FLANN_INDEX_KDTREE = 1, 85 | FLANN_INDEX_KMEANS = 2, 86 | FLANN_INDEX_COMPOSITE = 3, 87 | FLANN_INDEX_KDTREE_SINGLE = 4, 88 | FLANN_INDEX_HIERARCHICAL = 5, 89 | FLANN_INDEX_LSH = 6, 90 | FLANN_INDEX_SAVED = 254, 91 | FLANN_INDEX_AUTOTUNED = 255, 92 | 93 | // deprecated constants, should use the FLANN_INDEX_* ones instead 94 | LINEAR = 0, 95 | KDTREE = 1, 96 | KMEANS = 2, 97 | COMPOSITE = 3, 98 | KDTREE_SINGLE = 4, 99 | SAVED = 254, 100 | AUTOTUNED = 255 101 | }; 102 | 103 | 104 | 105 | enum flann_centers_init_t 106 | { 107 | FLANN_CENTERS_RANDOM = 0, 108 | FLANN_CENTERS_GONZALES = 1, 109 | FLANN_CENTERS_KMEANSPP = 2, 110 | 111 | // deprecated constants, should use the FLANN_CENTERS_* ones instead 112 | CENTERS_RANDOM = 0, 113 | CENTERS_GONZALES = 1, 114 | CENTERS_KMEANSPP = 2 115 | }; 116 | 117 | enum flann_log_level_t 118 | { 119 | FLANN_LOG_NONE = 0, 120 | FLANN_LOG_FATAL = 1, 121 | FLANN_LOG_ERROR = 2, 122 | FLANN_LOG_WARN = 3, 123 | FLANN_LOG_INFO = 4 124 | }; 125 | 126 | enum flann_distance_t 127 | { 128 | FLANN_DIST_EUCLIDEAN = 1, 129 | FLANN_DIST_L2 = 1, 130 | FLANN_DIST_MANHATTAN = 2, 131 | FLANN_DIST_L1 = 2, 132 | FLANN_DIST_MINKOWSKI = 3, 133 | FLANN_DIST_MAX = 4, 134 | FLANN_DIST_HIST_INTERSECT = 5, 135 | FLANN_DIST_HELLINGER = 6, 136 | FLANN_DIST_CHI_SQUARE = 7, 137 | FLANN_DIST_CS = 7, 138 | FLANN_DIST_KULLBACK_LEIBLER = 8, 139 | FLANN_DIST_KL = 8, 140 | FLANN_DIST_HAMMING = 9, 141 | 142 | // deprecated constants, should use the FLANN_DIST_* ones instead 143 | EUCLIDEAN = 1, 144 | MANHATTAN = 2, 145 | MINKOWSKI = 3, 146 | MAX_DIST = 4, 147 | HIST_INTERSECT = 5, 148 | HELLINGER = 6, 149 | CS = 7, 150 | KL = 8, 151 | KULLBACK_LEIBLER = 8 152 | }; 153 | 154 | enum flann_datatype_t 155 | { 156 | FLANN_INT8 = 0, 157 | FLANN_INT16 = 1, 158 | FLANN_INT32 = 2, 159 | FLANN_INT64 = 3, 160 | FLANN_UINT8 = 4, 161 | FLANN_UINT16 = 5, 162 | FLANN_UINT32 = 6, 163 | FLANN_UINT64 = 7, 164 | FLANN_FLOAT32 = 8, 165 | FLANN_FLOAT64 = 9 166 | }; 167 | 168 | enum 169 | { 170 | FLANN_CHECKS_UNLIMITED = -1, 171 | FLANN_CHECKS_AUTOTUNED = -2 172 | }; 173 | 174 | } 175 | 176 | #endif /* OPENCV_FLANN_DEFINES_H_ */ 177 | -------------------------------------------------------------------------------- /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/dynamic_bitset.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 | /*********************************************************************** 32 | * Author: Vincent Rabaud 33 | *************************************************************************/ 34 | 35 | #ifndef OPENCV_FLANN_DYNAMIC_BITSET_H_ 36 | #define OPENCV_FLANN_DYNAMIC_BITSET_H_ 37 | 38 | #ifndef FLANN_USE_BOOST 39 | # define FLANN_USE_BOOST 0 40 | #endif 41 | //#define FLANN_USE_BOOST 1 42 | #if FLANN_USE_BOOST 43 | #include 44 | typedef boost::dynamic_bitset<> DynamicBitset; 45 | #else 46 | 47 | #include 48 | 49 | #include "dist.h" 50 | 51 | namespace cvflann { 52 | 53 | /** Class re-implementing the boost version of it 54 | * This helps not depending on boost, it also does not do the bound checks 55 | * and has a way to reset a block for speed 56 | */ 57 | class DynamicBitset 58 | { 59 | public: 60 | /** @param default constructor 61 | */ 62 | DynamicBitset() 63 | { 64 | } 65 | 66 | /** @param only constructor we use in our code 67 | * @param the size of the bitset (in bits) 68 | */ 69 | DynamicBitset(size_t sz) 70 | { 71 | resize(sz); 72 | reset(); 73 | } 74 | 75 | /** Sets all the bits to 0 76 | */ 77 | void clear() 78 | { 79 | std::fill(bitset_.begin(), bitset_.end(), 0); 80 | } 81 | 82 | /** @brief checks if the bitset is empty 83 | * @return true if the bitset is empty 84 | */ 85 | bool empty() const 86 | { 87 | return bitset_.empty(); 88 | } 89 | 90 | /** @param set all the bits to 0 91 | */ 92 | void reset() 93 | { 94 | std::fill(bitset_.begin(), bitset_.end(), 0); 95 | } 96 | 97 | /** @brief set one bit to 0 98 | * @param 99 | */ 100 | void reset(size_t index) 101 | { 102 | bitset_[index / cell_bit_size_] &= ~(size_t(1) << (index % cell_bit_size_)); 103 | } 104 | 105 | /** @brief sets a specific bit to 0, and more bits too 106 | * This function is useful when resetting a given set of bits so that the 107 | * whole bitset ends up being 0: if that's the case, we don't care about setting 108 | * other bits to 0 109 | * @param 110 | */ 111 | void reset_block(size_t index) 112 | { 113 | bitset_[index / cell_bit_size_] = 0; 114 | } 115 | 116 | /** @param resize the bitset so that it contains at least size bits 117 | * @param size 118 | */ 119 | void resize(size_t sz) 120 | { 121 | size_ = sz; 122 | bitset_.resize(sz / cell_bit_size_ + 1); 123 | } 124 | 125 | /** @param set a bit to true 126 | * @param index the index of the bit to set to 1 127 | */ 128 | void set(size_t index) 129 | { 130 | bitset_[index / cell_bit_size_] |= size_t(1) << (index % cell_bit_size_); 131 | } 132 | 133 | /** @param gives the number of contained bits 134 | */ 135 | size_t size() const 136 | { 137 | return size_; 138 | } 139 | 140 | /** @param check if a bit is set 141 | * @param index the index of the bit to check 142 | * @return true if the bit is set 143 | */ 144 | bool test(size_t index) const 145 | { 146 | return (bitset_[index / cell_bit_size_] & (size_t(1) << (index % cell_bit_size_))) != 0; 147 | } 148 | 149 | private: 150 | std::vector bitset_; 151 | size_t size_; 152 | static const unsigned int cell_bit_size_ = CHAR_BIT * sizeof(size_t); 153 | }; 154 | 155 | } // namespace cvflann 156 | 157 | #endif 158 | 159 | #endif // OPENCV_FLANN_DYNAMIC_BITSET_H_ 160 | -------------------------------------------------------------------------------- /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 "defines.h" 35 | #include 36 | #include 37 | 38 | namespace cvflann 39 | { 40 | 41 | class FLANNException : public std::runtime_error 42 | { 43 | public: 44 | FLANNException(const char* message) : std::runtime_error(message) { } 45 | 46 | FLANNException(const std::string& message) : std::runtime_error(message) { } 47 | }; 48 | 49 | } 50 | 51 | 52 | #endif /* OPENCV_FLANN_GENERAL_H_ */ 53 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/flann/ground_truth.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef OPENCV_FLANN_GROUND_TRUTH_H_ 32 | #define OPENCV_FLANN_GROUND_TRUTH_H_ 33 | 34 | #include "dist.h" 35 | #include "matrix.h" 36 | 37 | 38 | namespace cvflann 39 | { 40 | 41 | template 42 | void find_nearest(const Matrix& dataset, typename Distance::ElementType* query, int* matches, int nn, 43 | int skip = 0, Distance distance = Distance()) 44 | { 45 | typedef typename Distance::ResultType DistanceType; 46 | int n = nn + skip; 47 | 48 | std::vector match(n); 49 | std::vector dists(n); 50 | 51 | dists[0] = distance(dataset[0], query, dataset.cols); 52 | match[0] = 0; 53 | int dcnt = 1; 54 | 55 | for (size_t i=1; i=1 && dists[j] 83 | void compute_ground_truth(const Matrix& dataset, const Matrix& testset, Matrix& matches, 84 | int skip=0, Distance d = Distance()) 85 | { 86 | for (size_t i=0; i(dataset, testset[i], matches[i], (int)matches.cols, skip, d); 88 | } 89 | } 90 | 91 | 92 | } 93 | 94 | #endif //OPENCV_FLANN_GROUND_TRUTH_H_ 95 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/flann/heap.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_HEAP_H_ 32 | #define OPENCV_FLANN_HEAP_H_ 33 | 34 | #include 35 | #include 36 | 37 | namespace cvflann 38 | { 39 | 40 | /** 41 | * Priority Queue Implementation 42 | * 43 | * The priority queue is implemented with a heap. A heap is a complete 44 | * (full) binary tree in which each parent is less than both of its 45 | * children, but the order of the children is unspecified. 46 | */ 47 | template 48 | class Heap 49 | { 50 | 51 | /** 52 | * Storage array for the heap. 53 | * Type T must be comparable. 54 | */ 55 | std::vector heap; 56 | int length; 57 | 58 | /** 59 | * Number of element in the heap 60 | */ 61 | int count; 62 | 63 | 64 | 65 | public: 66 | /** 67 | * Constructor. 68 | * 69 | * Params: 70 | * sz = heap size 71 | */ 72 | 73 | Heap(int sz) 74 | { 75 | length = sz; 76 | heap.reserve(length); 77 | count = 0; 78 | } 79 | 80 | /** 81 | * 82 | * Returns: heap size 83 | */ 84 | int size() 85 | { 86 | return count; 87 | } 88 | 89 | /** 90 | * Tests if the heap is empty 91 | * 92 | * Returns: true is heap empty, false otherwise 93 | */ 94 | bool empty() 95 | { 96 | return size()==0; 97 | } 98 | 99 | /** 100 | * Clears the heap. 101 | */ 102 | void clear() 103 | { 104 | heap.clear(); 105 | count = 0; 106 | } 107 | 108 | struct CompareT 109 | { 110 | bool operator()(const T& t_1, const T& t_2) const 111 | { 112 | return t_2 < t_1; 113 | } 114 | }; 115 | 116 | /** 117 | * Insert a new element in the heap. 118 | * 119 | * We select the next empty leaf node, and then keep moving any larger 120 | * parents down until the right location is found to store this element. 121 | * 122 | * Params: 123 | * value = the new element to be inserted in the heap 124 | */ 125 | void insert(T value) 126 | { 127 | /* If heap is full, then return without adding this element. */ 128 | if (count == length) { 129 | return; 130 | } 131 | 132 | heap.push_back(value); 133 | static CompareT compareT; 134 | std::push_heap(heap.begin(), heap.end(), compareT); 135 | ++count; 136 | } 137 | 138 | 139 | 140 | /** 141 | * Returns the node of minimum value from the heap (top of the heap). 142 | * 143 | * Params: 144 | * value = out parameter used to return the min element 145 | * Returns: false if heap empty 146 | */ 147 | bool popMin(T& value) 148 | { 149 | if (count == 0) { 150 | return false; 151 | } 152 | 153 | value = heap[0]; 154 | static CompareT compareT; 155 | std::pop_heap(heap.begin(), heap.end(), compareT); 156 | heap.pop_back(); 157 | --count; 158 | 159 | return true; /* Return old last node. */ 160 | } 161 | }; 162 | 163 | } 164 | 165 | #endif //OPENCV_FLANN_HEAP_H_ 166 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/flann/linear_index.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef OPENCV_FLANN_LINEAR_INDEX_H_ 32 | #define OPENCV_FLANN_LINEAR_INDEX_H_ 33 | 34 | #include "general.h" 35 | #include "nn_index.h" 36 | 37 | namespace cvflann 38 | { 39 | 40 | struct LinearIndexParams : public IndexParams 41 | { 42 | LinearIndexParams() 43 | { 44 | (* this)["algorithm"] = FLANN_INDEX_LINEAR; 45 | } 46 | }; 47 | 48 | template 49 | class LinearIndex : public NNIndex 50 | { 51 | public: 52 | 53 | typedef typename Distance::ElementType ElementType; 54 | typedef typename Distance::ResultType DistanceType; 55 | 56 | 57 | LinearIndex(const Matrix& inputData, const IndexParams& params = LinearIndexParams(), 58 | Distance d = Distance()) : 59 | dataset_(inputData), index_params_(params), distance_(d) 60 | { 61 | } 62 | 63 | LinearIndex(const LinearIndex&); 64 | LinearIndex& operator=(const LinearIndex&); 65 | 66 | flann_algorithm_t getType() const 67 | { 68 | return FLANN_INDEX_LINEAR; 69 | } 70 | 71 | 72 | size_t size() const 73 | { 74 | return dataset_.rows; 75 | } 76 | 77 | size_t veclen() const 78 | { 79 | return dataset_.cols; 80 | } 81 | 82 | 83 | int usedMemory() const 84 | { 85 | return 0; 86 | } 87 | 88 | void buildIndex() 89 | { 90 | /* nothing to do here for linear search */ 91 | } 92 | 93 | void saveIndex(FILE*) 94 | { 95 | /* nothing to do here for linear search */ 96 | } 97 | 98 | 99 | void loadIndex(FILE*) 100 | { 101 | /* nothing to do here for linear search */ 102 | 103 | index_params_["algorithm"] = getType(); 104 | } 105 | 106 | void findNeighbors(ResultSet& resultSet, const ElementType* vec, const SearchParams& /*searchParams*/) 107 | { 108 | ElementType* data = dataset_.data; 109 | for (size_t i = 0; i < dataset_.rows; ++i, data += dataset_.cols) { 110 | DistanceType dist = distance_(data, vec, dataset_.cols); 111 | resultSet.addPoint(dist, (int)i); 112 | } 113 | } 114 | 115 | IndexParams getParameters() const 116 | { 117 | return index_params_; 118 | } 119 | 120 | private: 121 | /** The dataset */ 122 | const Matrix dataset_; 123 | /** Index parameters */ 124 | IndexParams index_params_; 125 | /** Index distance */ 126 | Distance distance_; 127 | 128 | }; 129 | 130 | } 131 | 132 | #endif // OPENCV_FLANN_LINEAR_INDEX_H_ 133 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/flann/logger.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef OPENCV_FLANN_LOGGER_H 32 | #define OPENCV_FLANN_LOGGER_H 33 | 34 | #include 35 | #include 36 | 37 | #include "defines.h" 38 | 39 | 40 | namespace cvflann 41 | { 42 | 43 | class Logger 44 | { 45 | Logger() : stream(stdout), logLevel(FLANN_LOG_WARN) {} 46 | 47 | ~Logger() 48 | { 49 | if ((stream!=NULL)&&(stream!=stdout)) { 50 | fclose(stream); 51 | } 52 | } 53 | 54 | static Logger& instance() 55 | { 56 | static Logger logger; 57 | return logger; 58 | } 59 | 60 | void _setDestination(const char* name) 61 | { 62 | if (name==NULL) { 63 | stream = stdout; 64 | } 65 | else { 66 | stream = fopen(name,"w"); 67 | if (stream == NULL) { 68 | stream = stdout; 69 | } 70 | } 71 | } 72 | 73 | int _log(int level, const char* fmt, va_list arglist) 74 | { 75 | if (level > logLevel ) return -1; 76 | int ret = vfprintf(stream, fmt, arglist); 77 | return ret; 78 | } 79 | 80 | public: 81 | /** 82 | * Sets the logging level. All messages with lower priority will be ignored. 83 | * @param level Logging level 84 | */ 85 | static void setLevel(int level) { instance().logLevel = level; } 86 | 87 | /** 88 | * Sets the logging destination 89 | * @param name Filename or NULL for console 90 | */ 91 | static void setDestination(const char* name) { instance()._setDestination(name); } 92 | 93 | /** 94 | * Print log message 95 | * @param level Log level 96 | * @param fmt Message format 97 | * @return 98 | */ 99 | static int log(int level, const char* fmt, ...) 100 | { 101 | va_list arglist; 102 | va_start(arglist, fmt); 103 | int ret = instance()._log(level,fmt,arglist); 104 | va_end(arglist); 105 | return ret; 106 | } 107 | 108 | #define LOG_METHOD(NAME,LEVEL) \ 109 | static int NAME(const char* fmt, ...) \ 110 | { \ 111 | va_list ap; \ 112 | va_start(ap, fmt); \ 113 | int ret = instance()._log(LEVEL, fmt, ap); \ 114 | va_end(ap); \ 115 | return ret; \ 116 | } 117 | 118 | LOG_METHOD(fatal, FLANN_LOG_FATAL) 119 | LOG_METHOD(error, FLANN_LOG_ERROR) 120 | LOG_METHOD(warn, FLANN_LOG_WARN) 121 | LOG_METHOD(info, FLANN_LOG_INFO) 122 | 123 | private: 124 | FILE* stream; 125 | int logLevel; 126 | }; 127 | 128 | } 129 | 130 | #endif //OPENCV_FLANN_LOGGER_H 131 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/flann/matrix.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef OPENCV_FLANN_DATASET_H_ 32 | #define OPENCV_FLANN_DATASET_H_ 33 | 34 | #include 35 | 36 | #include "general.h" 37 | 38 | namespace cvflann 39 | { 40 | 41 | /** 42 | * Class that implements a simple rectangular matrix stored in a memory buffer and 43 | * provides convenient matrix-like access using the [] operators. 44 | */ 45 | template 46 | class Matrix 47 | { 48 | public: 49 | typedef T type; 50 | 51 | size_t rows; 52 | size_t cols; 53 | size_t stride; 54 | T* data; 55 | 56 | Matrix() : rows(0), cols(0), stride(0), data(NULL) 57 | { 58 | } 59 | 60 | Matrix(T* data_, size_t rows_, size_t cols_, size_t stride_ = 0) : 61 | rows(rows_), cols(cols_), stride(stride_), data(data_) 62 | { 63 | if (stride==0) stride = cols; 64 | } 65 | 66 | /** 67 | * Convenience function for deallocating the storage data. 68 | */ 69 | FLANN_DEPRECATED void free() 70 | { 71 | fprintf(stderr, "The cvflann::Matrix::free() method is deprecated " 72 | "and it does not do any memory deallocation any more. You are" 73 | "responsible for deallocating the matrix memory (by doing" 74 | "'delete[] matrix.data' for example)"); 75 | } 76 | 77 | /** 78 | * Operator that return a (pointer to a) row of the data. 79 | */ 80 | T* operator[](size_t index) const 81 | { 82 | return data+index*stride; 83 | } 84 | }; 85 | 86 | 87 | class UntypedMatrix 88 | { 89 | public: 90 | size_t rows; 91 | size_t cols; 92 | void* data; 93 | flann_datatype_t type; 94 | 95 | UntypedMatrix(void* data_, long rows_, long cols_) : 96 | rows(rows_), cols(cols_), data(data_) 97 | { 98 | } 99 | 100 | ~UntypedMatrix() 101 | { 102 | } 103 | 104 | 105 | template 106 | Matrix as() 107 | { 108 | return Matrix((T*)data, rows, cols); 109 | } 110 | }; 111 | 112 | 113 | 114 | } 115 | 116 | #endif //OPENCV_FLANN_DATASET_H_ 117 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/flann/object_factory.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef OPENCV_FLANN_OBJECT_FACTORY_H_ 32 | #define OPENCV_FLANN_OBJECT_FACTORY_H_ 33 | 34 | #include 35 | 36 | namespace cvflann 37 | { 38 | 39 | class CreatorNotFound 40 | { 41 | }; 42 | 43 | template 46 | class ObjectFactory 47 | { 48 | typedef ObjectFactory ThisClass; 49 | typedef std::map ObjectRegistry; 50 | 51 | // singleton class, private constructor 52 | ObjectFactory() {} 53 | 54 | public: 55 | 56 | bool subscribe(UniqueIdType id, ObjectCreator creator) 57 | { 58 | if (object_registry.find(id) != object_registry.end()) return false; 59 | 60 | object_registry[id] = creator; 61 | return true; 62 | } 63 | 64 | bool unregister(UniqueIdType id) 65 | { 66 | return object_registry.erase(id) == 1; 67 | } 68 | 69 | ObjectCreator create(UniqueIdType id) 70 | { 71 | typename ObjectRegistry::const_iterator iter = object_registry.find(id); 72 | 73 | if (iter == object_registry.end()) { 74 | throw CreatorNotFound(); 75 | } 76 | 77 | return iter->second; 78 | } 79 | 80 | static ThisClass& instance() 81 | { 82 | static ThisClass the_factory; 83 | return the_factory; 84 | } 85 | private: 86 | ObjectRegistry object_registry; 87 | }; 88 | 89 | } 90 | 91 | #endif /* OPENCV_FLANN_OBJECT_FACTORY_H_ */ 92 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/flann/params.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | *************************************************************************/ 28 | 29 | 30 | #ifndef OPENCV_FLANN_PARAMS_H_ 31 | #define OPENCV_FLANN_PARAMS_H_ 32 | 33 | #include "any.h" 34 | #include "general.h" 35 | #include 36 | #include 37 | 38 | 39 | namespace cvflann 40 | { 41 | 42 | typedef std::map IndexParams; 43 | 44 | struct SearchParams : public IndexParams 45 | { 46 | SearchParams(int checks = 32, float eps = 0, bool sorted = true ) 47 | { 48 | // how many leafs to visit when searching for neighbours (-1 for unlimited) 49 | (*this)["checks"] = checks; 50 | // search for eps-approximate neighbours (default: 0) 51 | (*this)["eps"] = eps; 52 | // only for radius search, require neighbours sorted by distance (default: true) 53 | (*this)["sorted"] = sorted; 54 | } 55 | }; 56 | 57 | 58 | template 59 | T get_param(const IndexParams& params, std::string name, const T& default_value) 60 | { 61 | IndexParams::const_iterator it = params.find(name); 62 | if (it != params.end()) { 63 | return it->second.cast(); 64 | } 65 | else { 66 | return default_value; 67 | } 68 | } 69 | 70 | template 71 | T get_param(const IndexParams& params, std::string name) 72 | { 73 | IndexParams::const_iterator it = params.find(name); 74 | if (it != params.end()) { 75 | return it->second.cast(); 76 | } 77 | else { 78 | throw FLANNException(std::string("Missing parameter '")+name+std::string("' in the parameters given")); 79 | } 80 | } 81 | 82 | inline void print_params(const IndexParams& params) 83 | { 84 | IndexParams::const_iterator it; 85 | 86 | for(it=params.begin(); it!=params.end(); ++it) { 87 | std::cout << it->first << " : " << it->second << std::endl; 88 | } 89 | } 90 | 91 | 92 | 93 | } 94 | 95 | 96 | #endif /* OPENCV_FLANN_PARAMS_H_ */ 97 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/flann/random.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * THE BSD LICENSE 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | *************************************************************************/ 30 | 31 | #ifndef OPENCV_FLANN_RANDOM_H 32 | #define OPENCV_FLANN_RANDOM_H 33 | 34 | #include 35 | #include 36 | #include 37 | 38 | #include "general.h" 39 | 40 | namespace cvflann 41 | { 42 | 43 | /** 44 | * Seeds the random number generator 45 | * @param seed Random seed 46 | */ 47 | inline void seed_random(unsigned int seed) 48 | { 49 | srand(seed); 50 | } 51 | 52 | /* 53 | * Generates a random double value. 54 | */ 55 | /** 56 | * Generates a random double value. 57 | * @param high Upper limit 58 | * @param low Lower limit 59 | * @return Random double value 60 | */ 61 | inline double rand_double(double high = 1.0, double low = 0) 62 | { 63 | return low + ((high-low) * (std::rand() / (RAND_MAX + 1.0))); 64 | } 65 | 66 | /** 67 | * Generates a random integer value. 68 | * @param high Upper limit 69 | * @param low Lower limit 70 | * @return Random integer value 71 | */ 72 | inline int rand_int(int high = RAND_MAX, int low = 0) 73 | { 74 | return low + (int) ( double(high-low) * (std::rand() / (RAND_MAX + 1.0))); 75 | } 76 | 77 | /** 78 | * Random number generator that returns a distinct number from 79 | * the [0,n) interval each time. 80 | */ 81 | class UniqueRandom 82 | { 83 | std::vector vals_; 84 | int size_; 85 | int counter_; 86 | 87 | public: 88 | /** 89 | * Constructor. 90 | * @param n Size of the interval from which to generate 91 | * @return 92 | */ 93 | UniqueRandom(int n) 94 | { 95 | init(n); 96 | } 97 | 98 | /** 99 | * Initializes the number generator. 100 | * @param n the size of the interval from which to generate random numbers. 101 | */ 102 | void init(int n) 103 | { 104 | // create and initialize an array of size n 105 | vals_.resize(n); 106 | size_ = n; 107 | for (int i = 0; i < size_; ++i) vals_[i] = i; 108 | 109 | // shuffle the elements in the array 110 | std::random_shuffle(vals_.begin(), vals_.end()); 111 | 112 | counter_ = 0; 113 | } 114 | 115 | /** 116 | * Return a distinct random integer in greater or equal to 0 and less 117 | * than 'n' on each call. It should be called maximum 'n' times. 118 | * Returns: a random integer 119 | */ 120 | int next() 121 | { 122 | if (counter_ == size_) { 123 | return -1; 124 | } 125 | else { 126 | return vals_[counter_++]; 127 | } 128 | } 129 | }; 130 | 131 | } 132 | 133 | #endif //OPENCV_FLANN_RANDOM_H 134 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/flann/sampling.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | *************************************************************************/ 28 | 29 | 30 | #ifndef OPENCV_FLANN_SAMPLING_H_ 31 | #define OPENCV_FLANN_SAMPLING_H_ 32 | 33 | #include "matrix.h" 34 | #include "random.h" 35 | 36 | namespace cvflann 37 | { 38 | 39 | template 40 | Matrix random_sample(Matrix& srcMatrix, long size, bool remove = false) 41 | { 42 | Matrix newSet(new T[size * srcMatrix.cols], size,srcMatrix.cols); 43 | 44 | T* src,* dest; 45 | for (long i=0; i 63 | Matrix random_sample(const Matrix& srcMatrix, size_t size) 64 | { 65 | UniqueRandom rand((int)srcMatrix.rows); 66 | Matrix newSet(new T[size * srcMatrix.cols], size,srcMatrix.cols); 67 | 68 | T* src,* dest; 69 | for (size_t i=0; i 35 | 36 | 37 | namespace cvflann 38 | { 39 | 40 | /** 41 | * A start-stop timer class. 42 | * 43 | * Can be used to time portions of code. 44 | */ 45 | class StartStopTimer 46 | { 47 | clock_t startTime; 48 | 49 | public: 50 | /** 51 | * Value of the timer. 52 | */ 53 | double value; 54 | 55 | 56 | /** 57 | * Constructor. 58 | */ 59 | StartStopTimer() 60 | { 61 | reset(); 62 | } 63 | 64 | /** 65 | * Starts the timer. 66 | */ 67 | void start() 68 | { 69 | startTime = clock(); 70 | } 71 | 72 | /** 73 | * Stops the timer and updates timer value. 74 | */ 75 | void stop() 76 | { 77 | clock_t stopTime = clock(); 78 | value += ( (double)stopTime - startTime) / CLOCKS_PER_SEC; 79 | } 80 | 81 | /** 82 | * Resets the timer value to 0. 83 | */ 84 | void reset() 85 | { 86 | value = 0; 87 | } 88 | 89 | }; 90 | 91 | } 92 | 93 | #endif // FLANN_TIMER_H 94 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/highgui/cap_ios.h: -------------------------------------------------------------------------------- 1 | /* For iOS video I/O 2 | * by Eduard Feicho on 29/07/12 3 | * Copyright 2012. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 19 | * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 22 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 23 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 24 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 25 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | * 27 | */ 28 | 29 | #import 30 | #import 31 | #import 32 | #import 33 | #include "opencv2/core/core.hpp" 34 | 35 | /////////////////////////////////////// CvAbstractCamera ///////////////////////////////////// 36 | 37 | @class CvAbstractCamera; 38 | 39 | @interface CvAbstractCamera : NSObject 40 | { 41 | AVCaptureSession* captureSession; 42 | AVCaptureConnection* videoCaptureConnection; 43 | AVCaptureVideoPreviewLayer *captureVideoPreviewLayer; 44 | 45 | UIDeviceOrientation currentDeviceOrientation; 46 | 47 | BOOL cameraAvailable; 48 | BOOL captureSessionLoaded; 49 | BOOL running; 50 | BOOL useAVCaptureVideoPreviewLayer; 51 | 52 | AVCaptureDevicePosition defaultAVCaptureDevicePosition; 53 | AVCaptureVideoOrientation defaultAVCaptureVideoOrientation; 54 | NSString *const defaultAVCaptureSessionPreset; 55 | 56 | int defaultFPS; 57 | 58 | UIView* parentView; 59 | 60 | int imageWidth; 61 | int imageHeight; 62 | } 63 | 64 | @property (nonatomic, retain) AVCaptureSession* captureSession; 65 | @property (nonatomic, retain) AVCaptureConnection* videoCaptureConnection; 66 | 67 | @property (nonatomic, readonly) BOOL running; 68 | @property (nonatomic, readonly) BOOL captureSessionLoaded; 69 | 70 | @property (nonatomic, assign) int defaultFPS; 71 | @property (nonatomic, assign) AVCaptureDevicePosition defaultAVCaptureDevicePosition; 72 | @property (nonatomic, assign) AVCaptureVideoOrientation defaultAVCaptureVideoOrientation; 73 | @property (nonatomic, assign) BOOL useAVCaptureVideoPreviewLayer; 74 | @property (nonatomic, strong) NSString *const defaultAVCaptureSessionPreset; 75 | 76 | @property (nonatomic, assign) int imageWidth; 77 | @property (nonatomic, assign) int imageHeight; 78 | 79 | @property (nonatomic, retain) UIView* parentView; 80 | 81 | - (void)start; 82 | - (void)stop; 83 | - (void)switchCameras; 84 | 85 | - (id)initWithParentView:(UIView*)parent; 86 | 87 | - (void)createCaptureOutput; 88 | - (void)createVideoPreviewLayer; 89 | - (void)updateOrientation; 90 | 91 | - (void)lockFocus; 92 | - (void)unlockFocus; 93 | - (void)lockExposure; 94 | - (void)unlockExposure; 95 | - (void)lockBalance; 96 | - (void)unlockBalance; 97 | 98 | @end 99 | 100 | ///////////////////////////////// CvVideoCamera /////////////////////////////////////////// 101 | 102 | @class CvVideoCamera; 103 | 104 | @protocol CvVideoCameraDelegate 105 | 106 | #ifdef __cplusplus 107 | // delegate method for processing image frames 108 | - (void)processImage:(cv::Mat&)image; 109 | #endif 110 | 111 | @end 112 | 113 | @interface CvVideoCamera : CvAbstractCamera 114 | { 115 | AVCaptureVideoDataOutput *videoDataOutput; 116 | 117 | dispatch_queue_t videoDataOutputQueue; 118 | CALayer *customPreviewLayer; 119 | 120 | BOOL grayscaleMode; 121 | 122 | BOOL recordVideo; 123 | BOOL rotateVideo; 124 | AVAssetWriterInput* recordAssetWriterInput; 125 | AVAssetWriterInputPixelBufferAdaptor* recordPixelBufferAdaptor; 126 | AVAssetWriter* recordAssetWriter; 127 | 128 | CMTime lastSampleTime; 129 | 130 | } 131 | 132 | @property (nonatomic, assign) id delegate; 133 | @property (nonatomic, assign) BOOL grayscaleMode; 134 | 135 | @property (nonatomic, assign) BOOL recordVideo; 136 | @property (nonatomic, assign) BOOL rotateVideo; 137 | @property (nonatomic, retain) AVAssetWriterInput* recordAssetWriterInput; 138 | @property (nonatomic, retain) AVAssetWriterInputPixelBufferAdaptor* recordPixelBufferAdaptor; 139 | @property (nonatomic, retain) AVAssetWriter* recordAssetWriter; 140 | 141 | - (void)adjustLayoutToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation; 142 | - (void)layoutPreviewLayer; 143 | - (void)saveVideo; 144 | - (NSURL *)videoFileURL; 145 | 146 | 147 | @end 148 | 149 | ///////////////////////////////// CvPhotoCamera /////////////////////////////////////////// 150 | 151 | @class CvPhotoCamera; 152 | 153 | @protocol CvPhotoCameraDelegate 154 | 155 | - (void)photoCamera:(CvPhotoCamera*)photoCamera capturedImage:(UIImage *)image; 156 | - (void)photoCameraCancel:(CvPhotoCamera*)photoCamera; 157 | 158 | @end 159 | 160 | @interface CvPhotoCamera : CvAbstractCamera 161 | { 162 | AVCaptureStillImageOutput *stillImageOutput; 163 | } 164 | 165 | @property (nonatomic, assign) id delegate; 166 | 167 | - (void)takePicture; 168 | 169 | @end 170 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/highgui/ios.h: -------------------------------------------------------------------------------- 1 | 2 | /*M/////////////////////////////////////////////////////////////////////////////////////// 3 | // 4 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 5 | // 6 | // By downloading, copying, installing or using the software you agree to this license. 7 | // If you do not agree to this license, do not download, install, 8 | // copy or use the software. 9 | // 10 | // 11 | // License Agreement 12 | // For Open Source Computer Vision Library 13 | // 14 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 15 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #include "opencv2/core/core.hpp" 45 | #import "opencv2/highgui/cap_ios.h" 46 | 47 | UIImage* MatToUIImage(const cv::Mat& image); 48 | void UIImageToMat(const UIImage* image, 49 | cv::Mat& m, bool alphaExist = false); 50 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/legacy/streams.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // Intel License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000, Intel Corporation, all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of Intel Corporation may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the Intel Corporation or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | #ifndef __OPENCV_CVSTREAMS_H__ 43 | #define __OPENCV_CVSTREAMS_H__ 44 | 45 | #ifdef WIN32 46 | #include /* !!! IF YOU'VE GOT AN ERROR HERE, PLEASE READ BELOW !!! */ 47 | /***************** How to get Visual Studio understand streams.h ****************\ 48 | 49 | You need DirectShow SDK that is now a part of Platform SDK 50 | (Windows Server 2003 SP1 SDK or later), 51 | and DirectX SDK (2006 April or later). 52 | 53 | 1. Download the Platform SDK from 54 | http://www.microsoft.com/msdownload/platformsdk/sdkupdate/ 55 | and DirectX SDK from msdn.microsoft.com/directx/ 56 | (They are huge, but you can download it by parts). 57 | If it doesn't work for you, consider HighGUI that can capture video via VFW or MIL 58 | 59 | 2. Install Platform SDK together with DirectShow SDK. 60 | Install DirectX (with or without sample code). 61 | 62 | 3. Build baseclasses. 63 | See \samples\multimedia\directshow\readme.txt. 64 | 65 | 4. Copy the built libraries (called strmbase.lib and strmbasd.lib 66 | in Release and Debug versions, respectively) to 67 | \lib. 68 | 69 | 5. In Developer Studio add the following paths: 70 | \include 71 | \include 72 | \samples\multimedia\directshow\baseclasses 73 | to the includes' search path 74 | (at Tools->Options->Directories->Include files in case of Visual Studio 6.0, 75 | at Tools->Options->Projects and Solutions->VC++ Directories->Include files in case 76 | of Visual Studio 2005) 77 | Add 78 | \lib 79 | \lib 80 | to the libraries' search path (in the same dialog, ...->"Library files" page) 81 | 82 | NOTE: PUT THE ADDED LINES ON THE VERY TOP OF THE LISTS, OTHERWISE YOU MAY STILL GET 83 | COMPILER OR LINKER ERRORS. This is necessary, because Visual Studio 84 | may include older versions of the same headers and libraries. 85 | 86 | 6. Now you can build OpenCV DirectShow filters. 87 | 88 | \***********************************************************************************/ 89 | 90 | #endif 91 | 92 | #endif 93 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/nonfree/gpu.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_NONFREE_GPU_HPP__ 44 | #define __OPENCV_NONFREE_GPU_HPP__ 45 | 46 | #include "opencv2/opencv_modules.hpp" 47 | 48 | #if defined(HAVE_OPENCV_GPU) && !defined(ANDROID) 49 | 50 | #include "opencv2/gpu/gpu.hpp" 51 | 52 | namespace cv { namespace gpu { 53 | 54 | class CV_EXPORTS SURF_GPU 55 | { 56 | public: 57 | enum KeypointLayout 58 | { 59 | X_ROW = 0, 60 | Y_ROW, 61 | LAPLACIAN_ROW, 62 | OCTAVE_ROW, 63 | SIZE_ROW, 64 | ANGLE_ROW, 65 | HESSIAN_ROW, 66 | ROWS_COUNT 67 | }; 68 | 69 | //! the default constructor 70 | SURF_GPU(); 71 | //! the full constructor taking all the necessary parameters 72 | explicit SURF_GPU(double _hessianThreshold, int _nOctaves=4, 73 | int _nOctaveLayers=2, bool _extended=false, float _keypointsRatio=0.01f, bool _upright = false); 74 | 75 | //! returns the descriptor size in float's (64 or 128) 76 | int descriptorSize() const; 77 | 78 | //! upload host keypoints to device memory 79 | void uploadKeypoints(const std::vector& keypoints, GpuMat& keypointsGPU); 80 | //! download keypoints from device to host memory 81 | void downloadKeypoints(const GpuMat& keypointsGPU, std::vector& keypoints); 82 | 83 | //! download descriptors from device to host memory 84 | void downloadDescriptors(const GpuMat& descriptorsGPU, std::vector& descriptors); 85 | 86 | //! finds the keypoints using fast hessian detector used in SURF 87 | //! supports CV_8UC1 images 88 | //! keypoints will have nFeature cols and 6 rows 89 | //! keypoints.ptr(X_ROW)[i] will contain x coordinate of i'th feature 90 | //! keypoints.ptr(Y_ROW)[i] will contain y coordinate of i'th feature 91 | //! keypoints.ptr(LAPLACIAN_ROW)[i] will contain laplacian sign of i'th feature 92 | //! keypoints.ptr(OCTAVE_ROW)[i] will contain octave of i'th feature 93 | //! keypoints.ptr(SIZE_ROW)[i] will contain size of i'th feature 94 | //! keypoints.ptr(ANGLE_ROW)[i] will contain orientation of i'th feature 95 | //! keypoints.ptr(HESSIAN_ROW)[i] will contain response of i'th feature 96 | void operator()(const GpuMat& img, const GpuMat& mask, GpuMat& keypoints); 97 | //! finds the keypoints and computes their descriptors. 98 | //! Optionally it can compute descriptors for the user-provided keypoints and recompute keypoints direction 99 | void operator()(const GpuMat& img, const GpuMat& mask, GpuMat& keypoints, GpuMat& descriptors, 100 | bool useProvidedKeypoints = false); 101 | 102 | void operator()(const GpuMat& img, const GpuMat& mask, std::vector& keypoints); 103 | void operator()(const GpuMat& img, const GpuMat& mask, std::vector& keypoints, GpuMat& descriptors, 104 | bool useProvidedKeypoints = false); 105 | 106 | void operator()(const GpuMat& img, const GpuMat& mask, std::vector& keypoints, std::vector& descriptors, 107 | bool useProvidedKeypoints = false); 108 | 109 | void releaseMemory(); 110 | 111 | // SURF parameters 112 | double hessianThreshold; 113 | int nOctaves; 114 | int nOctaveLayers; 115 | bool extended; 116 | bool upright; 117 | 118 | //! max keypoints = min(keypointsRatio * img.size().area(), 65535) 119 | float keypointsRatio; 120 | 121 | GpuMat sum, mask1, maskSum, intBuffer; 122 | 123 | GpuMat det, trace; 124 | 125 | GpuMat maxPosBuffer; 126 | }; 127 | 128 | } // namespace gpu 129 | 130 | } // namespace cv 131 | 132 | #endif // defined(HAVE_OPENCV_GPU) 133 | 134 | #endif // __OPENCV_NONFREE_GPU_HPP__ 135 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/nonfree/nonfree.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2012, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_NONFREE_HPP__ 44 | #define __OPENCV_NONFREE_HPP__ 45 | 46 | #include "opencv2/nonfree/features2d.hpp" 47 | 48 | namespace cv 49 | { 50 | 51 | CV_EXPORTS_W bool initModule_nonfree(); 52 | 53 | } 54 | 55 | #endif 56 | 57 | /* End of file. */ 58 | -------------------------------------------------------------------------------- /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/core_c.h" 47 | #include "opencv2/core/core.hpp" 48 | #include "opencv2/flann/miniflann.hpp" 49 | #include "opencv2/imgproc/imgproc_c.h" 50 | #include "opencv2/imgproc/imgproc.hpp" 51 | #include "opencv2/photo/photo.hpp" 52 | #include "opencv2/video/video.hpp" 53 | #include "opencv2/features2d/features2d.hpp" 54 | #include "opencv2/objdetect/objdetect.hpp" 55 | #include "opencv2/calib3d/calib3d.hpp" 56 | #include "opencv2/ml/ml.hpp" 57 | #include "opencv2/highgui/highgui_c.h" 58 | #include "opencv2/highgui/highgui.hpp" 59 | #include "opencv2/contrib/contrib.hpp" 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /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_CONTRIB 11 | #define HAVE_OPENCV_CORE 12 | #define HAVE_OPENCV_FEATURES2D 13 | #define HAVE_OPENCV_FLANN 14 | #define HAVE_OPENCV_HIGHGUI 15 | #define HAVE_OPENCV_IMGPROC 16 | #define HAVE_OPENCV_LEGACY 17 | #define HAVE_OPENCV_ML 18 | #define HAVE_OPENCV_NONFREE 19 | #define HAVE_OPENCV_OBJDETECT 20 | #define HAVE_OPENCV_PHOTO 21 | #define HAVE_OPENCV_STITCHING 22 | #define HAVE_OPENCV_VIDEO 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) 2008-2012, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_PHOTO_HPP__ 44 | #define __OPENCV_PHOTO_HPP__ 45 | 46 | #include "opencv2/core/core.hpp" 47 | #include "opencv2/imgproc/imgproc.hpp" 48 | 49 | #include "opencv2/photo/photo_c.h" 50 | 51 | #ifdef __cplusplus 52 | 53 | /*! \namespace cv 54 | Namespace where all the C++ OpenCV functionality resides 55 | */ 56 | namespace cv 57 | { 58 | 59 | //! the inpainting algorithm 60 | enum 61 | { 62 | INPAINT_NS=CV_INPAINT_NS, // Navier-Stokes algorithm 63 | INPAINT_TELEA=CV_INPAINT_TELEA // A. Telea algorithm 64 | }; 65 | 66 | //! restores the damaged image areas using one of the available intpainting algorithms 67 | CV_EXPORTS_W void inpaint( InputArray src, InputArray inpaintMask, 68 | OutputArray dst, double inpaintRadius, int flags ); 69 | 70 | 71 | CV_EXPORTS_W void fastNlMeansDenoising( InputArray src, OutputArray dst, float h = 3, 72 | int templateWindowSize = 7, int searchWindowSize = 21); 73 | 74 | CV_EXPORTS_W void fastNlMeansDenoisingColored( InputArray src, OutputArray dst, 75 | float h = 3, float hColor = 3, 76 | int templateWindowSize = 7, int searchWindowSize = 21); 77 | 78 | CV_EXPORTS_W void fastNlMeansDenoisingMulti( InputArrayOfArrays srcImgs, OutputArray dst, 79 | int imgToDenoiseIndex, int temporalWindowSize, 80 | float h = 3, int templateWindowSize = 7, int searchWindowSize = 21); 81 | 82 | CV_EXPORTS_W void fastNlMeansDenoisingColoredMulti( InputArrayOfArrays srcImgs, OutputArray dst, 83 | int imgToDenoiseIndex, int temporalWindowSize, 84 | float h = 3, float hColor = 3, 85 | int templateWindowSize = 7, int searchWindowSize = 21); 86 | 87 | } 88 | 89 | #endif //__cplusplus 90 | 91 | #endif 92 | -------------------------------------------------------------------------------- /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/stitching/detail/autocalib.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_STITCHING_AUTOCALIB_HPP__ 44 | #define __OPENCV_STITCHING_AUTOCALIB_HPP__ 45 | 46 | #include "opencv2/core/core.hpp" 47 | #include "matchers.hpp" 48 | 49 | namespace cv { 50 | namespace detail { 51 | 52 | // See "Construction of Panoramic Image Mosaics with Global and Local Alignment" 53 | // by Heung-Yeung Shum and Richard Szeliski. 54 | void CV_EXPORTS focalsFromHomography(const Mat &H, double &f0, double &f1, bool &f0_ok, bool &f1_ok); 55 | 56 | void CV_EXPORTS estimateFocal(const std::vector &features, 57 | const std::vector &pairwise_matches, 58 | std::vector &focals); 59 | 60 | bool CV_EXPORTS calibrateRotatingCamera(const std::vector &Hs, Mat &K); 61 | 62 | } // namespace detail 63 | } // namespace cv 64 | 65 | #endif // __OPENCV_STITCHING_AUTOCALIB_HPP__ 66 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/stitching/detail/blenders.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_STITCHING_BLENDERS_HPP__ 44 | #define __OPENCV_STITCHING_BLENDERS_HPP__ 45 | 46 | #include "opencv2/core/core.hpp" 47 | 48 | namespace cv { 49 | namespace detail { 50 | 51 | 52 | // Simple blender which puts one image over another 53 | class CV_EXPORTS Blender 54 | { 55 | public: 56 | virtual ~Blender() {} 57 | 58 | enum { NO, FEATHER, MULTI_BAND }; 59 | static Ptr createDefault(int type, bool try_gpu = false); 60 | 61 | void prepare(const std::vector &corners, const std::vector &sizes); 62 | virtual void prepare(Rect dst_roi); 63 | virtual void feed(const Mat &img, const Mat &mask, Point tl); 64 | virtual void blend(Mat &dst, Mat &dst_mask); 65 | 66 | protected: 67 | Mat dst_, dst_mask_; 68 | Rect dst_roi_; 69 | }; 70 | 71 | 72 | class CV_EXPORTS FeatherBlender : public Blender 73 | { 74 | public: 75 | FeatherBlender(float sharpness = 0.02f); 76 | 77 | float sharpness() const { return sharpness_; } 78 | void setSharpness(float val) { sharpness_ = val; } 79 | 80 | void prepare(Rect dst_roi); 81 | void feed(const Mat &img, const Mat &mask, Point tl); 82 | void blend(Mat &dst, Mat &dst_mask); 83 | 84 | // Creates weight maps for fixed set of source images by their masks and top-left corners. 85 | // Final image can be obtained by simple weighting of the source images. 86 | Rect createWeightMaps(const std::vector &masks, const std::vector &corners, 87 | std::vector &weight_maps); 88 | 89 | private: 90 | float sharpness_; 91 | Mat weight_map_; 92 | Mat dst_weight_map_; 93 | }; 94 | 95 | inline FeatherBlender::FeatherBlender(float _sharpness) { setSharpness(_sharpness); } 96 | 97 | 98 | class CV_EXPORTS MultiBandBlender : public Blender 99 | { 100 | public: 101 | MultiBandBlender(int try_gpu = false, int num_bands = 5, int weight_type = CV_32F); 102 | 103 | int numBands() const { return actual_num_bands_; } 104 | void setNumBands(int val) { actual_num_bands_ = val; } 105 | 106 | void prepare(Rect dst_roi); 107 | void feed(const Mat &img, const Mat &mask, Point tl); 108 | void blend(Mat &dst, Mat &dst_mask); 109 | 110 | private: 111 | int actual_num_bands_, num_bands_; 112 | std::vector dst_pyr_laplace_; 113 | std::vector dst_band_weights_; 114 | Rect dst_roi_final_; 115 | bool can_use_gpu_; 116 | int weight_type_; //CV_32F or CV_16S 117 | }; 118 | 119 | 120 | ////////////////////////////////////////////////////////////////////////////// 121 | // Auxiliary functions 122 | 123 | void CV_EXPORTS normalizeUsingWeightMap(const Mat& weight, Mat& src); 124 | 125 | void CV_EXPORTS createWeightMap(const Mat& mask, float sharpness, Mat& weight); 126 | 127 | void CV_EXPORTS createLaplacePyr(const Mat &img, int num_levels, std::vector& pyr); 128 | void CV_EXPORTS createLaplacePyrGpu(const Mat &img, int num_levels, std::vector& pyr); 129 | 130 | // Restores source image 131 | void CV_EXPORTS restoreImageFromLaplacePyr(std::vector& pyr); 132 | void CV_EXPORTS restoreImageFromLaplacePyrGpu(std::vector& pyr); 133 | 134 | } // namespace detail 135 | } // namespace cv 136 | 137 | #endif // __OPENCV_STITCHING_BLENDERS_HPP__ 138 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/stitching/detail/camera.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_STITCHING_CAMERA_HPP__ 44 | #define __OPENCV_STITCHING_CAMERA_HPP__ 45 | 46 | #include "opencv2/core/core.hpp" 47 | 48 | namespace cv { 49 | namespace detail { 50 | 51 | struct CV_EXPORTS CameraParams 52 | { 53 | CameraParams(); 54 | CameraParams(const CameraParams& other); 55 | const CameraParams& operator =(const CameraParams& other); 56 | Mat K() const; 57 | 58 | double focal; // Focal length 59 | double aspect; // Aspect ratio 60 | double ppx; // Principal point X 61 | double ppy; // Principal point Y 62 | Mat R; // Rotation 63 | Mat t; // Translation 64 | }; 65 | 66 | } // namespace detail 67 | } // namespace cv 68 | 69 | #endif // #ifndef __OPENCV_STITCHING_CAMERA_HPP__ 70 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/stitching/detail/exposure_compensate.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_STITCHING_EXPOSURE_COMPENSATE_HPP__ 44 | #define __OPENCV_STITCHING_EXPOSURE_COMPENSATE_HPP__ 45 | 46 | #include "opencv2/core/core.hpp" 47 | 48 | namespace cv { 49 | namespace detail { 50 | 51 | class CV_EXPORTS ExposureCompensator 52 | { 53 | public: 54 | virtual ~ExposureCompensator() {} 55 | 56 | enum { NO, GAIN, GAIN_BLOCKS }; 57 | static Ptr createDefault(int type); 58 | 59 | void feed(const std::vector &corners, const std::vector &images, 60 | const std::vector &masks); 61 | virtual void feed(const std::vector &corners, const std::vector &images, 62 | const std::vector > &masks) = 0; 63 | virtual void apply(int index, Point corner, Mat &image, const Mat &mask) = 0; 64 | }; 65 | 66 | 67 | class CV_EXPORTS NoExposureCompensator : public ExposureCompensator 68 | { 69 | public: 70 | void feed(const std::vector &/*corners*/, const std::vector &/*images*/, 71 | const std::vector > &/*masks*/) {}; 72 | void apply(int /*index*/, Point /*corner*/, Mat &/*image*/, const Mat &/*mask*/) {}; 73 | }; 74 | 75 | 76 | class CV_EXPORTS GainCompensator : public ExposureCompensator 77 | { 78 | public: 79 | void feed(const std::vector &corners, const std::vector &images, 80 | const std::vector > &masks); 81 | void apply(int index, Point corner, Mat &image, const Mat &mask); 82 | std::vector gains() const; 83 | 84 | private: 85 | Mat_ gains_; 86 | }; 87 | 88 | 89 | class CV_EXPORTS BlocksGainCompensator : public ExposureCompensator 90 | { 91 | public: 92 | BlocksGainCompensator(int bl_width = 32, int bl_height = 32) 93 | : bl_width_(bl_width), bl_height_(bl_height) {} 94 | void feed(const std::vector &corners, const std::vector &images, 95 | const std::vector > &masks); 96 | void apply(int index, Point corner, Mat &image, const Mat &mask); 97 | 98 | private: 99 | int bl_width_, bl_height_; 100 | std::vector > gain_maps_; 101 | }; 102 | 103 | } // namespace detail 104 | } // namespace cv 105 | 106 | #endif // __OPENCV_STITCHING_EXPOSURE_COMPENSATE_HPP__ 107 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/stitching/detail/util_inl.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_STITCHING_UTIL_INL_HPP__ 44 | #define __OPENCV_STITCHING_UTIL_INL_HPP__ 45 | 46 | #include 47 | #include "opencv2/core/core.hpp" 48 | #include "util.hpp" // Make your IDE see declarations 49 | 50 | namespace cv { 51 | namespace detail { 52 | 53 | template 54 | B Graph::forEach(B body) const 55 | { 56 | for (int i = 0; i < numVertices(); ++i) 57 | { 58 | std::list::const_iterator edge = edges_[i].begin(); 59 | for (; edge != edges_[i].end(); ++edge) 60 | body(*edge); 61 | } 62 | return body; 63 | } 64 | 65 | 66 | template 67 | B Graph::walkBreadthFirst(int from, B body) const 68 | { 69 | std::vector was(numVertices(), false); 70 | std::queue vertices; 71 | 72 | was[from] = true; 73 | vertices.push(from); 74 | 75 | while (!vertices.empty()) 76 | { 77 | int vertex = vertices.front(); 78 | vertices.pop(); 79 | 80 | std::list::const_iterator edge = edges_[vertex].begin(); 81 | for (; edge != edges_[vertex].end(); ++edge) 82 | { 83 | if (!was[edge->to]) 84 | { 85 | body(*edge); 86 | was[edge->to] = true; 87 | vertices.push(edge->to); 88 | } 89 | } 90 | } 91 | 92 | return body; 93 | } 94 | 95 | 96 | ////////////////////////////////////////////////////////////////////////////// 97 | // Some auxiliary math functions 98 | 99 | static inline 100 | float normL2(const Point3f& a) 101 | { 102 | return a.x * a.x + a.y * a.y + a.z * a.z; 103 | } 104 | 105 | 106 | static inline 107 | float normL2(const Point3f& a, const Point3f& b) 108 | { 109 | return normL2(a - b); 110 | } 111 | 112 | 113 | static inline 114 | double normL2sq(const Mat &r) 115 | { 116 | return r.dot(r); 117 | } 118 | 119 | 120 | static inline int sqr(int x) { return x * x; } 121 | static inline float sqr(float x) { return x * x; } 122 | static inline double sqr(double x) { return x * x; } 123 | 124 | } // namespace detail 125 | } // namespace cv 126 | 127 | #endif // __OPENCV_STITCHING_UTIL_INL_HPP__ 128 | -------------------------------------------------------------------------------- /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 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_VIDEO_HPP__ 44 | #define __OPENCV_VIDEO_HPP__ 45 | 46 | #include "opencv2/video/tracking.hpp" 47 | #include "opencv2/video/background_segm.hpp" 48 | 49 | #ifdef __cplusplus 50 | namespace cv 51 | { 52 | 53 | CV_EXPORTS bool initModule_video(void); 54 | 55 | } 56 | #endif 57 | 58 | #endif //__OPENCV_VIDEO_HPP__ 59 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/videostab/deblurring.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_DEBLURRING_HPP__ 44 | #define __OPENCV_VIDEOSTAB_DEBLURRING_HPP__ 45 | 46 | #include 47 | #include "opencv2/core/core.hpp" 48 | 49 | namespace cv 50 | { 51 | namespace videostab 52 | { 53 | 54 | CV_EXPORTS float calcBlurriness(const Mat &frame); 55 | 56 | class CV_EXPORTS DeblurerBase 57 | { 58 | public: 59 | DeblurerBase() : radius_(0), frames_(0), motions_(0) {} 60 | 61 | virtual ~DeblurerBase() {} 62 | 63 | virtual void setRadius(int val) { radius_ = val; } 64 | virtual int radius() const { return radius_; } 65 | 66 | virtual void setFrames(const std::vector &val) { frames_ = &val; } 67 | virtual const std::vector& frames() const { return *frames_; } 68 | 69 | virtual void setMotions(const std::vector &val) { motions_ = &val; } 70 | virtual const std::vector& motions() const { return *motions_; } 71 | 72 | virtual void setBlurrinessRates(const std::vector &val) { blurrinessRates_ = &val; } 73 | virtual const std::vector& blurrinessRates() const { return *blurrinessRates_; } 74 | 75 | virtual void update() {} 76 | 77 | virtual void deblur(int idx, Mat &frame) = 0; 78 | 79 | protected: 80 | int radius_; 81 | const std::vector *frames_; 82 | const std::vector *motions_; 83 | const std::vector *blurrinessRates_; 84 | }; 85 | 86 | class CV_EXPORTS NullDeblurer : public DeblurerBase 87 | { 88 | public: 89 | virtual void deblur(int /*idx*/, Mat &/*frame*/) {} 90 | }; 91 | 92 | class CV_EXPORTS WeightingDeblurer : public DeblurerBase 93 | { 94 | public: 95 | WeightingDeblurer(); 96 | 97 | void setSensitivity(float val) { sensitivity_ = val; } 98 | float sensitivity() const { return sensitivity_; } 99 | 100 | virtual void deblur(int idx, Mat &frame); 101 | 102 | private: 103 | float sensitivity_; 104 | Mat_ bSum_, gSum_, rSum_, wSum_; 105 | }; 106 | 107 | } // namespace videostab 108 | } // namespace cv 109 | 110 | #endif 111 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/videostab/fast_marching.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_VIDEOSTAB_FAST_MARCHING_HPP__ 44 | #define __OPENCV_VIDEOSTAB_FAST_MARCHING_HPP__ 45 | 46 | #include 47 | #include 48 | #include 49 | #include "opencv2/core/core.hpp" 50 | 51 | namespace cv 52 | { 53 | namespace videostab 54 | { 55 | 56 | // See http://iwi.eldoc.ub.rug.nl/FILES/root/2004/JGraphToolsTelea/2004JGraphToolsTelea.pdf 57 | class CV_EXPORTS FastMarchingMethod 58 | { 59 | public: 60 | FastMarchingMethod() : inf_(1e6f) {} 61 | 62 | template 63 | Inpaint run(const Mat &mask, Inpaint inpaint); 64 | 65 | Mat distanceMap() const { return dist_; } 66 | 67 | private: 68 | enum { INSIDE = 0, BAND = 1, KNOWN = 255 }; 69 | 70 | struct DXY 71 | { 72 | float dist; 73 | int x, y; 74 | 75 | DXY() : dist(0), x(0), y(0) {} 76 | DXY(float _dist, int _x, int _y) : dist(_dist), x(_x), y(_y) {} 77 | bool operator <(const DXY &dxy) const { return dist < dxy.dist; } 78 | }; 79 | 80 | float solve(int x1, int y1, int x2, int y2) const; 81 | int& indexOf(const DXY &dxy) { return index_(dxy.y, dxy.x); } 82 | 83 | void heapUp(int idx); 84 | void heapDown(int idx); 85 | void heapAdd(const DXY &dxy); 86 | void heapRemoveMin(); 87 | 88 | float inf_; 89 | 90 | cv::Mat_ flag_; // flag map 91 | cv::Mat_ dist_; // distance map 92 | 93 | cv::Mat_ index_; // index of point in the narrow band 94 | std::vector narrowBand_; // narrow band heap 95 | int size_; // narrow band size 96 | }; 97 | 98 | } // namespace videostab 99 | } // namespace cv 100 | 101 | #include "fast_marching_inl.hpp" 102 | 103 | #endif 104 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/videostab/frame_source.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_VIDEOSTAB_FRAME_SOURCE_HPP__ 44 | #define __OPENCV_VIDEOSTAB_FRAME_SOURCE_HPP__ 45 | 46 | #include 47 | #include 48 | #include "opencv2/core/core.hpp" 49 | #include "opencv2/highgui/highgui.hpp" 50 | 51 | namespace cv 52 | { 53 | namespace videostab 54 | { 55 | 56 | class CV_EXPORTS IFrameSource 57 | { 58 | public: 59 | virtual ~IFrameSource() {} 60 | virtual void reset() = 0; 61 | virtual Mat nextFrame() = 0; 62 | }; 63 | 64 | class CV_EXPORTS NullFrameSource : public IFrameSource 65 | { 66 | public: 67 | virtual void reset() {} 68 | virtual Mat nextFrame() { return Mat(); } 69 | }; 70 | 71 | class CV_EXPORTS VideoFileSource : public IFrameSource 72 | { 73 | public: 74 | VideoFileSource(const std::string &path, bool volatileFrame = false); 75 | 76 | virtual void reset(); 77 | virtual Mat nextFrame(); 78 | 79 | int frameCount() { return static_cast(reader_.get(CV_CAP_PROP_FRAME_COUNT)); } 80 | double fps() { return reader_.get(CV_CAP_PROP_FPS); } 81 | 82 | private: 83 | std::string path_; 84 | bool volatileFrame_; 85 | VideoCapture reader_; 86 | }; 87 | 88 | } // namespace videostab 89 | } // namespace cv 90 | 91 | #endif 92 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/videostab/global_motion.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_GLOBAL_MOTION_HPP__ 44 | #define __OPENCV_VIDEOSTAB_GLOBAL_MOTION_HPP__ 45 | 46 | #include 47 | #include "opencv2/core/core.hpp" 48 | #include "opencv2/features2d/features2d.hpp" 49 | #include "opencv2/videostab/optical_flow.hpp" 50 | 51 | namespace cv 52 | { 53 | namespace videostab 54 | { 55 | 56 | enum MotionModel 57 | { 58 | TRANSLATION = 0, 59 | TRANSLATION_AND_SCALE = 1, 60 | LINEAR_SIMILARITY = 2, 61 | AFFINE = 3 62 | }; 63 | 64 | CV_EXPORTS Mat estimateGlobalMotionLeastSquares( 65 | const std::vector &points0, const std::vector &points1, 66 | int model = AFFINE, float *rmse = 0); 67 | 68 | struct CV_EXPORTS RansacParams 69 | { 70 | int size; // subset size 71 | float thresh; // max error to classify as inlier 72 | float eps; // max outliers ratio 73 | float prob; // probability of success 74 | 75 | RansacParams(int _size, float _thresh, float _eps, float _prob) 76 | : size(_size), thresh(_thresh), eps(_eps), prob(_prob) {} 77 | 78 | static RansacParams translationMotionStd() { return RansacParams(2, 0.5f, 0.5f, 0.99f); } 79 | static RansacParams translationAndScale2dMotionStd() { return RansacParams(3, 0.5f, 0.5f, 0.99f); } 80 | static RansacParams linearSimilarityMotionStd() { return RansacParams(4, 0.5f, 0.5f, 0.99f); } 81 | static RansacParams affine2dMotionStd() { return RansacParams(6, 0.5f, 0.5f, 0.99f); } 82 | }; 83 | 84 | CV_EXPORTS Mat estimateGlobalMotionRobust( 85 | const std::vector &points0, const std::vector &points1, 86 | int model = AFFINE, const RansacParams ¶ms = RansacParams::affine2dMotionStd(), 87 | float *rmse = 0, int *ninliers = 0); 88 | 89 | class CV_EXPORTS IGlobalMotionEstimator 90 | { 91 | public: 92 | virtual ~IGlobalMotionEstimator() {} 93 | virtual Mat estimate(const Mat &frame0, const Mat &frame1) = 0; 94 | }; 95 | 96 | class CV_EXPORTS PyrLkRobustMotionEstimator : public IGlobalMotionEstimator 97 | { 98 | public: 99 | PyrLkRobustMotionEstimator(); 100 | 101 | void setDetector(Ptr val) { detector_ = val; } 102 | Ptr detector() const { return detector_; } 103 | 104 | void setOptFlowEstimator(Ptr val) { optFlowEstimator_ = val; } 105 | Ptr optFlowEstimator() const { return optFlowEstimator_; } 106 | 107 | void setMotionModel(MotionModel val) { motionModel_ = val; } 108 | MotionModel motionModel() const { return motionModel_; } 109 | 110 | void setRansacParams(const RansacParams &val) { ransacParams_ = val; } 111 | RansacParams ransacParams() const { return ransacParams_; } 112 | 113 | void setMaxRmse(float val) { maxRmse_ = val; } 114 | float maxRmse() const { return maxRmse_; } 115 | 116 | void setMinInlierRatio(float val) { minInlierRatio_ = val; } 117 | float minInlierRatio() const { return minInlierRatio_; } 118 | 119 | virtual Mat estimate(const Mat &frame0, const Mat &frame1); 120 | 121 | private: 122 | Ptr detector_; 123 | Ptr optFlowEstimator_; 124 | MotionModel motionModel_; 125 | RansacParams ransacParams_; 126 | std::vector status_; 127 | std::vector keypointsPrev_; 128 | std::vector pointsPrev_, points_; 129 | std::vector pointsPrevGood_, pointsGood_; 130 | float maxRmse_; 131 | float minInlierRatio_; 132 | }; 133 | 134 | CV_EXPORTS Mat getMotion(int from, int to, const Mat *motions, int size); 135 | 136 | CV_EXPORTS Mat getMotion(int from, int to, const std::vector &motions); 137 | 138 | } // namespace videostab 139 | } // namespace cv 140 | 141 | #endif 142 | -------------------------------------------------------------------------------- /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/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/motion_stabilizing.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_VIDEOSTAB_MOTION_STABILIZING_HPP__ 44 | #define __OPENCV_VIDEOSTAB_MOTION_STABILIZING_HPP__ 45 | 46 | #include 47 | #include "opencv2/core/core.hpp" 48 | 49 | namespace cv 50 | { 51 | namespace videostab 52 | { 53 | 54 | class CV_EXPORTS IMotionStabilizer 55 | { 56 | public: 57 | virtual void stabilize(const Mat *motions, int size, Mat *stabilizationMotions) const = 0; 58 | 59 | #ifdef OPENCV_CAN_BREAK_BINARY_COMPATIBILITY 60 | virtual ~IMotionStabilizer() {} 61 | #endif 62 | }; 63 | 64 | class CV_EXPORTS MotionFilterBase : public IMotionStabilizer 65 | { 66 | public: 67 | MotionFilterBase() : radius_(0) {} 68 | virtual ~MotionFilterBase() {} 69 | 70 | virtual void setRadius(int val) { radius_ = val; } 71 | virtual int radius() const { return radius_; } 72 | 73 | virtual void update() {} 74 | 75 | virtual Mat stabilize(int index, const Mat *motions, int size) const = 0; 76 | virtual void stabilize(const Mat *motions, int size, Mat *stabilizationMotions) const; 77 | 78 | protected: 79 | int radius_; 80 | }; 81 | 82 | class CV_EXPORTS GaussianMotionFilter : public MotionFilterBase 83 | { 84 | public: 85 | GaussianMotionFilter() : stdev_(-1.f) {} 86 | 87 | void setStdev(float val) { stdev_ = val; } 88 | float stdev() const { return stdev_; } 89 | 90 | virtual void update(); 91 | 92 | virtual Mat stabilize(int index, const Mat *motions, int size) const; 93 | 94 | private: 95 | float stdev_; 96 | std::vector weight_; 97 | }; 98 | 99 | CV_EXPORTS Mat ensureInclusionConstraint(const Mat &M, Size size, float trimRatio); 100 | 101 | CV_EXPORTS float estimateOptimalTrimRatio(const Mat &M, Size size); 102 | 103 | } // namespace videostab 104 | } // namespace 105 | 106 | #endif 107 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/videostab/optical_flow.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-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_OPTICAL_FLOW_HPP__ 44 | #define __OPENCV_VIDEOSTAB_OPTICAL_FLOW_HPP__ 45 | 46 | #include "opencv2/core/core.hpp" 47 | #include "opencv2/opencv_modules.hpp" 48 | 49 | #if defined(HAVE_OPENCV_GPU) && !defined(ANDROID) 50 | # include "opencv2/gpu/gpu.hpp" 51 | #endif 52 | 53 | namespace cv 54 | { 55 | namespace videostab 56 | { 57 | 58 | class CV_EXPORTS ISparseOptFlowEstimator 59 | { 60 | public: 61 | virtual ~ISparseOptFlowEstimator() {} 62 | virtual void run( 63 | InputArray frame0, InputArray frame1, InputArray points0, InputOutputArray points1, 64 | OutputArray status, OutputArray errors) = 0; 65 | }; 66 | 67 | class CV_EXPORTS IDenseOptFlowEstimator 68 | { 69 | public: 70 | virtual ~IDenseOptFlowEstimator() {} 71 | virtual void run( 72 | InputArray frame0, InputArray frame1, InputOutputArray flowX, InputOutputArray flowY, 73 | OutputArray errors) = 0; 74 | }; 75 | 76 | class CV_EXPORTS PyrLkOptFlowEstimatorBase 77 | { 78 | public: 79 | PyrLkOptFlowEstimatorBase() { setWinSize(Size(21, 21)); setMaxLevel(3); } 80 | 81 | void setWinSize(Size val) { winSize_ = val; } 82 | Size winSize() const { return winSize_; } 83 | 84 | void setMaxLevel(int val) { maxLevel_ = val; } 85 | int maxLevel() const { return maxLevel_; } 86 | 87 | protected: 88 | Size winSize_; 89 | int maxLevel_; 90 | }; 91 | 92 | class CV_EXPORTS SparsePyrLkOptFlowEstimator 93 | : public PyrLkOptFlowEstimatorBase, public ISparseOptFlowEstimator 94 | { 95 | public: 96 | virtual void run( 97 | InputArray frame0, InputArray frame1, InputArray points0, InputOutputArray points1, 98 | OutputArray status, OutputArray errors); 99 | }; 100 | 101 | #if defined(HAVE_OPENCV_GPU) && !defined(ANDROID) 102 | class CV_EXPORTS DensePyrLkOptFlowEstimatorGpu 103 | : public PyrLkOptFlowEstimatorBase, public IDenseOptFlowEstimator 104 | { 105 | public: 106 | DensePyrLkOptFlowEstimatorGpu(); 107 | 108 | virtual void run( 109 | InputArray frame0, InputArray frame1, InputOutputArray flowX, InputOutputArray flowY, 110 | OutputArray errors); 111 | private: 112 | gpu::PyrLKOpticalFlow optFlowEstimator_; 113 | gpu::GpuMat frame0_, frame1_, flowX_, flowY_, errors_; 114 | }; 115 | #endif 116 | 117 | } // namespace videostab 118 | } // namespace cv 119 | 120 | #endif 121 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/videostab/videostab.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. 15 | // Third party copyrights are property of their respective owners. 16 | // 17 | // Redistribution and use in source and binary forms, with or without modification, 18 | // are permitted provided that the following conditions are met: 19 | // 20 | // * Redistribution's of source code must retain the above copyright notice, 21 | // this list of conditions and the following disclaimer. 22 | // 23 | // * Redistribution's in binary form must reproduce the above copyright notice, 24 | // this list of conditions and the following disclaimer in the documentation 25 | // and/or other materials provided with the distribution. 26 | // 27 | // * The name of the copyright holders may not be used to endorse or promote products 28 | // derived from this software without specific prior written permission. 29 | // 30 | // This software is provided by the copyright holders and contributors "as is" and 31 | // any express or implied warranties, including, but not limited to, the implied 32 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 33 | // In no event shall the Intel Corporation or contributors be liable for any direct, 34 | // indirect, incidental, special, exemplary, or consequential damages 35 | // (including, but not limited to, procurement of substitute goods or services; 36 | // loss of use, data, or profits; or business interruption) however caused 37 | // and on any theory of liability, whether in contract, strict liability, 38 | // or tort (including negligence or otherwise) arising in any way out of 39 | // the use of this software, even if advised of the possibility of such damage. 40 | // 41 | //M*/ 42 | 43 | #ifndef __OPENCV_VIDEOSTAB_HPP__ 44 | #define __OPENCV_VIDEOSTAB_HPP__ 45 | 46 | #include "opencv2/videostab/stabilizer.hpp" 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/Headers/world/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/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 | 2.4.8 11 | CFBundleShortVersionString 12 | 2.4.8 13 | CFBundleSignature 14 | ???? 15 | CFBundlePackageType 16 | FMWK 17 | 18 | 19 | -------------------------------------------------------------------------------- /opencv2.framework/Versions/A/opencv2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeradesign/CVFunhouse/9b676ea969c255782386eedbe5c307c8d14bd14b/opencv2.framework/Versions/A/opencv2 -------------------------------------------------------------------------------- /opencv2.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /opencv2.framework/opencv2: -------------------------------------------------------------------------------- 1 | Versions/Current/opencv2 --------------------------------------------------------------------------------