Swiftpack.co - githubdelegate/ZYVisionDetector as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by githubdelegate.
githubdelegate/ZYVisionDetector 1.1.4
auto detect retangle and highlight 自动识别图片照片中矩形区域并高亮
⭐️ 3
🕓 4 weeks ago
iOS
.package(url: "https://github.com/githubdelegate/ZYVisionDetector.git", from: "1.1.4")

ZYVisionDetector

ZYVisionDetector can help you to record video and detect retangles in your video. 能帮助你实现自动识别视频中矩形区域并高亮

sample

Install

  • Cocoapods pod ZYVisionDetector

  • SPM

Usage

  • detect retangle
ZYVisionRetangleDetector.visionImage(clipImage: previewimg, boxSize: self.zyvision_previewLayer.bounds.size) { result, points  in
    let path = CGMutablePath()
    if points != nil {
        path.addLines(between: [points!.0, points!.1, points!.2, points!.3, points!.0])
        self.zyvision_rectangleShapeLayer.path = path
        self.zyvision_rectangleShapeLayer.isHidden = false
    }
}
  • video recoder
class CameraViewController: UIViewController, ZYVisionDetectorVideoRecorder {
    var zyvision_inputDevice: AVCaptureDeviceInput!
    
    var zyvision_device: AVCaptureDevice!
    
    var zyvision_photoSetting: AVCapturePhotoSettings!
    
    var zyvision_photoOutput: AVCapturePhotoOutput!
    
    var zyvision_videoOutput: AVCaptureVideoDataOutput!
    
    var zyvision_rectangleShapeLayer: CAShapeLayer!
    
    var zyvision_previewLayer: AVCaptureVideoPreviewLayer!
    
    var zyvision_previewView: UIView! {
        return self.view
    }
    
    var zyvision_session: AVCaptureSession!
    

    override func viewDidLoad() {
        super.viewDidLoad()

        self.zyvision_setupSession()
        
        self.zyvision_beginSession()
    }
    
}

GitHub

link
Stars: 3
Last commit: 2 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics