Comments (7)
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.
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.
That is a very good idea @directive-cary any interest in committing a PR with that info added to the README?
from gocv.
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.
Thanks for the PR @directive-cary I will close this issue once the next GoCV release is out.
from gocv.
This documentation was released as part of v0.8.0 so now closing. Thanks again!
from gocv.
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)
- Missing of some flags for calibration
- cannot range over contours (variable of type gocv.PointsVector) HOT 1
- This issue occurred when I was cross compiling HOT 3
- opencv4.8.1 has been compiled and installed, but an error occurred when running gocv HOT 3
- How to parse blob?
- Memory leak in ORB detector
- triangulatePoints
- Error installing OpenCV libtbb2 and libdc1394-22-dev not found HOT 1
- Issue using gocv 0.35.0 in combination with opencv 4.8.1 in docker HOT 1
- Update to Support Additional Fonts from HersheyFont HOT 1
- MinMaxIdx function does not return the correct index. HOT 2
- BoxPoints, MinAreaRect inconsistent with C++ version of OpenCV, causing precision issues HOT 2
- Why is Mat used for in Range instead of a scalar wit hsv? And how can I sat Mat to a lower HSV range? HOT 2
- Consider adding VideoWriterFileWithAPI?
- Compilation yields "/bin/sh: line 0: cd: OLDPWD not set" on MacOS HOT 2
- Severe Memory Leak During Conversion between Image and gocv.Mat HOT 1
- go run . doesn't work on macos sonoma 14.2.1 (23C71) HOT 3
- Missing ArUco when installing OpenCV Debian Repository HOT 2
- building a static binary with ` gocv/opencv:4.9.0-static` fails HOT 1
- Not able to run simple example HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gocv.