Giter VIP home page Giter VIP logo

Comments (7)

directive-cary avatar directive-cary commented on May 17, 2024 2

Actually, I dug into things a bit more and a great deal of this pain was me being unfamiliar with the proper care and feeding of cgo modules. The instructions at https://gocv.io/getting-started/windows/ download gocv using go get, then install the OpenCV native libraries, then tell you to go off and write code. While this works, it means that even if you're just a consumer of the gocv library and not hacking on it at all, you'll still be compiling it from scratch every time you compile your own program.

I now recommend the setup instructions be amended to reflect this.

As written, the instructions are perfect for someone who wants to contribute to gocv development.

For someone who wants to consume gocv as a library, there should be a section after the mingw32-make install step, and before the "how to build/run code" step, that recommends running go install gocv.io/x/gocv. This will pre-build the gocv library into a gocv.a file that's stored under the {GOPATH}/pkg folder. Then when you write and run an example program that consumes the gocv package, go build will merely link with that library, and you will get the < 1s build/link times that you would expect from a typical toy program.

from gocv.

deadprogram avatar deadprogram commented on May 17, 2024

Hi @directive-cary I would say that the performance of C++ compilation/linking in general of any large project is not great, as I am sure you discovered when installing OpenCV itself.

Also, Windows in general is much slower when compiling C++ using open source toolchains. This is not specific to GoCV itself, but part of needing to compile/link against a large C++ codebase using CGo.

You might want to experiment with precompiled headers, which I have not had time to explore. They are turned off in the Windows build atm due to some incompatibilities in the build I did not dig too far into.

Hope that helps!

from gocv.

deadprogram avatar deadprogram commented on May 17, 2024

That is a very good idea @directive-cary any interest in committing a PR with that info added to the README?

from gocv.

directive-cary avatar directive-cary commented on May 17, 2024

After thinking about a couple different wordings, I decided that being succinct in the readme worked better than a paragraph giving the full explanation of what happens and why to do it. I hope this matches what you expected. :)

from gocv.

deadprogram avatar deadprogram commented on May 17, 2024

Thanks for the PR @directive-cary I will close this issue once the next GoCV release is out.

from gocv.

deadprogram avatar deadprogram commented on May 17, 2024

This documentation was released as part of v0.8.0 so now closing. Thanks again!

from gocv.

rikonor avatar rikonor commented on May 17, 2024

I encountered the same in Linux. Running go install gocv.io/x/gocv like @directive-cary mentioned fixed the issue.

from gocv.

Related Issues (20)

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.