oaleeapp / SwiftEyes

An easy way to access OpenCV library from Swift.
https://oaleeapp.github.io/SwiftEyes/
Other
8 stars 1 forks source link

Doesn't work - OpenCV Error: Insufficient memory, Error: Assertion failed #8

Open anonym24 opened 6 years ago

anonym24 commented 6 years ago

import UIKit
import SwiftEyes

class ViewController: UIViewController {

    @IBOutlet weak var imgView: UIImageView!
    override func viewDidLoad() {
        super.viewDidLoad()
        let image = UIImage(named: "img")
        imgView.image = image
        let mat = OCVMat(image: image!)
        let currentMat = mat.clone() // just for test 
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

}
PhotoLibraryServices (0x1127c1880). One of the two will be used. Which one is undefined.
teset2(2844,0x10c4b0000) malloc: *** mach_vm_map(size=194431329378304) failed (error code=3)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
OpenCV Error: Insufficient memory (Failed to allocate 194431329376256 bytes) in OutOfMemoryError, file /Users/admin/Library/Caches/CocoaPods/Pods/Release/OpenCV-Dynamic/3.2.4-8d4c9/opencv/modules/core/src/alloc.cpp, line 52
OpenCV Error: Assertion failed (u != 0) in create, file /Users/admin/Library/Caches/CocoaPods/Pods/Release/OpenCV-Dynamic/3.2.4-8d4c9/opencv/modules/core/src/matrix.cpp, line 433
libc++abi.dylib: terminating with uncaught exception of type cv::Exception: /Users/admin/Library/Caches/CocoaPods/Pods/Release/OpenCV-Dynamic/3.2.4-8d4c9/opencv/modules/core/src/matrix.cpp:433: error: (-215) u != 0 in function create
anonym24 commented 6 years ago

or this example:

@IBOutlet weak var imgView: UIImageView!
    override func viewDidLoad() {
        super.viewDidLoad()
        let image = UIImage(named: "img")
        let mat = OCVMat(image: image!)
        imgView.image = mat.image()
    }
objc[2926]: Class PLBuildVersion is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices (0x11375f998) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices (0x1134de880). One of the two will be used. Which one is undefined.
(lldb) 

screenshot_9