首页 > 解决方案 > 如何使用 swift 语言在 xcode 中使图像提取具有本地二进制模式的特征

问题描述

对不起,我正在做我的期末论文,我应该在 ios 应用程序中进行图像提取,我只能在 imageview 中显示图像,我不知道如何使图像提取具有本地二进制模式,如果你能帮助我,我会感谢你并感谢它。感谢您的关注,希望您能帮助我

我试图显示图像并安装 openCV

import UIKit

class ViewController: UIViewController, UINavigationControllerDelegate, UIImagePickerControllerDelegate {

    @IBOutlet weak var openCVVersionLabel: UILabel!

    @IBOutlet weak var myimageview: UIImageView!

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.

        //Invoke functions in OpenCVWrapper class from swift
        //openCVVersionLabel.text = OpenCVWrapper.openCVVersionString()
    }

    @IBAction func chooseimage(_ sender: Any)
    {
        let image = UIImagePickerController()
        image.delegate = self

        image.sourceType = UIImagePickerController.SourceType.photoLibrary

        image.allowsEditing = true

        self.present(image, animated: true)
        {
            //After it is complete
        }
    }

    func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any])
    {
        if let image = info[UIImagePickerController.InfoKey.originalImage] as? UIImage
        {
            myimageview.image = image
        }
        else
        {
            //Error message
        }
        self.dismiss(animated: true, completion: nil)
    }

}

我需要方法本地二进制模式中的 imageview 提取特征中的图像

标签: iosswiftxcode

解决方案


推荐阅读