building OpenCV cannot provide cv2.so - fresh ubuntu installation - opencv

I made the following steps:
1- Installed Anaconda and added link to anaconda bin in the .bashrc
2- Made an new env called py27 and activated it
3- Installed numpy in this env
4- Now I am trying to build opencv but it does not generate the cv2.so file. In the cmake step, it does not show numpy version either. I installed the dev headers but still did not had any impact

I found the issue.
While trying to fix my issues, I used make clean instead of removing the folder build. Removing instead cleared the cache (the reason of my issue most probably) so the right commands provided the right outputs!

Related

Opencv installation problems

I am trying to follow a guide to install Opencv however I am having problems.
I am following this guide:
https://www.pyimagesearch.com/2016/12/19/install-opencv-3-on-macos-with-homebrew-the-easy-way/
However there is an addendum when it reaches this point:
Update — 15 May 2017:
Which then sends you to this page:
This Page
As stated in this guide I installed OpenCV3 using this command:
brew install opencv3 --with-contrib --with-python3
I then stepped back to the original install guide here
However when checking my site packages using this line:
ls -l /usr/local/opt/opencv3/lib/python3.7/site-packages/
The directory is not found.
I then tried to cd to this directory one step at a time and found in my 'opt' directory that some of the folders were names incorrectly or at least different than to be expected.
I have two opencv folders:
opencv
opencv#3
I also have three python folders:
python3
python#2
python#3
Should I rename the opencv and python folders? If so how?
Mac OS High Sierra

'openssl/rsa.h' file not found

I am using ccavenue as the payment gateway. I am getting "'openssl/rsa.h' file not found" this error while running the application.
Is there any way to add openssl via cocoapods or avoid this issue.
Thanks in advance.
If you have come across this sha.h not found error on a Mac/ios development, it is because Apple dropped support for openssl.(I faced this error in my macOs-mojave version)
refer to this link : https://www.anintegratedworld.com/mac-osx-fatal-error-opensslsha-h-file-not-found/
You can follow below mentioned steps as a work around for this issue.
brew install openssl
This will install a folder called openssl into your /usr/local/Cellar folder (where all your other brew downloads reside)
2.cd /usr/local/include
3.ln -s ../opt/openssl/include/openssl .
The trick though is to go into your usr/local/includes folder and create a symlink (aka folder shortcut in the windows world) to your Cellar folder. (Step 2)
ln is to create a link and -s means it is symbolic. Next we are saying what is the destination and the . (dot) indicates to create the link in the current directory. (Step 3)
Now when you compile the code, the warning should disappear because your compiler will search in this directory (one of many standard directories) and find the header file sha.h via the shortcut link.
You should probably run a few other commands as best practise:
brew doctor
brew update
brew upgrade
This will resolve issue.
Note : I faced this particular issue (openssl/rsa.h file not found) when i was trying to install 'RSclient' package in my R environment.

OpenCV debug install through Homebrew

I would like to to build and install OpenCV in debug mode on my Mac. I prefer do do this in Homebrew since Homebrew manages everything else in my /usr/local and is able to properly uninstall.
I have edited the Homebrew formula to add -DCMAKE_BUILD_TYPE=DEBUG to the cmake command-line.
But the main challenge now is to keep the source around after the build, or perhaps, copy the source first to a permanent location and do the build from there. I believe this is necessary to be able step into OpenCV in Xcode debugger.
Is there a simple way to do this in Homebrew? If not, are there any examples of custom formulas that do this sort of thing? I'm not very familiar with Ruby so any sample code would be helpful.

Pub does not download dependencies on Windows 7 after the update to lib v2 (SDK 0.3.1_r17328)

After the update to the version 0.3.1_r17328 of Dart SDK and Dart Editor I have some trouble to import some library particulary Args library. I have the same problem both directly importing Args or importing Web_ui where Args is one of the dependencies.
Here is my pubspec.yaml:
name: notes
description: A sample application
dependencies:
web_ui: 0.3.0+1
or:
name: notes
description: A sample application
dependencies:
args: 0.3.1+1
Here is the error generate from build.dart
Unable to open file: C:/Users/Fabio/Dropbox/progetti/note/packages/args/args.dart'package:web_ui/component_build.dart': Error: line 25 pos 1: library handler failed
import 'package:args/args.dart';
'file:///C:/Users/Fabio/Dropbox/progetti/note/build.dart': Error: line 1 pos 1: library handler failed
import 'package:web_ui/component_build.dart';
I solved the problem. It seems that the Cache folder (Pub) has been corrupted.
I have deleted the folder Cache: C:\Users\<UserName>\AppData\Roaming\Pub
Then i run pub install from command line and it works.
Unfortunately, I was getting the same error with my windows XP machine.
In the end, I logged into my windows 7 machine and was able to
download the packages, zipped them up and pasted the libraries into my
windows XP dart editor. Success!
I had no reason to believe I had the exact proxy issue #shindokaku had as I am using my home computer.
I tried all the suggestions on deleting the .cache files, pub.lock files and the packages folder and retrying. I uninstalled dart editor and tried again. I also tried using the git resources to download web-ui and running commands through the command line to no avail
Including suggestions in this similar questions:
cannot-find-referenced-source-packages
is-there-a-workaround-for-pub-dependency-resolution-through-proxies
This problem has been haunting me over and over for a few weeks. I am not using Windows, so this answer is not intended to help the original poster who is using Windows 7.
If you are using Linux here are the steps I use to repair corrupted pub cache.
Go to the top level directory of your app. You should see at least pubspec.lock, pubspec.yaml, a folder named packages, and a folder named web.
Delete your pubspec.lock, and packages folder.
[Make sure you aren't storing your own libraries in the packages folder]
cd ~/dart/myApp/
rm -r packages
rm pubspec.lock
Now once you have removed these files:
pub cache repair
Note 1: if your dart-sdk is not in your systems $PATH, than you will want to use the absolute path to the sdk when using the above command. Comment if you need that explained.
Note 2: This is working solution with Dart 1.5.3. I have not tested this on earlier versions.
Try deleting your pubspec.lock file and packages directory in the root folder of the project. Then run pub install again, when things get wacky thats what I do.
You should try to run pub update. I have sometimes found that this doesn't work as expected from the editor, but generally works quite smoothly when called from the command line.

CMake can't find FFMPEG in custom install path

I am compiling a dependency for a project on Ubuntu 10.10, and instead of having it install to /usr/local by default, I am instead installing it to /tmp/stage/usr/local. How do I go about informing CMake of the location of this custom installed dependency when I call it to generate the build files for said project.
I am running CMake 2.8.1, and I have tried to set CMAKE_PREFIX_PATH on the cmake command line, like so
cmake -D CMAKE_PREFIX_PATH=/tmp/stage/usr/local
but this doesn't seem to make a difference - the project doesn't seem to detect the dependency.
Also, if it matters, the project in question is OpenCV 2.2, and the dependency in question is FFMPEG...
I figured out how to fix my problem, and trying to point CMake at the appropriate install location isn't the issue.
Apparently, CMake is unable to find the pkg-config files for FFMPEG (i.e. libavcodec.pc, libavdevice.pc, etc.) that tell it where the FFMPEG headers and libraries are located. In a typical install scenario, these files would be located at /usr/lib/pkgconfig. However because of the custom install location, they are instead located at /tmp/stage/usr/local/lib/pkgconfig.
So that CMake could find these files, I had to add the following environment variable:
export PKG_CONFIG_PATH=/tmp/stage/usr/local/lib/pkgconfig
After which point, OpenCV built against FFMPEG as expected.

Resources