Reputation: 63
I am trying to create my own Haar Cascade model to detect specific objects using OpenCV in python. I have been seeing the need for terminal commands like opencv_createsamples or opencv_traincascade. What is the best way to install and get these running either locally or on google colab if possible? I have been having a lot of issues trying to install opencv 3.4 and link it to python while being able to use the terminal commands. If anyone has any experience in this it would be greatly appreciated. Or please redirect me to resources I can use to help install and run OpenCV and its commands on my Mac.
Upvotes: -2
Views: 290
Reputation: 63
The following worked
install opencv3 using brew
bash brew install opencv@3
link opencv3
brew link --overwrite opencv@3
set exports in .bash_profile and save
export LDFLAGS="-L/opt/homebrew/opt/opencv@3/lib"
export CPPFLAGS="-I/opt/homebrew/opt/opencv@3/include"
export PKG_CONFIG_PATH="/opt/homebrew/opt/opencv@3/lib/pkgconfig"
~/.bash_profile
now able to use various opencv_ commands in terminal
Upvotes: 1