-
Notifications
You must be signed in to change notification settings - Fork 826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
macOS Big Sur Install ALMOST THERE!!! (but fails because of Tracker / MultiTracker) #805
Comments
So I'm looking at the code on OpenCV (https://docs.opencv.org/) for this
So, I'm wondering if there was a naming changes on the classes that is not (yet?) reflected in opencv4nodejs? Anyone? (ps: I'm new to their documentation so it's possible I'm just missing something. I'm not sure there'd be such a big naming change for classes on a minor version update from |
@frudman I got the same issue this morning, OpenCV 4.5.1 put MultiTracker in a legacy directory of OpenCV 4.5.0 doesn't have it in legacy, but whole version was updated 6 months ago. Now I'm trying to find a version of OpenCV, between 4.1 (as example in the README) and 4.5.0 that is recent enough to compile correctly and old enough to be built with I first tried compiled with Brew I then tried compile manually OpenCV 4.5.1, success. But failed to be built in Then I tried OpenCV 4.2.0, couldn't compile, due to Now I'm gonna try version 4.5.0, because with Brew, those DNN compilation passed. I'm taking a chance with it. If you find any version that fit, please tell me. |
@KeitelDOG, Thanks for this update. A few questions (if you have a chance): [please note: i'm not proficient enough in c/c++ to compile opencv/opencv4nodejs from source. my investigation was just from looking at the code and their documentation. I might be willing to push that a little, for everyone's sake, but looking for an easier path first! :-) ] 1- 15 months from last update? does this mean 2- Is there a simple-enough way to disable tracker/multi-tracker in order to finish the compilation? 3- I'm not a C/C++ coder but if there's a simple way to re-specify openCV's API so that it can properly compile for 4- Does the openCV API change a lot like this (feels like a big change to me from 4.5.0 to 4.5.1)? And did it actually change a large amount (from std to legacy) in a minor version??? Is this typical of the openCV api updates? Just curious. Thanks. |
@frudman I found a solution for myself by removing I compile 1- Seems like there is a pause. 2 years is like abandon for me. I think 95% of what you want in Deep Learning can be achieved by this. It's just that they did not update the codes to match lastest OpenCV structure changing, specially SIFT, SURF that are now patented (Non Commercial use only unless obtaining the right), MultiTracker algorithms that is moved, and FAST, FREAK that are alternative to SIFT and SURF. 2- I think there is a way. But easy or medium might depend on how the feature is called on other files. I just built it by disabling SIFT. I go to
then your file:
to
But 1 other file in the code include SIFT file as hard coded, because they are still bound in this package. I commented out 2 lines, and
And now I just install it with:
And BOOM (you can see the generated : 3- I know some but I'm no expert in c/c++, but instead Javascript. As it appears, there is 2 places to handle it, either you add missing Multitracker back in it's place, which can be cumbersome the way I see it in OpenCV, or you just change
4- OpenCV seems to be from a bunch of super genius guys that are more like Algorithm experts, System Engineers, Mathematicians, than normal Software Engineers. If it's the case, that would explain those kind of quick changes that keep breaking tied packages from minor versions. |
Those are others algorithms for image that are not implemented yet with
There is many of them. SURF Feature Dectector example in case you decide like me to drop SIFT (it's not that I had a choice, lol): |
@KeitelDOG Holy WOW! That's a LOT of info! Thanks for that! I will spend today "digesting" all your information and see if I can get it working here on my system. Here we go... (ps: using 4.5.0 is definitely good enough for me, so no problem there, and glad you've shown me the way) |
So I tried to set it up and failed. Your instructions above are great but depend on loading So, in order for me to set it up, I'd have to compile opencv from source (git) and select somehow (branch) v4.5.0. This starts getting complicated for me (also setting up the whole tool chain and correct versions of those [e.g. python 3.6 instead of 3.9 and such]). [ps: i tried looking into creating a brew formulae just for 4.5.0; this seemed doable but again, a lot of work for an outdated version, of a possibly no-longer-supported product, so...] [ps2: for anyone coming in later, I found this link that shows how to easily build v4.5.0 (or any other version that's been git-tagged, i guess): https://docs.opencv.org/4.5.0/d0/db2/tutorial_macos_install.html So, I'll put ...I found an alternative to nodejs: https://emgu.com/wiki/index.php/Main_Page For me C# works just as well, so I'm going to try to use that instead, for now anyway (nodejs would have been better). But the app I'm working on is self contained so C# or nodejs both work (and I'm comfortable with both). The advantage is that EMGU is up to date and seems well maintained (at least for now, and looking at its history, kept up to date fairly quickly). While I'll circle back to Sorry to bail on you, and thanks for your pointers. |
@frudman too bad that it still causes you problem. Brew has version 4.5.0_5, when I installed it like 1 week ago, it did installed. Maybe they just replace the formulae with version 4.5.1, there should be a way to get old formulae. Anyway I did mine with manual compilation, with virtualenv, virtualenvwrapper, python 3.9, pip, numpy, cmake, make, opencv and opencv_contrib zip files in releases page, etc. , from the tutorial of Andrian listed above. Alos there is other packages of opencv that just fork opencv repos and add the necessary js codes to built it, so it's 100% compatible with that specific opencv version. I saw one for version 2.4, one for 3.3, not sure if others support version 4. The manual compilation process is straight forward. I found complication on compiling version 4.2, 4.3, but 4.5.0 and 4.5.1 compiled nicely with no problem. But I don't know how Big Sure chip would react with 4.5.0, but I suppose if 4.5.1 compiled on your machine, then so should 4.5.0. |
@KeitelDOG Thanks for your information. Works fine and it's a good workaround for those who not need SIFT detectors. |
@kelvin-lima u're welcome. I was able to port into OpenCV4NodeJS the full algorithms of Adrian Mobile Scanner https://www.pyimagesearch.com/2014/09/01/build-kick-ass-mobile-document-scanner-just-5-minutes/ made with Python and OpenCV. It's even faster in Node than in Python environment, treating a 4000x3000 pixel document in just 140ms to 200ms in a Macbook Pro mid-2012. Some OpenCV code flow a restructured by this package, and most basic Python Numpy matrix algo are easily reproducible for basic calculations. I don't even get to use SURF for now. |
Just to clarify a little bit more. It Will work as expected if you use Node.js version 14.16 and OpenCV version less than 4.5.1. I'm currently using opencv3 because I only need cascade recognizers. :) |
@kelvin-lima I'm not sure for all versions of OpenCV. My node version is |
I managed to get it working in my case (tracking error). |
@seba-murillo it's a good solution, passing the features build list instead of hacking package code directly. However, wouldn't we loose the |
Ok so I was able to get the full installation of opencv4nodejs working. I needed to downgrade node from version 16 to version 14 and do a little bit of compiler option digging! Current Setup Node installation (with Homebrew) opencv installation (with Homebrew) opencv4nodejs installtion (with node installer)
|
for Monterey, there were the same issues and more but finally have managed to solve opencv4nodejs installation issues and successfully installed it.
|
Did work for me, thank you so much! |
@p-gintare Brilliant. The only error I met is $ sw_vers
ProductName: macOS
ProductVersion: 12.3.1
BuildVersion: 21E258
$ node -v
v14.19.1
$ npm -v
6.14.16 |
This line -> export CXXFLAGS="-std=c++14 -Wno-c++11-narrowing" Solved the issues I was facing. BIG UP! |
Trying the manual install, as per below (because the easier
npm install opencv4nodejs
fails in all sorts of ways!)[march 23 notation: see next comment on this thread for possible culprit (was api changed to a legacy api by opencv.org?)]
[But now this seems important]
brew-installed OpenCV4 (version 4.5.1_3)
But first, some info:
uname -a: Darwin xxxxx.local 20.3.0 Darwin Kernel Version 20.3.0: xxxxxxnu-7195.81.3~1/RELEASE_X86_64 x86_64
node -v: v15.12.0
node-gyp -v: v7.1.2
python --version: Python 3.9.2
Added to
~/.zshrc
for command line:WITH OUTPUT (for new shell):
THEN,
npm install opencv4nodejs
RESULTS:THEN
cd node_modules/opencv4nodejs/build
andmake V=1
RESULTS:The text was updated successfully, but these errors were encountered: