OpenCV trying to use windows to show image throws exception - c++

I´m trying to create named windows and show an image from them using OpenCV in c++. When I try it, I will get an error saying:
The function is not implemented. Rebuild the library with Windows,
GTK+2.x or Cocoa support. If you are on Ubuntu or Debian, install
libgtk2.0-dev and pkg-config, then re-run cmake or configure script in
function 'cvNamedWindow'.
I´m on a raspberry pi using Ubuntu MATE and I didnt have this problem when I was testing on my laptop using Ubuntu. I have checked that all neccessary libraries are installed. So I run cmake again to recompile it, but it still doesn t work.
Is there something different I need to do for Ubuntu MATE? Or is there something else I should try?

Related

How to install OpenCV for C++ on Mac and configure with Netbeans

I am having trouble trying to install OpenCV correctly and configure it with Netbeans.
One of my University units is using Visual Studio with OpenCV but I do not own a Windows PC so need to install OpenCV on my Mac OSX 10.12.3 and configure it to work with netbeans in a C++ project.
I have explored many avenues to do this but can't seem to come to a solution.
If someone could provide a step by step guide, that would be very helpful. Ideally I would like the most recent version of OpenCV.
Option 1
Install Oracle VirtualBox for free on your Mac and then install Windows in a virtual machine. It is a single file on your Mac so you can remove all that ugly Microsoft stuff as soon as you finish your class. You can run the virtual machine at the same time as macOS (it is not dual boot and doesn't mess with your boot sector) and copy and paste between the two, share files between the two and use networking from the virtual machine.
Option 2
Get a free Amazon EC2 Windows instance and run your OpenCV and NetBeans on there. You can connect from home using RDP from your Mac and also from school so your work is always accessible.
Option 3
Install homebrew on your Mac, then install OpenCV and NetBeans with
brew install opencv
brew install Caskroom/cask/netbeans
Then configure the two to work together as per this post.

Missing file in OpenCV 3.1.0 for Ubuntu 14.04

I am trying to run this code Domain Transform Filter on Ubuntu 14.04. This code has been originally written on Windows 7 Visual studio. When I try to run this code on Ubuntu, I get the error
error: opencv2/core/internal.hpp: No such file or directory
I tried to download this file for Ubuntu but this is specifically related to Windows.
Is there any way to get this file for Ubuntu ?
Install an older OpenCV.
The file is for instance contained in libopencv-core-dev 2.3.1 on Ubuntu 12.04. (So it is not related to Windows.)
If that is not an option, you probably need to correct your existing code for OpenCV 3.

install wx-widgets is driving me insane on Yosemite

I'm on Mac OS X Yosemite 10.10.2. As far as I know, wx-widgets were preinstalled on older versions on OS X (probably that's why google search doesn't help), but that's not the case anymore. I need to get started on a C++ project using wx-widgets, using any IDE (Eclipse, Codelite, or whatever is best). However, I simply cannot get wx-widgets to work. After a workaround I was able to compile on my machine wxWidgets-3.0.2. I called from terminal make and make install, but the libraries seem to not be correctly installed. Indeed, if I create a project on Codelite I get many "wx-config: Command not found" errors. Can someone help me to get me started on installing the libraries and creating a simple project that includes wx-widgets?
I use homebrew which is installed by copying and pasting one line from the homebrew website.
Then, the installation of wxWidgets is simplicity itself with:
brew install wxmac
Any problems, you just call the doctor with
brew doctor
Now you have a proper package manager you can install ImageMagick, GNU Parallel, GNU awk, Oxygen, webkit2html, zeromq, tree, SDL, Redis, sqlitebrowser, pandoc, exiftool, ffmpeg, 7zip, awscli, etc...
You can then compile your wxWidgets programs with
g++ `wx-config --cxxflags` -o sample sample.cpp `wx-config --libs`
I can successfully compile and install wxWidgets on Yosemite with these commands:
- Get the latest sources of wxWidgets 3 from wxwidgets.org and unpack them.
- Move the unpacked directory someplace where you want to keep it.
- Open a terminal and change into the wxwidgets directory.
- Create two directories: build-release and build-debug (don't rename those!)
- Change into wxwidgets/build-release
- Run
../configure --with-osx_cocoa --disable-shared --with-opengl --enable-universal-binary=i386,x86_64 --with-macosx-sdk=/Developer/SDKs/MacOSX10.6.sdk --with-macosx-version-min=10.6
- Run make, then sudo make install
- Change into wxwidgets/build-debug
- Run
../configure --enable-debug --with-osx_cocoa --with-opengl --enable-universal-binary=i386,x86_64 --with-macosx-sdk=/Developer/SDKs/MacOSX10.6.sdk --with-macosx-version-min=10.6
- Run make, then sudo make install
Be aware that these instructions are for compiling against the Mac OS X 10.6 SDK, which I have at /Developer/SDKs/MacOSX10.6.sdk. You can try to omit the --with-macosx-sdk parameter altogether, which will compile using the latest SDK. Also ensure that you have Xcode and the command line developer tools installed.
These commands will install static libraries for the release build and shared libraries for the debug build. You can change this by supplying or omitting the --disable-shared parameter.
The instructions for building and installing wxWidgets are included in the distribution and can also be viewed online.
If your IDE doesn't find wx-config, you must not have the location where you installed it (/usr/local/bin) by default in your PATH. Add it there to fix this.
Like suggested by VZ, you must change your PATH.
But not the variable PATH in your environment Windows but the variable PATH in your C++ project. It's strange but maybe it's different.
Go into (for eclipse) :
C/C++Build->Environment->PATH (add the path of wx-config in the beginning).
Press : Apply, OK and build the project.
I think is strange that Eclipse don't update the PATH after rebooting the OS. Maybe we must add an option to Eclipse for building WxWidget and force Eclipse to update the PATH, but I don't know it.
This change work for me.
Eclipse / MinGW-MSYS / WxWidget 2.8

OpenCV3.0 and Qt creator

I need to use OpenCV with Qt creator, and need some help with OpenCV.
My problem occurs when I run any example or .exe made with OpenCV, after I install OpenCV with CMake (and checking WITH_QT in the process).
For example with the examples included in the installation, when I try to open one I get the following error:
http://answers.opencv.org/upfiles/1413994743487541.png
That says: Procedure entry point not found in the dynamic links library
My S.O. is Windows 8.1, 64 bits
I have tried to reinstall Qt and install differents versions, but the error is the same ever.
But, if I install OpenCV with CMake and don´t check WITH_QT, the examples works perfectly.
I dont know what else can I do!
Thanks!

How to tell make to use mingw32 instead of gcc

I'm trying to build wkhtmltopdf for Windows on an Ubuntu box. I haven't done much with cross-compiling in the past, but I have installed the Mingw32 compiler and am having trouble figuring out how to build qt to target Windows instead of Linux. Right now I am not sure how to tell ./configure to use Mingw32 to build a windows version of Qt when I run make. Can anybody shed some light on how to do this?
I have tried building wkhtmltopdf on Windows in the past, but got stuck at the step where you need to run qmake after building Qt, which is why I am trying to build on a native linux environment instead.