oaleeapp / SwiftEyes

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

weird big size of Mat (rows/cols) after converting from UIImage #9

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: "img2")
        imgView.image = image
        print("Size of UIImage: \(image!.size.height) \(image!.size.width)")

        let mat = OCVMat(image: image!)
        print("Size of Mat: \(mat.rows) \(mat.cols)")
    }
}

Output:

Size of UIImage: 128.0 128.0
Size of Mat: 490496 24576
anonym24 commented 6 years ago

on different macos and real device (ipad)

same image returns:


Size of UIImage: 128.0 128.0
Size of Mat: 0 286334977

what is going on?