OpenCV installation and Java run on Mac - opencv

I have a java code that uses OpenCV. Right now I just have to try to run that code. My Mac doesn't have OpenCV. And I need to download 2.4.13 version of OpenCV. I downloaded certain things but I do not understand the exact steps to make it run with my java code. Can someone help me and tell the exact steps to install OpenCV 2.4.13 and run my java code with it?

Related

Is OpenCV supported on Python 3 yet?

I already have part of a program running in Python 3 but I need OpenCV (or SimpleCV), for a robotic vehicle, but I haven't found any install commands that seem to work, other than for Python 2.7.
If it is compatible could you please include instructions (/links to) for installation of the module?
I am using Ubuntu 14.
Maybe a little late to answer, but it's actually supported on OpenCV version 3 (in alpha state nowadays). I have successfully managed to install it, on MacOS, but I guess it would be similar on Ubuntu.
Now you have separated options for python2 and python3 when using Cmake. So you'll have to set those to make it work. That's all I needed to set:
BUILD_opencv_python3
PYTHON3_LIBRARY
PYTHON3_INCLUDE_DIR
PYTHON3_INCLUDE_DIR2
PYTHON3_NUMPY_INCLUDE_DIRS
...
Here you can find more detailed description: Link
Luigolas is correct that OpenCV 3.0 supports Python 3.x bindings. It was in release candidate status since April and the production version was released on 4 June 2015. Unfortunately for some reason the downloadable installation program on the OpenCV site does not contain a Python 3.x-compatible cv2.pyd file.
OP asked about Ubuntu but for those requiring a Windows installer, use Christoph Gohlke's site, which maintains Windows binaries for many Python packages, including OpenCV 3.0 with Python 3.x bindings. Visit:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv
To install, just download the 64-bit or 32-bit .whl file appropriate for your system, then run pip install [filename]. Then the instruction import cv2 should work in your Python 3.x interpreter.

How to cross-compile opencv

I'm trying (with no success) to cross-compile OpenCV on a embedded board.
I followed this: http://docs.opencv.org/doc/tutorials/introduction/crosscompilation/arm_crosscompile_with_cmake.html.
To summarize I installed the cross compilation tools for ARM, the I ran the cmake (providing the proper toolchain file), the make and the make install commands.
I next copied the lib/ include and bin/ directories with the opencv installation in the embedded board.
However, when I try to compile a simple hello world with opencv I get undefined reference to __gnu_thumb1_case_uqi and other similar symbols.
Does anybody faced this problem and know how to solve it?
Alternative approach
Just take some embedded distro like Buildroot, OpenEmbedded or Debian. They all provide OpenCV.
As I'm mostly experienced in Buildroot, I'd like to point to the newly introduced feature to keep your project separate from BR: http://nightly.buildroot.org/manual.html#outside-br-custom. This will give you a main idea on how to compile your software against BR's OpenCV.

OpenCV on Raspbery pi error: HIGHGUI ERROR: v4l/v4l2: VIDIOC_CROPCAP

I have started to work on Rpi. I have worked on opencv on windows and ubuntu. Now I want to do Image porcessing on Rpi. I have installed latest version 2.4.8 on my Rpi. And I am able to open and display an image. However when I am trying to open webcam and display, it gives me error: HIGHGUI ERROR: v4l/v4l2: VIDIOC_CROPCAP.
Can anyone tell whats the problem ?
I haved the some error when trying to execute a code that does facedetection , i solved it by adding the files needed in my working folder (source folder).
you can show us the code to find out what exactly you need
If you are using prebuilt binaries, they may be built without v4l support. Try to build your own OpenCV with v4l checked. And of course before that install v4l with development files. You can follow this tutorial with how to install required dependicies explanied.

What do we need to install for developing with JavaCV?

I want to use and learn JavaCV.
• So, I read some articles about how to set up JavaCV development environment in Window 7. At first they download and install OpenCV and adding some directory paths to System Variable, After that ,they extract javacv-0.7-bin.zip and javacv-0.7-cppjars.zip packages to somewhere(probably C:) and add some .jar files to their projects.
My Question : Do I need to install OpenCV for developing in JavaCV? because I wrote some JavaCV programs and my JavaCV programs compile and run properly (without installing OpenCV).
According to a javacv developer, the answer is NO. It comes bundled. Source: javacv issue 406 on GitHub.

Getting webcam to work in OpenCV 2.3 with Cygwin

I have a problem trying to get a webcam in OpenCV 2.3 to work with Cygwin. I have a Windows 7 64-bit system and I use Notepad++ and cygwin compilers to do my C++ programming. I have seen other posts with similar problems:
Getting Webcam to work in OpenCV
Can't access webcam with OpenCV
I first tried installing OpenCV via the Cygwin Ports. This is rather easy to install, but alas I run into the webcam problem (always returns false when trying to find a device). I have also attempted to build OpenCV and install manually using the command line flavor of CMake. I tried adding the HAVE_VIDEOINPUT and HAVE_DSHOW flags, but no dice. All my programs compile nicely and I have all the functionality of OpenCV aside for this webcam thing.
Has anyone successfully built OpenCV 2.3 on Cygwin with webcam working?
It is unlikely that cygwin build of OpenCV will be able to access a webcam. At least it is not possible without hacking OpenCV cmake scripts. Under cygwin OpenCV build always follows the UNIX branch and videoinput/directshow is excluded from build.

Resources