OpenCV and Computer Vision, where are we standing now?

I want to do a project with Computer Vision. Basically the detection / identification of objects. After some research, I keep going back to OpenCV. But all the teaching materials since 2008 (I think it was a little more). It does not seem to compile in Python on Mac. I use the C ++ framework directly from Xcode, but none of the tutorials work because they are outdated, and the documentation is pushing away from what I can analyze.

Is there a better solution for what I'm doing, and does anyone have any suggestions on how to use OpenCV?

thanks

+6
source share
3 answers

I had similar problems with OpenCV, and from my experience this is actually the biggest obstacle to learning it. Here is what worked for me:

  • In this book: โ€œOpenKV 2, Programming Software for Programmers.โ€ This is the most up-to-date book and examples of how to solve various computer vision problems (you can see the table of contents on Amazon using โ€œLook Inside!โ€). It really helped me figure it out. in OpenCV and enjoy the work of the library.

  • As others say, patterns are very useful. For things that a book skips or covers only briefly, you can usually find more detailed examples when viewing samples. You can also find different ways to solve the same problem between the book and the samples. For example, to find key points / functions in a book, an example using FAST functions is shown:

    vector<KeyPoint> keypoints;
    FastFeatureDetector fast(40);
    fast.detect(image, keypoints);

    But in the samples you will find a much more flexible way (if you want to be able to choose which key point detection algorithm to use):

    vector<KeyPoint> keypoints;
    Ptr<FeatureDetector> featureDetector = FeatureDetector::create("FAST");
    featureDetector->detect(image, keypoints);

In my experience, it all starts in the end, and for more specific questions, you start finding the latest blog information or right here in StackOverflow.

+6
source

Let me add a couple of things. First, I can assure you that Python bindings to OpenCV work on Mac. I use them every day.

Many people, such as OpenCV, for many reasons:

  • The license is good, easy to integrate into commercial products, etc.
  • This is good from a technical point of view. It gives you a reference implementation of modern algorithms.
  • It tends to be pretty fast compared to alternatives (Matlab, I look at you).

Like everything in life, this is not ideal:

  • This is a good example of a software library that is a moving target. I have a 300-line program that uses OpenCV, and every month when a new version of OpenCV is released, I have to change it to adapt to new function names / calls, etc. the library is really moving forward, a lot, but this is a pain that you need to change the same program 3 times a year.
  • It has a learning curve, like computer vision, it is quite technically and not easy to learn.

There are alternatives (with other pros and cons). MATLAB with the Image Processing Toolbox is one such example.

+2
source

The simplest answer that comes to mind is to read a sample code with a little understanding and try if your ideas work. Api changes, and most tutorials are written for the first versions of OpenCV, and no one seems to bother to rewrite them. Nevertheless, the basic ideas behind this do not change. Therefore, if you find a tutorial that answers your questions, but written in the old API, just look in the documentation for modern notes on the functions used. It is not easy and fast, but it seems to work. If you are using the latest version (actually 2.3), I suggest using 2.1 documntation and 2.3 docs + tutorials . You should also study the samples that should have been installed next to the library. There are many tips on how to use certain structures and tricks that were not mentioned in the documentation. Finally, don't be afraid to look into the code of the library itself (if you compiled it yourself). Unfortunately, this is the only source I know to check, for example, which code matches the type of the Mat object.

0
source

Source: https://habr.com/ru/post/902915/


All Articles