Using SIFT with OpenCV3 on Raspberry Pi - python-2.7

Ok, just got my first Raspberry pi (3). Went on to install Opencv 3.1.0 using Adrian's guide:
How to Install Opencv 3 on Raspbian Jessie
Installed OpenCV WITH CONTRIB packages as I knew I would need them.
So OpenCV is working fine now. The issue is when I try to use SIFT:
"'module' object has no attribute 'xfeatures2d'"
I did and still do everything by the book, including working on 'cv' environment etc.
I tried checking the site-packages dir of both the python dir and the 'cv' env dir and couldn't find any mention of 'contrib' or 'xfeatures2d'.
Maybe that's the problem? How can I check that the contrib packages were actually compiled with OpenCV?
Thanks in advance.

Because u installed the latest version in OpenCV where they removed sift and surf, I am not sure how they substitute them, anyway u have to install older version of opencv 3.4.2.16 also make sure that opencv contrib of the same version is installed, thats the last working version working with sift/surf not sure if there are special versions for raspberry pi

Related

OpenCV version showing wrong

I had installed opencv 2.4.9 it worked fine but I was not able to use imgproc header and drawMarker functions so I decided to install opencv 4.1.0 and I ran the cmake and everything but when I check the opencv version using pkg-config --modversion opencv it shows 2.4.9.
by the way, I use ubuntu 14.04 and want to use c++ with opencv.
This is a common mistake. People are installing opencv from the first link and it is generally installing opencv 2.4.9 automatically they do not decide the version while installing.
First thing you need to do is to uninstall opencv. There is a post in this link how to uninstall opencv. The way I prefered:
sudo apt-get autoremove opencv-doc opencv-data libopencv-dev libopencv2.4-java libopencv2.4-jni python-opencv libopencv-core2.4 libopencv-gpu2.4 libopencv-ts2.4 libopencv-photo2.4 libopencv-contrib2.4 libopencv-imgproc2.4 libopencv-superres2.4 libopencv-stitching2.4 libopencv-ocl2.4 libopencv-legacy2.4 libopencv-ml2.4 libopencv-video2.4 libopencv-videostab2.4 libopencv-objdetect2.4 libopencv-calib3d2.4
Then you need to install opencv again. I strongly recommend you this link. Read that article carefully and do the steps. You can decide the opencv version in the line for example version 3.4.3:
git checkout 3.4.3

Homebrew OS X OpenCV - looking for dylib when running on another Mac

I have a cross platform (Windows + Mac) application, built with QT and C++ libraries, which uses OpenCV. I had previously used an OpenCV version downloaded and compiled on the Mac, but decided to try to use the homebrew version to simplify installation on dev machines.
I did brew install opencv --with-contrib and brew link opencv, and managed to get the program to link and run with the libraries from /usr/local/lib.
Problem is, when I install it on another Mac, the program crashes when I try to run it, saying: Library not loaded: /usr/local/Cellar/ilmbase/2.2.1/lib/libIex-2_2.23.dylib.
I'm not sure what to do. I'm not a Mac expert, and certainly no Homebrew expert. Should I go back to compiling OpenCV myself, or can this be solved?
Thanks.
I faced same issue, but I solved it. homebrew installed latest opencv and dependencies. openexr and ilmbase also installed latest version. but opencv.jar refered specific version of library.(ex libIex-2_2.23.dylib)
So, you'd install ilmbase version 2.2.X. and than solve library issue.
https://github.com/Homebrew/homebrew-core/blob/master/Formula/ilmbase.rb
This link is ilmbase install Formula. You can ckeckout v.2.2 Formula commit.
And than uninstall & re-install ilmbase v.2.2.

Last version of GraphicsMagick for raspbian (Raspberry Pi 3)

I want to use the GraphicsMagick++ library on a C++ project that I am working on in a Raspberry Pi 3 (Raspbian).
I have installed the package using the following command:
sudo apt-get install libgraphicsmagick++-dev
After playing a bit, I have found that the method Image::extent is not defined on Image.h header, while is is shown on the documentation.
Is there any newer version? How to install it?
You can find all the packages related to libgraphicsmagick in debian on https://packages.debian.org/search?keywords=libgraphicsmagick

Uninstall OpenCV 3 Mac OSX

I have installed OpenCV 3.0 on my MacBook pro with Yosemite.
Unfortunately, after the installation, I realized that I needed the version 2.4.9 of OpenCV since I'm going to use some libraries that are not already supported by version 3.0.
How can I completely remove the 3.0 version? Is it enough to delete the OpenCV folder?
Step 1: remove OpenCV version 3 or higher
>> pip uninstall opencv-contrib-python //do this if you installed opencv-contrib-python
OR
>> pip uninstall opencv-python // do this if this is your first time
Step 2: download OpenCV version 2.4.9 from Github and save it to your local computer.
Step 3: go to the folder wherever you downloaded, then install OpenCV 2.4.9
You are all set.

OpenCV imgcodecs.hpp file not found error

I'm trying to compile a C++ program that uses OpenCV to score the similarity of two images:
Image Histogram Compare
When I g++ compile the file:
'opencv2/imgcodecs.hpp' file not found
#include "opencv2/imgcodecs.hpp"
I updated the opencv formula on Mac OS X. I re-ran brew install, but I still get this error.
mdfind imgcodecs.hpp -name
returns nothing - the file is nowhere on my system.
Does anyone know my imgcodecs is not included, and how to include it? I'm really novice at C and OpenCV, and enormously grateful for any help.
I notice that you are looking at tutorial code on the master branch (aka 3.0.0). It uses an imgcodecs module that is not present in earlier versions of OpenCV (e.g. 2.4.9).
Check which version of OpenCV you have (it seems not 3.0.0) and use a matching version of tutorial code (e.g. OpenCV 2.4.9 Histograms_Matching/EqualizeHist_Demo.cpp)