Cannot compile OpenCV for iOS with nonfree module - ios

I'm attempting to compile the OpenCV framework for iOS using the nonfree module. Right now, I'm not able to compile the OpenCV framework, period. I would use the stock iOS opencv2.framework download from the website, except it doesn't include the nonfree module that I need for my project. I've been following the instructions as prescribed here:
http://answers.opencv.org/question/61663/how-to-make-opencv2framework-with-opencv_contrib/
as these appear they might be out of date
http://docs.opencv.org/2.4/doc/tutorials/introduction/ios_install/ios_install.html
https://github.com/Itseez/opencv/issues/4712
However, when I run the command from a folder outside the building directories "python opencv-master/platforms/ios/build_framework.py --contrib opencv_contrib-master ios_contrib" it spits out the following error:
http://pastebin.com/LUep8Tdw
The error doesn't mean much to me. I thought at first it was related to me building it inside the same directory as opencv, but I tried it outside of it and it still failed. Any thoughts? I've tried everything I can possibly think of, and done a bunch of research without coming up with anything.

It appears there's some issue with one of the modules in opencv_contrib. I'm not sure what it is, but I was using version 3.0.0-rc-1. The way I got around it was by moving specific modules from the module folder in the contrib folder into the regular opencv directory's modules folder and then compiling the framework from scratch.

Related

How do I remove openCV

I am trying to remove opencv fully from my system. I was trying to learn ROS, while in tutorials I faced an issue. After creating empty workspace I invoke
catkin_make
It gives an common error, I searched and asked around in answers.ros
here is the link of the question
I think I found out the problem was opencv libraries which I had build before installing ROS-Noetic, creating the error, I searched around how to remove opencv, but non of the answers totally remove opencv without removing my opencv names files.
Is there a common solution on how to remove opencv?
Ubuntu 20.04
ROS Noetic
Best way if you installed opencv from source and still have the build directory, simply go there and call make uninstall. Another solution is to delete all opencv related files as you already know and suggested in many other similar questions like this. You could also try to use synaptic package manager if you installed using a package.
I suggest for the future to install development libraries a custom folder, so it will be just a matter of deleting that folder if something goes wrong. In this way you can also have different opencv versions in your system, this is how I do.

Linking Header File with Main.Cpp file in Codeblocks

I am trying to use codeblocks to compile the code available here
The thing is every time I try to build and run, I run into the following error:
|/.../head_pose_estimation/opencv2/core/core.hpp|48|fatal error: opencv2/core.hpp: No such file or directory
Does anyone know how I can fix this? Thank you!
You do not have the pre-built (compiled) version of OpenCV, what you currently have are the source files. If you want to do something special with OpenCV (Target/GPU SUpport etc) then you will need to build the framework using an appropriate guide.
If however you simply want to use OpenCV in the most common way then download the pre-built libraries from the OpenCV.org website.
NOTE:
If you are using OpenCV with MinGW compiler, I do not remember if the pre-built is actually pre-built for MinGW. (I dont think they do) In this case you will HAVE to built the libraries. You can find a guide here

cannot setup Opencv 2.4.6 , opencv_core231d.lib Not Found Error

Hello everyone;
i had opencv 2.2 on my vs2010, and i wanted to update so i went to opencv site and:
i've downloaded OpenCV for Windows (ver 2.4.6)
i've extracted it to c:\opencv2.4
i've set the Environment Variable as doc said here: http://docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install.html#windowssetpathandenviromentvariable
( i didnt know what is "PATH EDITOR" so i've just changed Environment variables)
i made property sprite sheets as opencv doc said here: http://docs.opencv.org/doc/tutorials/introduction/windows_visual_studio_Opencv/windows_visual_studio_Opencv.html#windows-visual-studio-how-to
5.but Doc Was Old, and there was no "include" folder in OpenCV2.4/opencv/build/x64/vc10 so I did set include Directory to OpenCV2.4/opencv/build/include in My property sprite sheet.
everything seems true and VS detect include libraries But
VS2010 throw following error when i want to Build the solution:
1>LINK : fatal error LNK1104: cannot open file 'opencv_core231d.lib'
Strange thing is there is no "opencv_core231d.lib" File in c:\opencv2.4 at all!!!
:(
what is the problem?
This is a Linker error, so make sure you are trying to link the correct libraries.
I would suggest to use CMake, which definitely simplifies configuring projects, specially those having dependencies like OpenCV (you can take a look to the OpenCV documentation, or any blog explaining the steps: http://marcosnietoblog.wordpress.com/2011/11/19/opencv-for-windows-easy-installation-using-cmake/ )
By the way, I use to have several versions of opencv on the same folder:
C:\OpenCV\opencv2.4.3
C:\OpenCV\opencv2.4.6
...
So I can easily switch within CMake setting the OpenCV_DIR.
opencv_core231d.lib is a debug version, all the *d.lib and *d.dll files in openCV are with debug symbols.
It is likely that the pre-built release you downloaded doesn't contain debug ones.
either download te source and build both debug and release. Or, if you don't care how opencv works internally, just change the linker flags to use the same lib names with the d
edit. or of course if you donwloaded opencv 2.4.6 the file would be opencv_core246d.lib

OpenCV 2.4.4 and Tesseract 3.02.02 Don't link together

I'm using iOS 6.1 and XCode 4.6
I have a problem, OpenCV needs to be compiled with libc++ (LLVM C++ 11), while Tesseract 3.02.03 needs to be compiled with "default compiler".
How can I overcome this problem. at this point I can compile and link only If I comment out OpenCV code or comment out OCR code. cannot make them both work together.
Any ideas??
I am by no means an expert with C++ but I had the same problem and by some trial and error and lots of internet searching I think I managed to solve it.
As I understand it, the problem is that opencv and tesseract are built with different standard libraries. The latest opencv is built with libc++ while tesseract is built with stdlibc++
The solution is to rebuild one of them so they both use the same standard library. I decided to recompile tesseract and followed the instructions found here which references a build script that is used to build the library.
I modified this script (again, by trial an error, not really sure this is the best way) to used the clang++ compiler (CXX="/usr/bin/clang++") and use libc++ (CXXFLAGS="$CFLAGS -stdlib=libc++") and it compiles (albiet with some warnings). You may also need to copy some headers as the script doesn't seem to copy them all.
Then just use this library instead of the downloaded one in your iOS project (remember to change back to libc++ in build settings) and everything will compile and link just fine.
So far it seems to work properly in runtime.

Does OpenCV need to be compiled before using?

I'm trying to install OpenCV on Windows. Following are how I installed it:
Download OpenCV 2.4.2.exe from sourceforge.
unarchived it.
open Eclipse CDT.
Add C:/opencv/include/opencv to "Includes"
Add opencv_highgui, opencv_core, opencv_ml... to "Libraries"
Create a small project and compiled it.
The compiler complained about "opencv2/core/core_c.h:No such file or directory"...
I remember that when I install OpenCV on Ubuntu, I did compiled the project (it took quite a bit of time). Do I have to do the same thing on Windows? Or is any other thing causing this error?
Thanks.
You should add correct directories to includes.
Since you added C:/opencv/include/opencv, there is no way for compiler to find C:/opencv/include/opencv2/core/core.h.
I believe you should enter C:/opencv/include/ to includes directories as well.

Resources