Giter Site home page Giter Site logo

zake1989 / opencvswiftlinedetection Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mpieter/opencvswiftlinedetection

0.0 1.0 0.0 424 KB

Line detection with OpenCV and Swift on iOS

Swift 37.10% Objective-C 27.57% Objective-C++ 28.92% C++ 4.53% C 1.33% Ruby 0.55%

opencvswiftlinedetection's Introduction

OpenCV with Swift: line detection

Purpose is to demonstrate how OpenCV can be used in combination with Swift on iOS for line detection (or any other computer vision task).

The project AppDelegate and View Controller are written in Swift. Swift cannot talk directly to C++ (which we need for OpenCV), so we provide an Objective-C++ wrapper class to mediate between Swift and C++. We also provide an Objective-C++ category on UIImage to mediate between UIImage and CV::Mat image formats. The CVWrapper header file is pure Objective-C.

A prefix header "OpenCVSwiftLineDetection.pch" is used to ensure the OpenCV headers are included before the Apple headers. Otherwise this will lead to compile errors.

Installation
To run the project you need to install the OpenCV framework using Cocoapods. Run 'pod install' to install OpenCV for the project. From then on, always open the project in XCode from the OpenCVSwiftLineDetection.xcworkspace file that the pod install creates.

Use
The app has almost no user interface. On launch, a sample image is used to demonstrate the line detection algorithm of OpenCV. It uses the Canny Edge detector in combination with the Hough transform.

Tested with
OpenCV 4.1, XCode 11.7, Swift 4.2 and iOS 13.0

opencvswiftlinedetection's People

Contributors

mpieter avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.