iOS Haar Cascade not working

asked 2016-11-27 16:19:55 -0600

updated 2016-11-27 20:08:47 -0600

berak gravatar image

I have been working on an app for my science project. The app is using OpenCV to apply a Haar Cascade to an image, and draw a shape around the recognized object. However, I have been having some trouble with using the cv::CascadeClassifier to apply the Haar Cascade to my image. My project is an XCode Project using Swift. It uses a bridging header to utilize OpenCV with Swift. I am using OpenCV 3.0.0, downloaded from http://opencv.org. My code is located at https://github.com/adiprad/iOS-OpenCV.... I am applying the Haar Cascade in OpenCVWrapper.mm. Here is the log while the app is running. Feel free to compile and test it on your device. It would be greatly appreciated if someone could respond as soon as possible.

2016-11-27 17:03:02.424079 CameraCaptureApp[3436:2419585] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles 2016-11-27 17:03:02.430964 CameraCaptureApp[3436:2419585] [MC] Reading from public effective user settings. QR\260\241OpenCV Error: Assertion failed (!empty()) in detectMultiScale, file /Volumes/Linux/builds/precommit_ios/opencv/modules/objdetect/src/cascadedetect.cpp, line 1634 2016-11-27 17:03:08.743617 CameraCaptureApp[3436:2419585] Error: ( 0 CameraCaptureApp 0x00000001000070f4 +[OpenCVWrapper haarcascade:] + 988 1 CameraCaptureApp 0x0000000100008a28 _TFC16CameraCaptureApp14ViewController21imagePickerControllerfTCSo23UIImagePickerController21didFinishPickingImageGSQCSo7UIImage_11editingInfoGSQGVs10DictionaryCSo8NSObjectPs9AnyObject____T_ + 256 2 CameraCaptureApp 0x0000000100008e20 _TToFC16CameraCaptureApp14ViewController21imagePickerControllerfTCSo23UIImagePickerController21didFinishPickingImageGSQCSo7UIImage_11editingInfoGSQGVs10DictionaryCSo8NSObjectPs9AnyObject____T_ + 232 3 UIKit 0x00000001919b43e8 <redacted> + 480 4 PhotoLibrary 0x0000000198204650 PLNotifyImagePickerOfImageAvailability + 64 5 CameraUI 0x00000001a0c45c04 <redacted> + 140 6 CameraUI 0x00000001a0c45568 <redacted> + 456 7 CameraUI 0x00000001a0c44e7c <redacted> + 548 8 UIKit 0x00000001914fe484 <redacted> + 96 9 UIKit 0x00000001914fe404 <redacted> + 80 10 UIKit 0x00000001914e88b8 <redacted> + 452 11 UIKit 0x00000001914fdcf0 <redacted> + 584 12 UIKit 0x00000001914fd818 <redacted> + 2484 13 UIKit 0x00000001914f8a60 <redacted> + 2988 14 UIKit 0x00000001914c952c <redacted> + 340 15 UIKit 0x0000000191cb6a54 <redacted> + 2736 16 UIKit 0x0000000191cb04bc <redacted> + 784 17 CoreFoundation 0x000000018b61c278 <redacted> + 24 18 CoreFoundation 0x000000018b61bbc0 <redacted> + 524 19 CoreFoundation 0x000000018b6197c0 <redacted> + 804 20 CoreFoundation 0x000000018b548048 CFRunLoopRunSpecific + 444 21 GraphicsServices 0x000000018cfce198 GSEventRunModal + 180 22 UIKit 0x00000001915342fc <redacted> + 684 23 UIKit 0x000000019152f034 UIApplicationMain + 208 24 CameraCaptureApp 0x000000010000afd8 main + 140 25 libdyld.dylib 0x000000018a52c5b8 <redacted> + 4 ) 2016-11-27 17:03:13.571832 CameraCaptureApp[3436:2419585] [App] if we're in the real pre-commit handler we can't actually add any new fences due to CA restriction 2016-11-27 17:03:13.572135 CameraCaptureApp[3436:2419585] [App] if we're in the real pre-commit handler we can't actually add any new fences due to CA restriction 2016-11-27 17:03:36.961754 CameraCaptureApp[3436:2419585] [App] if we're in the real pre-commit handler we can't actually add any new fences due to CA restriction 2016-11-27 17:03:36.961995 CameraCaptureApp[3436:2419585] [App] if we're in the real pre-commit handler we can't actually add any new fences due to CA restriction

edit retag flag offensive close merge delete