Coder Social home page Coder Social logo

zigcv's Introduction

ZIGCV

ci

The ZIGCV library provides Zig language bindings for the OpenCV 4 computer vision library.

The ZIGCV library supports the head/master of zig and OpenCV (v4.6.0) on Linux, macOS, and Windows.

Caution

Still under development, so the zig APIs will be dynamically changed.

You can use const c_api = @import("zigcv").c_api; to call c bindings directly.
This C-API is currently fixed.

How to execute

Use your own package manager

At first, install openCV 4.6. (maybe you can read how to install from here).
Then:

git clone --recursive https://github.com/ryoppippi/zigcv
cd zigcv
zig build

Currently this repo works with zig 0.11.0, so make sure you have it installed. We are working on updating to zig 0.12.0.

Use devbox

We also provide a devbox config to manage dependencies and build environments.

git clone --recursive https://github.com/zigcv
cd zigcv
devbox init

Checkout devbox.json for more details.

Demos

you can build some demos. For example:

zig build examples
./zig-out/bin/face_detection 0

Or you can run the demo with the following command:

devbox run build examples
./zig-out/bin/face_detection 0
face detection

You can see the full demo list by zig build --help.

Technical restrictions

Due to zig being a relatively new language it does not have full C ABI support at the moment.
For use that mainly means we can't use any functions that return structs that are less than 16 bytes large on x86, and passing structs to any functions may cause memory error on arm.

License

MIT

Author

Ryotaro "Justin" Kimura (a.k.a. ryoppippi)

zigcv's People

Contributors

mattn avatar ryoppippi avatar wbehrens-on-gh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

zigcv's Issues

dnn detection demo does not work

libc++abi: terminating with uncaught exception of type cv::Exception: OpenCV(4.6.0) /opt/homebrew/opt/opencv/include/opencv4/opencv2/core/mat.inl.hpp:896: error: (-215:Assertion failed) dims <= 2 in function 'at'

CI Fails

currently, we run ci on macos.
However, it is too slow to install dependencies with homebrew

Change MatType to packed struct

#4
With packed struct, type and channel can be set intuitively. On the other hand, we need to write more. On the other hand, it increases the amount of description, and since it is a destructive change, there is room for consideration on whether to introduce it or not.

Face_detection Example does not work on M1 mac

libc++abi: terminating with uncaught exception of type cv::Exception: OpenCV(4.6.0) /tmp/opencv-20220814-85292-f59axv/opencv-4.6.0/modules/imgproc/src/drawing.cpp:1841: error: (-215:Assertion failed) thickness <= MAX_THICKNESS in function 'rectangle'

The arguments are not passed properly.

Probably this is because of ziglang/zig#1481

Test for Core

It takes a lot of time...

I have ported most of the tests in gocv, but have done very little from core_test.go.

WASM support

  • Build Opencv.js with Zig Compiler

  • Build Opencv WASM directly from zigcv

Create zig binding auto generator from header file

Currently, zigcv reads and uses gocv header files, but this does not allow function name and type completion on the editor. ralib-zig would like to generate zig code from c header files, like ralib-zig.

There are two options

  • auto-generation from go files
  • auto-generation from c header files

I'm back!

Hello!

I had archived this project due to lack of enthusiasm, but decided to maintain it again.

This is because zig 0.12.0 is now available and we have also solved the build method.

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.